aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/powermenu.sh
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/powermenu.sh')
-rwxr-xr-x.local/bin/powermenu.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/.local/bin/powermenu.sh b/.local/bin/powermenu.sh
index 44816cf..dba1fd1 100755
--- a/.local/bin/powermenu.sh
+++ b/.local/bin/powermenu.sh
@@ -1,6 +1,7 @@
#!/bin/sh
-# read -r wallpaper<~/.cache/wallpaper
+# Get current set wallpaper for the lockscreen option
+read -r wallpaper<~/.cache/wallpaper
#### Options ###
power_off=" Shutdown"
@@ -12,14 +13,15 @@ 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" )"
+# Options passed to fuzzel
+options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen"
+lines="$(echo "$options" | wc -l)"
+rofi_command="fuzzel -d -w 14 -l $((lines+1))"
+chosen="$(echo -e "$options" | $rofi_command )"
+
case $chosen in
"$lock_screen")
- xlock
+ $lock
;;
"$power_off")
doas halt -p
@@ -34,6 +36,6 @@ case $chosen in
# # $lock && WIP
# ;;
"$log_out")
- bspc quit
+ mmsg -d quit
;;
esac