diff options
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/power-menu.sh | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/.local/bin/power-menu.sh b/.local/bin/power-menu.sh new file mode 100755 index 0000000..b884b17 --- /dev/null +++ b/.local/bin/power-menu.sh @@ -0,0 +1,45 @@ +#!/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" + +# 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 && zzz +        exit 0 +        ;; +    "$hibernate") +        # $lock && WIP +        exit 0 +        ;; +    "$log_out") +        swaymsg exit +        exit 0 +        ;; +    "$lock_screen") +        swaylock -f -i "$wallpaper" +        exit 0 +        ;; +esac + +# Display all options in menu +echo -e "$options"  | 
