Wireless Connected Icon

Not sure where to put this and or ask, my wireless icon always shows disconnected with / and not the wireless icon in the check-network file.

#!/usr/bin/env bash

count=0
disconnected="/"
disconnected2="\\"
wireless_connected=""
ethernet_connected=""

ID="$(ip link | awk '/state UP/ {print $1}')"

while true; do
    if (ping -c 1 archlabslinux.com || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then
        if [[ $ID == e* ]]; then
            echo "$ethernet_connected" ; sleep 25
        else
            echo "$wireless_connected" ; sleep 25
        fi
    else
        echo "$disconnected" ; sleep 0.6
        echo "$disconnected2" ; sleep 0.6
    fi
done```

I’m guessing you have an internet connection?

Moved to Basic Help and Support.

yeah, and i changed the wireless setting in the polybar, I have tried it all. It is like it does see the wireless cards ip.

what is funny it is works fine on the liveboot cd…so am lost.

Try this module.

[module/wireless-network]
type = internal/network
interface =

format-connected = <ramp-signal>  <label-connected>
format-packetloss = <animation-packetloss>
label-connected = " %local_ip% "

ramp-signal-0 = 
ramp-signal-0-foreground = #F03051
ramp-signal-1 = 
ramp-signal-1-foreground = #F07127
ramp-signal-2 = 
ramp-signal-2-foreground = #F9CE56
ramp-signal-3 = 
ramp-signal-3-foreground = ${colors.purple}
ramp-signal-4 = 
ramp-signal-4-foreground = ${colors.purple}
ramp-signal-5 = 
ramp-signal-5-foreground = ${colors.purple}

animation-packetloss-0 = ⚠
animation-packetloss-0-foreground = #ffa64c
animation-packetloss-1 = 📶
animation-packetloss-1-foreground = #000000
animation-packetloss-framerate = 500

yeah samething, it just bounces from / to . It is like it is not findiing the ip address

: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 9c:b6:d0:1f:df:21 brd ff:ff:ff:ff:ff:ff
2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 9c:b6:d0:1f:df:21 brd ff:ff:ff:ff:ff:ff
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 qdisc noqueue state UP group default qlen 1000
    link/ether 9c:b6:d0:1f:df:21 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.47/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp1s0
       valid_lft 42786sec preferred_lft 42786sec
    inet6 fe80::61a5:ea47:c58:9de0/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever```

Did you add your interface name to interface = ?

yes

[module/wireless-network]
type = internal/network
interface = wlp1s0

format-connected = <ramp-signal>  <label-connected>
format-packetloss = <animation-packetloss>
label-connected = " %local_ip% "

ramp-signal-0 = r
ramp-signal-0-foreground = #F03051
ramp-signal-1 = 
ramp-signal-1-foreground = #F07127
ramp-signal-2 = 
ramp-signal-2-foreground = #F9CE56
ramp-signal-3 = 
ramp-signal-3-foreground = ${colors.purple}
ramp-signal-4 = 
ramp-signal-4-foreground = ${colors.purple}
ramp-signal-5 = 
ramp-signal-5-foreground = ${colors.purple}
animation-packetloss-0 = ⚠
animation-packetloss-0-foreground = #ffa64c
animation-packetloss-1 = 📶
animation-packetloss-1-foreground = #000000
animation-packetloss-framerate = 500

One last thing

pacman -S iputils --noconfirm

Then kill and restart your Polybar.

1 Like

Ok, good to know, reinstalling this the after that fix worked great. Thank you. Something learned every day.

Nice! Glad it worked.