Last active
January 31, 2022 10:12
-
-
Save Thesola10/9b58fe80e2d2a6047ce563e9a78b0c8d to your computer and use it in GitHub Desktop.
(in)elegant weapons, for a more civilized age.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# chroma by Karim Vergnes <me@thesola.io> | |
# License: WTFPL 1.0 | |
# Requires xrandr to work. | |
# Display to modify | |
: ${XRDISP:="eDP1"} | |
# Speed at which to alternate colors | |
: ${COEF:=1} | |
# Intensity of result | |
: ${MAX:=100} | |
xrandr_color_shift() | |
{ | |
xrandr --output $XRDISP --gamma $1:$2:$3 | |
} | |
# Increase factors | |
rinc=$COEF | |
ginc=1 | |
binc=-$COEF | |
red=1 | |
green=1 | |
blue=$MAX | |
trap "xrandr_color_shift 1 1 1 && exit" INT | |
while true | |
do | |
xrandr_color_shift $red $green $blue | |
(( red += rinc )) | |
(( green += ginc )) | |
(( blue += binc )) | |
(( red >= $MAX )) && rinc=-$COEF ginc=$COEF binc=0 | |
(( green >= $MAX )) && rinc=0 ginc=-$COEF binc=$COEF | |
(( blue >= $MAX )) && rinc=$COEF ginc=0 binc=-$COEF | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just cycles the gamma on the selected display. To change the intensity, add a
MAX
environment variable. TheCOEF
environment variable changes the step (the higher the value, the faster the colors will cycle)