diff options
| author | littleblack111 <jerrylam110209@gmail.com> | 2023-06-04 13:45:31 +0800 |
|---|---|---|
| committer | littleblack111 <jerrylam110209@gmail.com> | 2023-06-04 13:45:31 +0800 |
| commit | 635c736432170b42cd8325f52481508fb557c0ac (patch) | |
| tree | 8f51f82ceeb3b83be12d9b5efaa5b77a2d1f4ae8 /idle.sh | |
| parent | 61b5d7f614520cbc1bf9bae6994890eddffce09d (diff) | |
Fixes and finalized auto-update, idle, etc's format
Diffstat (limited to 'idle.sh')
| -rwxr-xr-x | idle.sh | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 |
