dotfiles/misc/bin/brightness
2024-01-04 14:51:36 +00:00

22 lines
579 B
Bash
Executable File

#!/usr/bin/env bash
# Originally created by - https://github.com/rxyhn
BRIGHTNESS_STEPS=5
function send_notification {
icon="$HOME/.local/share/assets/brightness.svg"
brightness=$(brightnessctl i | grep -oP '\(\K[^%\)]+')
bar=$(seq -s "─" 0 $((brightness / 5)) | sed 's/[0-9]//g')
dunstify "Brightness $brightness%" -i $icon -r 5555 -u normal -h int:value:$(($brightness))
}
case $1 in
up)
brightnessctl set "${BRIGHTNESS_STEPS:-5}%+" -q
send_notification
;;
down)
brightnessctl set "${BRIGHTNESS_STEPS:-5}%-" -q
send_notification
;;
esac