Skip to content

Instantly share code, notes, and snippets.

@jorgejch
Created November 26, 2015 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgejch/4b661a6489e691ebe18f to your computer and use it in GitHub Desktop.
Save jorgejch/4b661a6489e691ebe18f to your computer and use it in GitHub Desktop.
A backlight control command for bashrc.
# Usage: $ bl <integer><- or +>
function bl {
INC_PARAM=10
DEC_PARAM=-${INC_PARAM}
case $1 in
+([0-9])- ) xbacklight -inc $(expr -1 + $DEC_PARAM \* ${1%-}); return 0;;
+([0-9])+ ) xbacklight -inc $(expr 1 + $INC_PARAM \* ${1%+}); return 0;;
* ) return 1;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment