1
0
mirror of https://github.com/Adam-Ant/dotfiles synced 2024-07-06 05:36:16 +00:00
dotfiles/i3/powermenu.sh
2018-02-03 18:09:07 +00:00

16 lines
527 B
Bash
Executable File

#!/bin/bash
option=$(echo "Lock|Logout|Sleep|Power Off|Restart|Windows" | rofi -sep "|" -dmenu -i -p "Power Menu" -auto-select -hide-scrollbar -width -10 -lines 6 -eh 2 -line-margin 6 -bw 7| xargs)
case $option in
Lock) ./lock.sh;;
Logout) i3-msg exit;;
Sleep) systemctl suspend;;
'Power Off') systemctl poweroff;;
Restart) systemctl reboot;;
Windows)
windows=`efibootmgr | grep -Po -m1 'Boot\K(\w{4}).*Windows.*' | head -c4`
`sudo efibootmgr -n $windows`
reboot;;
esac
exit 0