mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
powermenu: add hibernate option
This commit is contained in:
parent
91cb7ea620
commit
209ce198f3
@ -1,17 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
option=$(echo " lock| logout| sleep| power off| reboot| windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 8 -lines 6 -location 3 -tokenize false -matching normal | xargs)
|
option=$(echo " lock| logout| sleep| hibernate| power off| reboot| windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 8 -lines 6 -location 3 -tokenize false -matching normal | xargs)
|
||||||
|
|
||||||
case $option in
|
case $option in
|
||||||
lock) ./lock.sh;;
|
lock) ./lock.sh;;
|
||||||
logout) i3-msg exit;;
|
logout) i3-msg exit;;
|
||||||
sleep) systemctl suspend;;
|
sleep) systemctl suspend;;
|
||||||
|
hibernate) systemctl hibernate;;
|
||||||
power\ off) systemctl poweroff;;
|
power\ off) systemctl poweroff;;
|
||||||
reboot) systemctl reboot;;
|
reboot) systemctl reboot;;
|
||||||
windows)
|
windows)
|
||||||
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
|
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
|
||||||
sudo efibootmgr -n $windows
|
sudo efibootmgr -n $windows
|
||||||
systemctl reboot;;
|
sudo hibereboot;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user