aboutsummaryrefslogtreecommitdiff
path: root/.config/waybar/scripts/idleinhibit.sh
diff options
context:
space:
mode:
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