diff options
Diffstat (limited to '.local/bin/power-menu-rofi.sh')
| -rwxr-xr-x | .local/bin/power-menu-rofi.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.local/bin/power-menu-rofi.sh b/.local/bin/power-menu-rofi.sh new file mode 100755 index 0000000..a1de712 --- /dev/null +++ b/.local/bin/power-menu-rofi.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# Get current set wallpaper for the lockscreen option +read -r wallpaper<~/.cache/wallpaper + +lock="swaylock -f -i $wallpaper --effect-blur 10x5 --clock --datestr '%a %d %b %Y' --indicator" + +# Option text to Display +power_off=" Shutdown" +reboot=" Reboot" +lock_screen=" Lock Screen" +suspend=" Suspend" +hibernate=" Hibernate" +log_out=" Log Out" + +# Menu display order +options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen" + +case "$@" in + "$power_off") + doas poweroff + exit 0 + ;; + "$reboot") + doas reboot + exit 0 + ;; + "$suspend") + $lock && doas zzz + exit 0 + ;; + "$hibernate") + # $lock && WIP + exit 0 + ;; + "$log_out") + mmsg -d quit + exit 0 + ;; + "$lock_screen") + swaylock -f -i "$wallpaper" --effect-blur 10x5 --clock --datestr "%a %d %b %Y" --indicator + exit 0 + ;; +esac + +# Display all options in menu +echo -e "$options" |
