#!/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\":\"\"}"