aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/powermenu.sh
blob: fabc31adb596fb8051cab923261545b3284d1c2e (plain) (blame)
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
#!/bin/sh

# read -r wallpaper<~/.cache/wallpaper

#### Options ###
power_off=" Shutdown"
reboot="󰜉 Reboot"
lock_screen=" Lock Screen"
suspend=" Suspend"
hibernate="󰒲 Hibernate"
log_out="󰍃 Log Out"

lock="swaylock -f -i "$wallpaper""

# Options passed to rofi
# options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen"
options="$power_off\n$reboot\n$log_out\n$lock_screen"
rofi_command="rofi -theme themes/power-menu.rasi -i " 
chosen="$(echo -e "$options" | $rofi_command -dmenu -mesg "Power Menu" )"
case $chosen in
    "$lock_screen")
        xlock -mode julia
        ;;    
    "$power_off")
        doas halt -p
        ;;
    "$reboot")
        doas reboot
        ;;
    # "$suspend")
    #     $lock && zzz
    #     ;;
    # "$hibernate")
    #     # $lock && WIP
    #     ;;
    "$log_out")
        herbstclient quit
        ;;
esac