dotfiles/dot_bin/executable_xbrightness

22 lines
470 B
Plaintext
Raw Permalink Normal View History

2023-02-21 23:21:06 -05:00
#!/bin/bash
# control external monitor brightness using ddc/ci
level="$1"
if [ $level -lt 0 ] || [ $level -gt 100 ]; then
echo "brightness must be between 0 and 100"
exit 1
fi
dpys=$(ddcutil detect --async | grep Display | cut -f2 -d' ' | tr '\n' ' ')
# NOTE: as nice as it would be, it seems that I can't run all of these in
# parallel since ddc will get confused (idk why)
for d in $dpys; do
ddcutil setvcp 10 "$level" -d "$d" > /dev/null
done
wait