18 lines
425 B
Bash
Executable File
18 lines
425 B
Bash
Executable File
#!/bin/bash
|
|
|
|
function send_notification() {
|
|
brightness=$(printf "%.0f\n" $(brightnessctl i | grep -i current | awk '{print $4}' | sed 's/(//' | sed 's/)//'))
|
|
dunstify -a "changebrightness" -u low -r "9992" -h int:value:"$brightness" "brightness: ${brightness}%" -t 2000
|
|
}
|
|
|
|
case $1 in
|
|
up)
|
|
brightnessctl s +25 -q
|
|
send_notification $1
|
|
;;
|
|
down)
|
|
brightnessctl s 25- -q
|
|
send_notification $1
|
|
;;
|
|
esac
|