This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
2019-04-22 16:17:15 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euf -o pipefail
|
|
|
|
|
|
|
|
function send_notification {
|
|
|
|
icon="/home/deadguy/.local/share/icons/ArchLabs-Light/24x24/actions/contrast.svg"
|
2019-05-05 15:19:30 +00:00
|
|
|
dunstify -i "$icon" -r 5555 -u low " $(printf %.0f%% "$(xbacklight -get)")"
|
2019-04-22 16:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
up)
|
|
|
|
# increase the backlight by 5%
|
|
|
|
xbacklight -inc 5
|
|
|
|
send_notification
|
|
|
|
;;
|
|
|
|
down)
|
|
|
|
# decrease the backlight by 5%
|
|
|
|
xbacklight -dec 5
|
|
|
|
send_notification
|
|
|
|
;;
|
|
|
|
esac
|