From 7b0c15c647b82baa8f2ed55d2abbc6869172afc9 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 10 Aug 2020 22:54:26 +0200 Subject: Fixing backlight-ctl to be compatible with both machines --- bin/backlight-ctl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'bin/backlight-ctl') 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)" -- cgit