mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
Rebase: Created version v2, removed useless commits.
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user