flake/pkgs/scripts/_bin/wrapped-brightnessctl

19 lines
449 B
Bash
Executable file

#!/usr/bin/env bash
# Original Script: https://github.com/ericmurphyxyz/dotfiles/blob/master/.local/bin/changebrightness
send_notification() {
brightness=$(($(brightnessctl get) / 240))
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