-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd-power
More file actions
executable file
·64 lines (51 loc) · 1.32 KB
/
d-power
File metadata and controls
executable file
·64 lines (51 loc) · 1.32 KB
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
58
59
60
61
62
63
64
#!/usr/bin/env bash
source d-var.conf
wifi_m="Wifi Menu"
power_m="Power Menu"
sshot_m="Screen Shot"
lock="Lock"
suspend="Suspend/Sleep"
brightn="Brightness"
volume="Change Volume"
stats="System Stats"
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$suspend\n$brightn\n$volume\n$stats" | sort | $S_MENU -p 'Control: ' )"
case "$chosen" in
"$power_m")
power="$(printf "$poweroff\n$reboot\n$screenoff" | sort | $S_MENU -p 'Power: ' )"
case "$power" in
"$poweroff") poweroff ;;
"$reboot") reboot ;;
"$screenoff") hyprctl dispatch dpms off ;;
esac
;;
"$wifi_m") d-wifi ;;
"$lock") hyprlock ;;
"$suspend") systemctl suspend;;
"$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 'Volume: ')"
case "$vol" in
"$volup") pamixer -ui 5 ;;
"$voldown") pamixer -ud 5 ;;
"$mute") pamixer -t ;;
esac
;;
"$stats")
d-stats ;;
*) exit 1 ;;
esac