diff --git a/wms_batlarm.sh b/wms_batlarm.sh index 992ac03..1093cf9 100755 --- a/wms_batlarm.sh +++ b/wms_batlarm.sh @@ -5,21 +5,27 @@ . /tmp/wms_var -FREQ=0.5 # freq -COLORS="aa0000 $AC" # alternate colors +# freq. +FREQ=0.5 +# alternate colors. +COLORS="aa0000 $AC" -while :; do - read -r STATUS < /sys/class/power_supply/BAT0/status # battery status - if [ "$STATUS" = "Discharging" ]; then # if status discharging - for c in $COLORS; do # alternate border colors +while true:; do + # battery status. + read -r STATUS < /sys/class/power_supply/BAT0/status + # if status discharging. + if [ "$STATUS" = "Discharging" ]; then + # alternate border colors. + for c in $COLORS; do chwb -c $c $(pfw) sleep $FREQ done else # if not - chwb -c $AC $(pfw) # default border colors - break # exit loop + # default border colors. + chwb -c $AC $(pfw) + # exit loop. + break fi done -