nixos-config/modules/home/scripts/scripts/ddcmonitorctl.sh
2024-12-30 16:05:37 +01:00

14 lines
295 B
Bash
Executable file

if [ "$1" == "on" ]; then
state_opt=1
elif [ "$1" == "off" ]; then
state_opt=4
else
echo "First argument must be either 'on' or 'off'"
exit 1
fi
monitor_count=$(bash -c "ddcutil detect | grep Display | wc -l")
seq "$monitor_count" | xargs -n 1 ddcutil setvcp d6 $state_opt -d