Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
X window selective brightness control - using Xrandr and awk
BRIGHTNESS=`xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1`
NEW_BRIGHTNESS=`awk '{print $1-$2}' <<<"$BRIGHTNESS 0.05"`
echo $NEW_BRIGHTNESS
xrandr --output DVI-I-1 --brightness $NEW_BRIGHTNESS
xrandr --output DVI-I-2 --brightness $NEW_BRIGHTNESS
BRIGHTNESS=`xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1`
NEW_BRIGHTNESS=`awk '{print $1+$2}' <<<"$BRIGHTNESS 0.05"`
echo $NEW_BRIGHTNESS
xrandr --output DVI-I-1 --brightness $NEW_BRIGHTNESS
xrandr --output DVI-I-2 --brightness $NEW_BRIGHTNESS
xrandr --output DVI-I-1 --brightness 1
xrandr --output DVI-I-2 --brightness 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.