From 635c736432170b42cd8325f52481508fb557c0ac Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 4 Jun 2023 13:45:31 +0800 Subject: Fixes and finalized auto-update, idle, etc's format --- idle.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'idle.sh') 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 -- cgit v1.2.3