some updates.
This commit is contained in:
parent
41121c4a24
commit
e8d562914b
1 changed files with 15 additions and 9 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue