wms/wms_batlarm.sh
rootniformaticaservice 45e53dfec4 code changes.
2023-05-09 20:23:59 -03:00

25 lines
619 B
Bash
Executable file

#!/bin/sh
## alternating window border colors depending on battery charge ##
## this script depends on power.sh which is in the /others repo ##
. $HOME/.config/wms/wms_var
FREQ=0.5 # freq
COLORS="aa0000 $AC" # alternate colors
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
chwb -c $c $(pfw)
sleep $FREQ
done
else # if not
chwb -c $AC $(pfw) # default border colors
break # exit loop
fi
done