summaryrefslogtreecommitdiff
path: root/idle.sh
diff options
context:
space:
mode:
authorlittleblack111 <jerrylam110209@gmail.com>2023-05-28 14:48:54 +0800
committerlittleblack111 <jerrylam110209@gmail.com>2023-05-28 14:48:54 +0800
commitc086caa833f0a51a2897a45284c592af1013f064 (patch)
treeca754a23a2573f9b6a6dcbe126c3fe50563c052d /idle.sh
parent924dfef1fa40ea4ad7f82d9d11d903c1fbf0fdc6 (diff)
update
Diffstat (limited to 'idle.sh')
-rwxr-xr-xidle.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/idle.sh b/idle.sh
new file mode 100755
index 0000000..7202fd7
--- /dev/null
+++ b/idle.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+
+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)
+ exec $HOME/scripts/auto-update.sh &
+ killall picom; bspcomp &
+ else
+ sleep 60
+ fi
+ fi
+done