2020-01-30 15:50:41 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-22 01:55:37 +02:00
|
|
|
type xbacklight >/dev/null 2>&1 || { echo >&2 "I require xbacklight but it's not installed. Aborting."; exit 1; }
|
|
|
|
type dunstify >/dev/null 2>&1 || { echo >&2 "I require dunstify but it's not installed. Aborting."; exit 1; }
|
2020-01-30 15:50:41 +01:00
|
|
|
|
|
|
|
case $1 in
|
|
|
|
"up"*)
|
|
|
|
xbacklight -inc 10 &
|
|
|
|
currentBrightness=$(xbacklight | cut -d\. -f1);
|
|
|
|
dunstify -r 1 'brightness up'\ \($currentBrightness%\);
|
|
|
|
;;
|
|
|
|
"down"*)
|
|
|
|
xbacklight -dec 10 &
|
|
|
|
currentBrightness=$(xbacklight | cut -d\. -f1);
|
|
|
|
dunstify -r 1 'brightness down'\ \($currentBrightness%\);
|
|
|
|
;;
|
|
|
|
esac
|