config/rofi/script/powermenu.sh (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#!/usr/bin/env bash
declare options=("ShutDown\nLogOut\nReboot")
rofitheme="nten-light-dmenu"
choice=$(echo -e ${options[@]} | rofi -dmenu -p "Power" -theme $rofitheme)
case $choice in
"ShutDown")
case "$(echo -e "Yes\nNo" | rofi -dmenu -p "ShutDown" -theme $rofitheme)" in
"Yes") exec systemctl poweroff ;;
"no") exec exit 0 ;;
esac
;;
"LogOut")
case "$(echo -e "Yes\nNo" | rofi -dmenu -p "LogOut" -theme $rofitheme)" in
"Yes") exec loginctl terminate-session $XDG_SESSION_ID ;;
"No") exec exit 0 ;;
esac
;;
"Reboot")
case "$(echo -e "Yes\nNo" | rofi -dmenu -p "Reboot" -theme $rofitheme)" in
"Yes") exec systemctl reboot ;;
"No") exec exit 0 ;;
esac
;;
esac
|