flake/nixos/profiles/common/graphical/home/scripts/_bin/wrapped-brightnessctl
2024-02-03 12:11:27 +08:00

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