dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 23485a2715b62ae8d504db8e584ee284b3d152a5
parent 3223fe69b9238d1e35edd570df5147e7317aee1b
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Wed, 24 Jan 2018 06:50:15 -0500

Add support for keyboard/monitor backlight bindings

Diffstat:
M.local/bin/my | 25+++++++++++++++++++++++++
M.xbindkeysrc | 12++++++++++++
2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/.local/bin/my b/.local/bin/my @@ -177,4 +177,29 @@ case $command in fi exec my wallpaper ;; + brightness) + if type xbacklight > /dev/null 2>&1 + then + if [ "$1" = "monitor" ] + then + # Future-proofing ... gmux is specific, imagine other + # systems will be different + for opt in gmux + do + selection=`xbacklight -list | grep $opt` + num=`echo $selection | wc -w` + [ $num -gt 0 ] && break + done + else + selection=`xbacklight -list | grep $1` + num=`echo $selection | wc -w` + fi + [ $num -gt 1 ] && __mylog "my brightness" "More than one $1" && exit 1 + [ $num -lt 1 ] && __mylog "my brightness" "No $1 to adjust" && exit 1 + shift + exec xbacklight -ctrl $selection "$@" + else + __mylog "my brightness" "No handler found" + fi + ;; esac diff --git a/.xbindkeysrc b/.xbindkeysrc @@ -37,3 +37,15 @@ "my shutdown" control+shift+Mod1 + BackSpace + +"my brightness kbd -inc 10" + XF86KbdBrightnessUp + +"my brightness kbd -dec 10" + XF86KbdBrightnessDown + +"my brightness monitor -inc 10" + XF86MonBrightnessUp + +"my brightness monitor -dec 10" + XF86MonBrightnessDown