dotfiles/cosmo/config/polybar/scripts/brightness-monitor.sh
2026-04-10 14:49:11 -07:00

8 lines
253 B
Bash
Executable file

#!/bin/bash
echo $(( 100 * $(cat /sys/class/leds/lcd-backlight/brightness) / 255 ))
inotifywait -mq -e modify /sys/class/leds/lcd-backlight/brightness |
while read file_path file_event; do
echo $(( 100 * $(cat ${file_path}) / 255 ))
done