14 lines
376 B
Bash
Executable File
14 lines
376 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
icons=("" "" "")
|
|
|
|
# initial
|
|
icon=${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]}
|
|
echo '{ "level": '"$(light)"', "icon": "'"$icon"'" }'
|
|
|
|
udevadm monitor | rg --line-buffered "backlight" | while read -r _; do
|
|
icon="${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]}"
|
|
|
|
echo '{ "level": '"$(light)"', "icon": "'"$icon"'" }'
|
|
done
|