flake/nixos/profiles/common/graphical/home/scripts/_bin/wrapped-brightnessctl

20 lines
449 B
Text
Raw Normal View History

2023-12-15 13:53:06 +00:00
#!/usr/bin/env bash
2023-09-19 00:17:43 +00:00
# Original Script: https://github.com/ericmurphyxyz/dotfiles/blob/master/.local/bin/changebrightness
send_notification() {
2023-12-29 15:44:32 +00:00
brightness=$(($(brightnessctl get) / 240))
2023-09-19 00:17:43 +00:00
dunstify -a "changebrightness" -u low -r 9991 -h int:value:"$brightness" -i "brightness-$1" "Brightness: $brightness%" -t 2000
}
case $1 in
up)
brightnessctl set +5%
send_notification "$1"
;;
down)
brightnessctl set 5%-
send_notification "$1"
;;
esac