Created
May 21, 2019 21:09
-
-
Save Liblor/5ea857f44c1070ac3d9d0c99b9df71c1 to your computer and use it in GitHub Desktop.
Brightness notification (progressbar): dunst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Brightness notification: dunst | |
icon_path=/usr/share/icons/Adwaita/64x64/status/ | |
notify_id=817 | |
function get_brightness { | |
xbacklight -get | |
} | |
function brightness_notification { | |
brightness=`get_brightness` | |
printf -v br_int %.0f "$brightness" | |
echo $br_int | |
bar=$(seq -s "─" $(($br_int / 5)) | sed 's/[0-9]//g') | |
dunstify -r $notify_id -u low -i ${icon_path}display-brightness-symbolic.symbolic.png $bar | |
} | |
case $1 in | |
up) | |
xbacklight -inc 5 | |
brightness_notification | |
;; | |
down) | |
xbacklight -dec 5 | |
brightness_notification | |
;; | |
*) | |
echo "Usage: $0 up | down " | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment