Candyrice/eww/sh/values/brightness.sh

20 lines
359 B
Bash
Raw Permalink Normal View History

2024-08-01 17:25:38 +00:00
#!/bin/bash
b=$(xbacklight -get);
if [[ $b -le 1 ]]; then
b=0;
s="empty";
else
s="low";
if [[ $b -gt 35 ]]; then
s="med"; fi
if [[ $b -gt 50 ]]; then
s="high"; fi
if [[ $b -gt 80 ]]; then
s="vhigh"; fi
if [[ $b -eq 100 ]]; then
s="full"; fi
fi
echo "{\"level\":\"$b\",\"status\":\"$s\",\"icon\":\"\"}"