From: Colin Patrick Mccabe Date: Mon, 11 Apr 2016 03:14:59 +0000 (-0700) Subject: Add hdmi-dimmer.sh X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=605f3943f7acf564530d4a064560d1709f1b847e;p=cmccabe-bin Add hdmi-dimmer.sh --- diff --git a/hdmi-dimmer.sh b/hdmi-dimmer.sh new file mode 100755 index 0000000..fae3c1b --- /dev/null +++ b/hdmi-dimmer.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +usage() { + cat << EOF +hdmi-dimmer.sh: dims an HDMI screen using xrandr. + +usage: hdmi-dimmer.sh [brightness] + where brightness is a float from 0.0 to 1.0 + +example: hdmi-dimmer.sh 0.5 +EOF + exit 0 +} + +[ $# -lt 1 ] && usage +BRIGHTNESS="${1}" +[ "x$BRIGHTNESS" == "x-h" ] && usage +[ "x$BRIGHTNESS" == "x--help" ] && usage + +set -x +set -e +xrandr --output HDMI1 --brightness "${BRIGHTNESS}"