diff --git a/eww/sh/values/brightness.sh b/eww/sh/values/brightness.sh new file mode 100644 index 0000000..b15b775 --- /dev/null +++ b/eww/sh/values/brightness.sh @@ -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\":\"\"}" \ No newline at end of file