diff options
author | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2017-03-16 10:14:08 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2017-03-16 10:14:08 +0000 |
commit | 8c9d6f88d525d7bfe7833eff27cd61c036a4d2c0 (patch) | |
tree | 53ecd762c442126af443e589ea23a04d2aeeab0e /bin | |
parent | pre-command for set-screen (diff) | |
download | misc-scripts-8c9d6f88d525d7bfe7833eff27cd61c036a4d2c0.tar.gz misc-scripts-8c9d6f88d525d7bfe7833eff27cd61c036a4d2c0.tar.bz2 misc-scripts-8c9d6f88d525d7bfe7833eff27cd61c036a4d2c0.zip |
xrandr-aware xgamma replacement
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gamma | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/gamma b/bin/gamma new file mode 100755 index 0000000..57cdc7f --- /dev/null +++ b/bin/gamma @@ -0,0 +1,16 @@ +#!/bin/bash + +if [[ ${#@} == 1 ]]; then + red=$1 + blue=$1 + green=$1 +else + red=$1 + blue=$2 + green=$3 +fi + +declare -a outputs=( $(xrandr --query --current | perl -nle 'm{^(\S+) connected} and print $1' ) ) +for o in "${outputs[@]}"; do + xrandr --output "$o" --gamma "${red}:${green}:${blue}" +done |