-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrofi_power_menu.sh
executable file
·42 lines (37 loc) · 999 Bytes
/
rofi_power_menu.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# This is a fork from a fork.
# bdelphin's rofi-power fork
# Use rofi to call systemctl for shutdown, reboot, etc
# This script was forked from Oliver Kraitschy's rofi-power - http://okraits.de
OPTIONS="Reboot system\nPower-off system\nSuspend system\nHibernate system\nLock system\nExit window manager"
LAUNCHER="rofi -dmenu -i -p rofi-power:"
#USE_LOCKER="false"
#LOCKER="$HOME/scripts/lockscript/lock -n"
option=`echo -e $OPTIONS | $LAUNCHER | awk '{print $1}' | tr -d '\r\n'`
if [ ${#option} -gt 0 ]
then
case $option in
Reboot)
systemctl reboot
;;
Power-off)
systemctl poweroff
;;
Suspend)
systemctl suspend
#$($USE_LOCKER) && "$LOCKER"; systemctl hibernate
;;
Hibernate)
systemctl hibernate
#$($USE_LOCKER) && "$LOCKER"; systemctl hibernate
;;
Lock)
dm-tool lock
;;
Exit)
i3-msg exit
;;
*)
;;
esac
fi