diff options
| author | Justine Smithies <justine@smithies.me.uk> | 2026-01-24 17:24:58 +0000 |
|---|---|---|
| committer | Justine Smithies <justine@smithies.me.uk> | 2026-01-24 17:24:58 +0000 |
| commit | 1d6a548bcbe85ee95e986c475b23733c2977bf04 (patch) | |
| tree | 7605c43bf5b4f4044a606c6b404ab9d71cd55ddc /.local/bin/power-menu-fuzzel.sh | |
| parent | 818cb6579e422a03da5564ef93715f43f969954c (diff) | |
Initial commit
Diffstat (limited to '.local/bin/power-menu-fuzzel.sh')
| -rwxr-xr-x | .local/bin/power-menu-fuzzel.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/.local/bin/power-menu-fuzzel.sh b/.local/bin/power-menu-fuzzel.sh new file mode 100755 index 0000000..a182d31 --- /dev/null +++ b/.local/bin/power-menu-fuzzel.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# Get current set wallpaper for the lockscreen option +read -r wallpaper<~/.cache/wallpaper + +# Option text to display +power_off=" Shutdown" +reboot=" Reboot" +lock_screen=" Lock Screen" +suspend=" Suspend" +hibernate=" Hibernate" +log_out=" Log Out" + +#lock="swaylock -f -i "$wallpaper"" +lock="swaylock -f -i $wallpaper --effect-blur 10x5 --clock --datestr '%a %d %b %Y' --indicator" + +# Options passed to fuzzel +options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen" +lines="$(echo "$options" | grep -oF '\n' | wc -l)" +rofi_command="fuzzel -d -w 14 -l $((lines+1))" +chosen="$(echo -e "$options" | $rofi_command )" + +case $chosen in + "$lock_screen") + swaylock -f -i "$wallpaper" --effect-blur 10x5 --clock --datestr "%a %d %b %Y" --indicator + ;; + "$power_off") + doas poweroff + ;; + "$reboot") + doas reboot + ;; + "$suspend") + $lock && doas zzz + ;; + "$hibernate") + # $lock && WIP + ;; + "$log_out") + mmsg -d quit + ;; +esac |
