1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00
dotfiles/i3/powermenu.sh
Joe Groocock 60bf423556
dotfiles: move .config/* to root
This seems to make more sense. Almost all files were within .config
anyway.

Signed-off-by: Joe Groocock <me@frebib.net>
2020-08-10 22:42:14 +01:00

18 lines
665 B
Bash
Executable File

#!/bin/sh
option="$(echo " lock| logout| sleep| hibernate| power off| reboot| windows" | \
rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 10 -lines 7 -location 3 -tokenize false -matching normal | cut -d' ' -f2- | xargs)"
case $option in
lock) dm-tool switch-to-greeter;;
logout) systemctl --user exit;;
sleep) systemctl suspend;;
hibernate) systemctl hibernate;;
power\ off) systemctl poweroff;;
reboot) systemctl reboot;;
windows)
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
sudo efibootmgr -n $windows
reboot;;
esac