dot/scripts/gamma.sh

11 lines
397 B
Bash
Raw Normal View History

2021-10-09 21:20:41 +00:00
#!/bin/bash
2023-10-09 16:42:22 +00:00
MAIN_DP=$($HOME/.scripts/primary-display.sh);
2021-10-09 21:20:41 +00:00
v=$1
if [ $# -ne 0 ]; then
xrandr --output $MAIN_DP --gamma $(paste -d" " <(xrandr | grep " connected" | cut -f1 -d " ") <(xrandr --current --verbose | grep "Gamma" | cut -f7 -d" " | cut -f1 -d":" | xargs -I % echo "1/%") | grep $MAIN_DP | cut -d" " -f2 | xargs -I % echo "%*$v" | bc -l)
else
2023-10-09 16:42:22 +00:00
xrandr --output $MAIN_DP --gamma 1.1
2021-10-09 21:20:41 +00:00
fi