Modem monitor now tracks the modem for state changes and shows the state in the status bar

This commit is contained in:
Maarten van Gompel 2021-03-30 23:03:35 +02:00
parent 6951639886
commit c5c8f3d514
2 changed files with 54 additions and 0 deletions

View file

@ -31,6 +31,15 @@ update() {
# M symbol if modem monitoring is on & modem present
MODEMMON=""
pgrep -f sxmo_modemmonitor.sh && MODEMMON=""
if [ -n "$MODEMMON" ]; then
if [ -f /tmp/modem.locked.state ]; then
MODEMMON=""
elif [ -f /tmp/modem.registered.state ]; then
MODEMMON=""
elif [ -f /tmp/modem.connected.state ]; then
MODEMMON=""
fi
fi
# Battery pct
PCT="$(cat /sys/class/power_supply/*-battery/capacity)"