diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-02-06 20:44:09 +0000 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-02-06 20:44:09 +0000 |
commit | e2add462c0d66120867cdb7181a0d9c413f3e4c1 (patch) | |
tree | 4b313161d3300eeb5196d0b49d716cbec2bdc57f /.config/eww/scripts/idleinhibit.sh | |
parent | 7620f87b79f7e8a4cfb6f672094a138518420d7a (diff) |
Initial commit of Eww config
Diffstat (limited to '.config/eww/scripts/idleinhibit.sh')
-rwxr-xr-x | .config/eww/scripts/idleinhibit.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/.config/eww/scripts/idleinhibit.sh b/.config/eww/scripts/idleinhibit.sh new file mode 100755 index 0000000..e8ac78e --- /dev/null +++ b/.config/eww/scripts/idleinhibit.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Swayidle toggle +function toggle { + if pgrep "swayidle" > /dev/null + then + pkill swayidle + notify-send -r 5556 -u normal " Swayidle Inactive" + else + swayidle timeout 300 'swaylock -F -i ~/.cache/wallpaper --effect-blur 10x5 --clock --indicator' timeout 600 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' & + notify-send -r 5556 -u normal " Swayidle Active" + fi +} + +case $1 in + toggle) + toggle + ;; + *) + if pgrep "swayidle" > /dev/null + then + icon="" + else + icon="" + fi + printf "%s" "$icon " + ;; +esac + |