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(){
|
||||
if [ ! -f /tmp/myip ]; then
|
||||
echo "$(curl -s --connect-timeout 1 http://canihazip.com/s)" > /tmp/myip
|
||||
fi
|
||||
IP="$(cat /tmp/myip)"
|
||||
if [ -n "$IP" ]; then
|
||||
echo -n "%{F$GREEN}$IP"
|
||||
NDATA=$(connmanctl services | grep "*A")
|
||||
NSTATE=$(echo $NDATA | cut -b3)
|
||||
NNAME=$(echo $NDATA | cut -d' ' -f2)
|
||||
|
||||
if [ "$NSTATE" == "c" ]; then
|
||||
NCOLOR="$GREY"
|
||||
elif [ "$NSTATE" == "R" ]; then
|
||||
NCOLOR="$BLUE"
|
||||
elif [ "$NSTATE" == "O" ]; then
|
||||
NCOLOR="$GREEN"
|
||||
else
|
||||
NCOLOR="$RED"
|
||||
fi
|
||||
|
||||
if [ "$NCOLOR" == "$RED" ]; then
|
||||
echo -n "%{F$RED}Offline"
|
||||
else
|
||||
echo -n "%{F$NCOLOR}$NNAME"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user