Add eww/sh/values/brightness.sh

This commit is contained in:
Candifloss 2024-08-01 17:25:38 +00:00
parent 92a972a047
commit 163c2f51d9

View File

@ -0,0 +1,20 @@
#!/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\":\"\"}"