aboutsummaryrefslogtreecommitdiff
path: root/.config/waybar/scripts/idleinhibit.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2026-01-24 17:19:05 +0000
committerJustine Smithies <justine@smithies.me.uk>2026-01-24 17:19:05 +0000
commit278f79a4cb5f844e76bb47e50534ed5e28f36505 (patch)
tree7ac1232511f162cdd82e1c1415c99a6c0ae0ba65 /.config/waybar/scripts/idleinhibit.sh
parent5f7f807bfcfb09bd9b745b0530892046e2475307 (diff)
Initial commit
Diffstat (limited to '.config/waybar/scripts/idleinhibit.sh')
-rwxr-xr-x.config/waybar/scripts/idleinhibit.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/.config/waybar/scripts/idleinhibit.sh b/.config/waybar/scripts/idleinhibit.sh
new file mode 100755
index 0000000..c24f715
--- /dev/null
+++ b/.config/waybar/scripts/idleinhibit.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Swayidle toggle
+toggle() {
+ if pgrep "swayidle" > /dev/null
+ then
+ pkill swayidle
+ notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Inactive"
+ else
+ sh "$HOME/.config/river/scripts/swayidle-update.sh"
+ notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Active"
+ fi
+}
+
+case $1 in
+ toggle)
+ toggle
+ ;;
+ *)
+ if pgrep "swayidle" > /dev/null
+ then
+ icon=""
+ else
+ icon=""
+ fi
+ printf "%s" "$icon "
+ ;;
+esac