flake/users/guanranwang/home-manager/profiles/graphical-stuff/nixos/scripts/bin/wrapped-brightnessctl
2023-11-28 12:12:13 +08:00

19 lines
441 B
Bash
Executable file

#!/bin/sh
# 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