diff --git a/rofi/desktop/Power.desktop b/rofi/desktop/Power.desktop index e4cab04..a6d41da 100755 --- a/rofi/desktop/Power.desktop +++ b/rofi/desktop/Power.desktop @@ -3,5 +3,5 @@ Type=Application Version=1.0 Name=Power -Exec=sh ~/.config/rofi/scripts/media_controls +Exec=sh ~/.config/rofi/scripts/power_menu Terminal=false diff --git a/rofi/scripts/power_menu b/rofi/scripts/power_menu new file mode 100755 index 0000000..c1c673d --- /dev/null +++ b/rofi/scripts/power_menu @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +OPTIONS=" Lock +鈴 Sleep + Logout + Poweroff +淚 Restart" + +SELECTED="$( +rofi -dmenu \ + -theme applet \ + -p "System" \ + -i \ + -line-padding 4 <<< $OPTIONS +)" + +echo $SELECTED + +case $SELECTED in + *Lock) + swaylock-fancy ;; + *Sleep) + systemctl hibernate ;; + *Logout) + swaymsg exit ;; + *Poweroff) + systemctl poweroff ;; + *Restart) + systemctl reboot ;; + *) + echo $SELCTED ;; +esac +