diff options
author | Justine Smithies <justine@openbsd-desktop.localdomain> | 2025-10-07 20:51:04 +0100 |
---|---|---|
committer | Justine Smithies <justine@openbsd-desktop.localdomain> | 2025-10-07 20:51:04 +0100 |
commit | d85ad60a74c75af5cc9ad0a8e1127d0bf41a7af4 (patch) | |
tree | f498e8c7f694f24ea3b45c44bd0cb38b7cab937b /.local/bin/powermenu.sh | |
parent | e737b64c4b5c56c2ffbf182138147a0763912a02 (diff) |
Initial commit
Diffstat (limited to '.local/bin/powermenu.sh')
-rwxr-xr-x | .local/bin/powermenu.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/.local/bin/powermenu.sh b/.local/bin/powermenu.sh new file mode 100755 index 0000000..fabc31a --- /dev/null +++ b/.local/bin/powermenu.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# read -r wallpaper<~/.cache/wallpaper + +#### Options ### +power_off=" Shutdown" +reboot=" Reboot" +lock_screen=" Lock Screen" +suspend=" Suspend" +hibernate=" Hibernate" +log_out=" Log Out" + +lock="swaylock -f -i "$wallpaper"" + +# Options passed to rofi +# options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen" +options="$power_off\n$reboot\n$log_out\n$lock_screen" +rofi_command="rofi -theme themes/power-menu.rasi -i " +chosen="$(echo -e "$options" | $rofi_command -dmenu -mesg "Power Menu" )" +case $chosen in + "$lock_screen") + xlock -mode julia + ;; + "$power_off") + doas halt -p + ;; + "$reboot") + doas reboot + ;; + # "$suspend") + # $lock && zzz + # ;; + # "$hibernate") + # # $lock && WIP + # ;; + "$log_out") + herbstclient quit + ;; +esac |