summaryrefslogtreecommitdiff
path: root/idle.sh
diff options
context:
space:
mode:
Diffstat (limited to 'idle.sh')
-rwxr-xr-xidle.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/idle.sh b/idle.sh
index ff833a4..5d2d592 100755
--- a/idle.sh
+++ b/idle.sh
@@ -4,8 +4,16 @@
while true; do
if [[ "$(systemctl is-system-running)" == "running" || "$(systemctl is-system-running)" == "degraded" ]]; then
if [[ "$(xprintidle)" -gt 600000 ]]; then # Changed from 600000 (10 minutes) to 3600000 (1 hour)
- $HOME/scripts/auto-update.sh &
- killall picom; bspcomp &
+ if [ ! -f /var/lock/idle.lock ]; then
+ $HOME/scripts/update.sh &
+ killall picom; bspcomp &
+ sudo touch /var/lock/idle.lock
+ elif [[ "$(xprintidle)" -le 50 ]]; then
+ sudo rm -f /var/lock/idle.lock
+ continue
+ else
+ sleep 5
+ fi
else
sleep 60
fi