dwm-status-bar-freebsd/battery

31 lines
498 B
Plaintext
Raw Permalink Normal View History

2023-05-30 10:01:34 +02:00
#!/bin/sh
STATUS=$(sysctl -nh hw.acpi.battery.state)
LOAD=$(sysctl -nh hw.acpi.battery.life)
if [ $STATUS = 2 ]
then
# cargando
echo  $LOAD%
elif [ $STATUS = 1 ]
then
#descargando
if [ $LOAD -lt 6 ]
then
echo  $LOAD%
elif [ $LOAD -lt 26 ]
then
echo  $LOAD%
elif [ $LOAD -lt 56 ]
then
echo  $LOAD%
elif [ $LOAD -lt 81 ]
then
echo  $LOAD%
else
echo  $LOAD%
fi
else
echo  $LOAD%
fi