-
Notifications
You must be signed in to change notification settings - Fork 0
/
d-power
executable file
·57 lines (46 loc) · 1.25 KB
/
d-power
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
source d-var.conf
wifi_m=" Wifi Menu"
power_m=" Power Menu"
sshot_m=" Screen Shot"
lock=" Lock/Suspend"
brightn=" Brightness"
volume=" Change Volume"
poweroff=" Power Off"
reboot=" Reboot"
screenoff=" Screen Off"
brightup=" Increase Brightness"
brightdown=" Decrease Brightness"
volup=" Increase Volume"
voldown=" Decrease Volume"
mute=" Mute"
chosen="$(printf "$wifi_m\n$power_m\n$sshot_m\n$lock\n$brightn\n$volume" | sort | $S_MENU -p ' ' )"
case "$chosen" in
"$power_m")
power="$(printf "$poweroff\n$reboot\n$screenoff" | sort | $S_MENU -p ' ' )"
case "$power" in
"$poweroff") poweroff ;;
"$reboot") reboot ;;
"$screenoff") hyprctl dispatch dpms off ;;
esac
;;
"$wifi_m") d-wifi ;;
"$lock") hyprlock ;;
"$brightn")
bright="$(printf "$brightup\n$brightdown" | sort | $D_MENU )"
case "$bright" in
"$brightup") brightnessctl set +2% ;;
"$brightdown") brightnessctl set 2%- ;;
esac
;;
"$sshot_m") d-sshot ;;
"$volume")
vol="$(printf "$volup\n$voldown\n$mute" | sort | $D_MENU -p ' ')"
case "$vol" in
"$volup") pamixer -ui 5 ;;
"$voldown") pamixer -ud 5 ;;
"$mute") pamixer -t ;;
esac
;;
*) exit 1 ;;
esac