diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-08-10 22:54:26 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-08-10 22:54:26 +0200 |
| commit | 7b0c15c647b82baa8f2ed55d2abbc6869172afc9 (patch) | |
| tree | 442390c799e15dfb50131c00e0366f8f31b2582c /bin | |
| parent | 7e1ae8bf92d08665a647422071e6d92a4aca3456 (diff) | |
| download | dotfiles-7b0c15c647b82baa8f2ed55d2abbc6869172afc9.tar.gz dotfiles-7b0c15c647b82baa8f2ed55d2abbc6869172afc9.tar.bz2 dotfiles-7b0c15c647b82baa8f2ed55d2abbc6869172afc9.zip | |
Fixing backlight-ctl to be compatible with both machines
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/backlight-ctl | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/bin/backlight-ctl b/bin/backlight-ctl index 7153276..2963d83 100755 --- a/bin/backlight-ctl +++ b/bin/backlight-ctl @@ -2,10 +2,22 @@ [ "$#" -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") xbacklight -inc 5 ;; - "down") xbacklight -dec 5 ;; + "up") "$cmd" "$up_opt" 5 ;; + "down") "$cmd" "$down_opt" 5 ;; *) exit 1 ;; esac -notify-send "backlight $(xbacklight | cut -d '.' -f 1)" +notify-send "backlight $("$cmd" | cut -d '.' -f 1)" |
