From 605f3943f7acf564530d4a064560d1709f1b847e Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Sun, 10 Apr 2016 20:14:59 -0700 Subject: [PATCH] Add hdmi-dimmer.sh --- hdmi-dimmer.sh | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) create mode 100755 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}" -- 1.6.6.rc1.39.g9a42