mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
23 lines
524 B
Bash
Executable File
23 lines
524 B
Bash
Executable File
#!/bin/sh
|
|
|
|
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 "Screen" \
|
|
"Screen" \
|
|
"Brightness: $cur_per%" \
|
|
-r 100 \
|
|
-i "$dir_icons"/sun.svg
|
|
else
|
|
dunstify -a "Screen" \
|
|
"Screen" \
|
|
"Brightness: $cur_per%" \
|
|
-r 100 \
|
|
-i "$dir_icons"/moon.svg
|
|
fi |