aboutsummaryrefslogtreecommitdiff
path: root/bin/backlight-ctl
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-08-24 07:15:01 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-08-24 07:15:01 +0200
commite1f86f92ffcba791739dfea105cb5d8e9081db5e (patch)
tree20f1b97935940533cfd3ab55502dcecfbe217b8e /bin/backlight-ctl
parent4ba52715c7ece96b28fd28693f9f0c232ccad733 (diff)
parent084809954f13205af598127ea00d37b819d927b4 (diff)
downloaddotfiles-e1f86f92ffcba791739dfea105cb5d8e9081db5e.tar.gz
dotfiles-e1f86f92ffcba791739dfea105cb5d8e9081db5e.tar.bz2
dotfiles-e1f86f92ffcba791739dfea105cb5d8e9081db5e.zip
Merge branch 'master' of github.com:cacharle/dotfiles into carbon
Diffstat (limited to 'bin/backlight-ctl')
-rwxr-xr-xbin/backlight-ctl18
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)"