diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-02-24 17:07:33 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-02-24 17:07:33 +0100 |
| commit | 468a789dbc4b1928c035d8590895efc533520a27 (patch) | |
| tree | 74cb056c37eaa50cd50491a7665608488ed4feb1 /local/bin/backlight-ctl | |
| parent | f9883d2c3b3699d91e98feeffd7eece546f7c57e (diff) | |
| download | dotfiles-468a789dbc4b1928c035d8590895efc533520a27.tar.gz dotfiles-468a789dbc4b1928c035d8590895efc533520a27.tar.bz2 dotfiles-468a789dbc4b1928c035d8590895efc533520a27.zip | |
Updated file tree to match XDG base directory specification
Diffstat (limited to 'local/bin/backlight-ctl')
| -rwxr-xr-x | local/bin/backlight-ctl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/local/bin/backlight-ctl b/local/bin/backlight-ctl new file mode 100755 index 0000000..2963d83 --- /dev/null +++ b/local/bin/backlight-ctl @@ -0,0 +1,23 @@ +#!/bin/sh + +[ "$#" -ne 1 ] && exit 1; + + +if [ "$(hostname)" = manjaro ] +then + cmd=light + up_opt=-A + down_opt=-U +else + cmd=xbacklight + up_opt=-inc + down_opt=-dec +fi + +case "$1" in + "up") "$cmd" "$up_opt" 5 ;; + "down") "$cmd" "$down_opt" 5 ;; + *) exit 1 ;; +esac + +notify-send "backlight $("$cmd" | cut -d '.' -f 1)" |
