ADD external brighntess controller

This commit is contained in:
Nathan Dwarshuis 2023-02-21 23:21:06 -05:00
parent 1f866f554c
commit 7be783cb1b
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/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