mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
23 lines
557 B
Bash
Executable File
23 lines
557 B
Bash
Executable File
#!/bin/bash
|
|
|
|
DIR_ICONS="/usr/local/bin/icons"
|
|
|
|
MAX_BRI=$(cat /sys/class/backlight/*/max_brightness)
|
|
CUR_BRI=$(cat /sys/class/backlight/*/brightness)
|
|
|
|
# calculating current percentage
|
|
((CUR_PER = CUR_BRI * 100 / MAX_BRI))
|
|
|
|
if [ $CUR_PER -ge 50 ]; then
|
|
dunstify -a "Brightness" \
|
|
"Brightness" \
|
|
"Current brightness is $CUR_PER%" \
|
|
-r 100 \
|
|
-i $DIR_ICONS/sun.svg
|
|
else
|
|
dunstify -a "Brightness" \
|
|
"Brightness" \
|
|
"Current brightness is $CUR_PER%" \
|
|
-r 100 \
|
|
-i $DIR_ICONS/moon.svg
|
|
fi |