aboutsummaryrefslogtreecommitdiffstats
path: root/bin/inhibit-idle.sh
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2024-12-25 14:55:37 +0000
committerLeonardo Bishop <me@leonardobishop.com>2024-12-25 14:55:37 +0000
commit59fd10c296ee5fda22226ffd71707ca597f85ed7 (patch)
tree7c1f2457706783674f437975973840eb0f34b741 /bin/inhibit-idle.sh
parentf2866e8ad4a9ba0b12ea047b2f72f7d7d457d63f (diff)
Add bin
Diffstat (limited to 'bin/inhibit-idle.sh')
-rwxr-xr-xbin/inhibit-idle.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/inhibit-idle.sh b/bin/inhibit-idle.sh
new file mode 100755
index 0000000..c52ff41
--- /dev/null
+++ b/bin/inhibit-idle.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -uo pipefail
+
+idleprog="hypridle"
+
+isactive="$(systemctl --user is-active $idleprog)"
+if [ "$isactive" = "active" ]; then
+ systemctl --user stop $idleprog
+ notify-send "Idle Inhibitor" "$idleprog suspended (systemd)"
+else
+ systemctl --user start $idleprog
+ notify-send "Idle Inhibitor" "$idleprog resumed (systemd)"
+fi
+