blob: 85c6c7bd6124fc1c6181974abbee4eaab4caf85a (
plain)
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
|
#!/bin/sh
# unused for now, repurposing for ddcutil control
## back in use!
CHOICE=$(printf "brightness\ncontrast\ntoggle secondary display" | dmenu -c -i -l 3)
DISPLAY_STATUS=$(xrandr | grep DisplayPort-0)
MONITORS="1 2"
toggle() {
case $DISPLAY_STATUS in
*3440x1440*)
xrandr --output DisplayPort-0 --off;;
*)
init_displays;;
esac
}
get_value() {
VALUE=$(printf "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100" | dmenu -c -i -p "value to set")
}
case $CHOICE in
"brightness")
get_value
for monitor in $MONITORS; do
ddcutil -d $monitor setvcp 10 $VALUE
done;;
"contrast")
get_value
for monitor in $MONITORS; do
ddcutil -d $monitor setvcp 12 $VALUE
done;;
"toggle secondary display")
toggle;;
esac
|