Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

No icon

Open no1etal opened this issue 1 year ago • 7 comments

Hi, as title says, I see no icon for WiFi. It only states my adapter wlp2s0. I used default config and custom configs:

`

"network": { "interface": "wlp2s0", // (Optional) To force the use of this interface "format-wifi": " {signalStrength}%", "format-ethernet": "{ipaddr}/{cidr} ", "tooltip-format": "{essid} - {ifname} via {gwaddr} ", "format-linked": "{ifname} (No IP) ", "format-disconnected": "⚠", "format-alt": "{ifname}:{essid} {ipaddr}/{cidr}", "on-click": "kitty -e nmtui"]

`

I don't see at warnings in debug mode either.

Also 'on-click' not working. What am I doing wrong?

no1etal avatar Mar 31 '24 13:03 no1etal

Looks like the network module wasn't changed in a while, but: which version are you using?

The result looks to me like it's using the DEFAULT_FORMAT. But given your config, that only makes sense if Waybar was built with rfkill support and ends up going for "disabled" -- which is the only format you haven't configured.

This is something you might be able to confirm with GTK_DEBUG=interactive, the element with the name network might have css classes matching the current state.

RobertMueller2 avatar Mar 31 '24 14:03 RobertMueller2

Thanks Robert, but I have bitten more than I can chew. I am not that savvy with code. I don't know how to check version of the network module and I don't know what to pay attention to with GTK_DEBUG=interactive. I have ran waybar -l debug and waybar -l interactive and there were no issues there but that is as far as my expertise reach.

no1etal avatar Apr 03 '24 14:04 no1etal

Just to clarify, I just wanted to confirm the Waybar version as a whole. The comment about the network module was just to say that this question probably doesn't make that much of a difference, because the network module was not changed in a while and is identical between 0.9.24 and 0.10.0. I think.

The reason for the question was though, I tried to understand in the code what might have happened. But if I was looking in the wrong version, that probably doesn't make much sense. ;)

If you're not familiar with GTK_DEBUG, no problem. Can we please try if it's easier with the screenshot below? ;) satty-20240403-17:07:21

I'm looking for the style classes of a gtkmm_GtkLabel with the name "network" as shown in the screenshot. Which nodes you actually have to expand, depends on your config. This might confirm or disprove my theory.

What might also be useful here is the output of sudo rfkill (whether the device is listed as blocked) as well as ip ad ls (interface state, not interested in the mac or ip addresses) in a terminal.

RobertMueller2 avatar Apr 03 '24 15:04 RobertMueller2

Thank you for your patience, was and still am on the road.

As kindly asked for:

  • GTK_DEBUG 20240408_15h42m12s_grim
sudo rfkill
[sudo] password for kopachke:
ID TYPE      DEVICE      SOFT      HARD
 0 wlan      phy0   unblocked unblocked
 1 bluetooth hci0   unblocked unblocked
ip ad ls
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 noprefixroute
       valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether ############## brd ff:ff:ff:ff:ff:ff
    inet 172.20.10.2/28 brd 172.20.10.15 scope global dynamic noprefixroute wlp2s0
       valid_lft 85912sec preferred_lft 85912sec
    inet6 ################ scope link noprefixroute
       valid_lft forever preferred_lft forever

I hope this shines some light and do let me know what else are you thinking and need.

no1etal avatar Apr 08 '24 13:04 no1etal

Thanks for sharing the screenie and output. Since GTK_DEBUG shows that "wifi" CSS class is correctly set, my suspicion about rfkill state playing a role was incorrect.

I've tested your config, corrected the ] into },, replaced the network interface (I don't have wlp2s0) and kitty -e with foot (I don't have kitty installed) and the config works just fine.

However, I can reproduce the behaviour you describe by running the network module with no network module config at all. Could that be what's happening here? Are you sure the snippet above is in the config file that Waybar is using?

RobertMueller2 avatar Apr 08 '24 14:04 RobertMueller2

Thank you for your patience again. I too can reproduce it without defining the network module. Waybar draws from that config file, I have checked (when removing it from 'modules-right' it disappears fully).

 "network": {
        "interface": "wlp2s0", // (Optional) To force the use of this interface
        "format-wifi": "  {signalStrength}%",
        "format-ethernet": "{ipaddr}/{cidr} ",
        "tooltip-format": "{essid} - {ifname} via {gwaddr} ",
        "format-linked": "{ifname} (No IP) ",
        "format-disconnected": "⚠",
        "format-alt": "{ifname}:{essid} {ipaddr}/{cidr}"
    },

PS: I have moved the network snippet to a different line in the config and it worked. It wasnt in the ending of the file, so the comma is correct there. You reproducing it without defining it in the config was the right clue. It must be that I have had something misswritten in the code.

Thank you Robert for hand-holding me, it is much appreciated. Have a good day!

no1etal avatar Apr 14 '24 12:04 no1etal

No worries. Good to hear you could sort it out. :)

RobertMueller2 avatar Apr 14 '24 21:04 RobertMueller2

btw, would you mind closing this?

RobertMueller2 avatar Jun 23 '24 08:06 RobertMueller2