aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-08-10 22:54:26 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-08-10 22:54:26 +0200
commit7b0c15c647b82baa8f2ed55d2abbc6869172afc9 (patch)
tree442390c799e15dfb50131c00e0366f8f31b2582c /bin
parent7e1ae8bf92d08665a647422071e6d92a4aca3456 (diff)
downloaddotfiles-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-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)"