6e5a5ccb |
1 | #!/bin/bash |
2 | |
a442b5f5 |
3 | # rofi_command="rofi -theme blackpearl/powermenu.rasi" |
4 | rofi_command="rofi -theme darknix/powermenu.rasi" |
6e5a5ccb |
5 | |
6 | ### Options ### |
7 | power_off="" |
8 | reboot="" |
a442b5f5 |
9 | lock="" |
10 | suspend="⏾" |
11 | log_out="" |
6e5a5ccb |
12 | # Variable passed to rofi |
13 | options="$power_off\n$reboot\n$lock\n$suspend\n$log_out" |
14 | |
a442b5f5 |
15 | chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 0)" |
6e5a5ccb |
16 | case $chosen in |
17 | $power_off) |
18 | notify-send 'shutting down' 'the system is going to shutdown now' |
19 | sleep 1 |
20 | sudo /sbin/shutdown -h now |
21 | ;; |
22 | $reboot) |
23 | notify-send 'rebooting the system' 'the system is going to reboot now' |
24 | sleep 1 |
25 | sudo /sbin/shutdown -r now |
26 | ;; |
27 | $lock) |
28 | sleep 1 |
a442b5f5 |
29 | i3lock-fancy |
6e5a5ccb |
30 | ;; |
31 | $suspend) |
32 | sleep 1 |
33 | i3suspend |
34 | ;; |
35 | $log_out) |
36 | i3-exit |
37 | ;; |
38 | esac |
39 | |