dot/scripts/cinema.sh
2023-10-09 17:42:22 +01:00

3 lines
377 B
Bash
Executable file

#!/bin/sh
MAIN_DP=$($HOME/.scripts/primary-display.sh);
v=$(xrandr --current --verbose | grep "Brightness" | cut -f2 -d " " | tr '\n' '*' | rev | cut -c 2- | rev | sed -e "s/$/==1/" | bc -l | grep -q 0 && echo 1 || echo 0); xrandr | grep " connected" | cut -f1 -d " " | while read -r line; do echo $line | grep -q $MAIN_DP && : || xrandr --output $line --brightness $v; done