lemonbar now uses connman
This commit is contained in:
parent
2c615912e7
commit
7149994889
22
lemonbar.sh
22
lemonbar.sh
@ -40,14 +40,24 @@ getMPD(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
getNET(){
|
getNET(){
|
||||||
if [ ! -f /tmp/myip ]; then
|
NDATA=$(connmanctl services | grep "*A")
|
||||||
echo "$(curl -s --connect-timeout 1 http://canihazip.com/s)" > /tmp/myip
|
NSTATE=$(echo $NDATA | cut -b3)
|
||||||
fi
|
NNAME=$(echo $NDATA | cut -d' ' -f2)
|
||||||
IP="$(cat /tmp/myip)"
|
|
||||||
if [ -n "$IP" ]; then
|
if [ "$NSTATE" == "c" ]; then
|
||||||
echo -n "%{F$GREEN}$IP"
|
NCOLOR="$GREY"
|
||||||
|
elif [ "$NSTATE" == "R" ]; then
|
||||||
|
NCOLOR="$BLUE"
|
||||||
|
elif [ "$NSTATE" == "O" ]; then
|
||||||
|
NCOLOR="$GREEN"
|
||||||
else
|
else
|
||||||
|
NCOLOR="$RED"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$NCOLOR" == "$RED" ]; then
|
||||||
echo -n "%{F$RED}Offline"
|
echo -n "%{F$RED}Offline"
|
||||||
|
else
|
||||||
|
echo -n "%{F$NCOLOR}$NNAME"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user