First of all great work, it's really cool!
I used to use NetworkManager+wpa_supplicant to manage my networks. I've since switched to systemd-networkd+iwd and I've noticed that the "network" part of Waybar doesn't autoupdate if for example restart my net (via ip link set wlp60s0 down && ip link set wlp60s0 up. It registers the disconnect just fine, but I have to kill Waybar and start it anew if I want it to update.
It's the same thing after suspend. I know my computer connects to the wifi just fine, but Waybar doesn't register it.
Can I provide any debug logs?
I'll test with your configuration as soon as I can ;)
@trobjo Can you test with latest changes?
I changed things blindly, i think I know where the problem came from, if it doesn't work I will test with systemd-networkd
Have you pushed them to master? If so then it still doesn't work.
Ok weird, I tested with systemd-networkd and when I restart my net with
ip link set ens33 down && ip link set ens33 up it works, it displays the disconnected state and after the connected state.
Is it because I use iwd on top to manage the wifi? The ens* interface it cabled, right? I'm afraid I can't test it with a cabled interface, as my computer only has wifi.
Also Waybar now crashes ocasionally when I turn on/off the interface (so something _is_ going on :-) ).
And I can't test wifi right now :/
Can you get a backtrace of the crash?
Backtrace... Is that when you run the program in the terminal and then paste the output when it crashes? Or do I need to compile it with some form of debugging turned on?
Build with debug flag
meson build --buildtype=debug
ninja -C build
And after use gdb to launch waybar
gdb ./build/waybar
Type run and hit enter
Now try to reproduce the crash but when the crash will occur, the bar will be frozen so get back to gdb and type bt full and send me the output :p
I should first add, I don't know if this is useful. My Sway config loads Waybar automatically, and I needed to reload my config which resulted in two waybars. I then turned off the wifi by clicking the network icon (which runs a simple bash script). Now you're warned.
https://transfer.sh/11K1l8/backtrace1.log
I will of course post another backtrace if I happen to catch it crashing :-)
@trobjo Thx for the bt, i push something maybe the crash is gone :?
I think I figured it out. I had trouble reproducing the crash when running Waybar from gdb. In my config it loads in the bar section of the config:
bar
{
swaybar_command /home/tb/.Waybar/build/waybar
}
When I changed that to
$HOME/bin/Waybar (which points to your script) the crashes stopped. Sorry about that.
The reason as to why I initially put it in the bar section, was that I was sure it would only spawn one instance of Waybar. Sometimes, when I reload my config, Waybar appears twice. But this is not that big a problem :-)
Whatever a crash is a crash, so thanks, you can't reproduce it anymore?
When run from within bar{} in sway config: Waybar crashes _everytime_ I change ip link status. Both up and down makes it crash. It crashes regardless of whether I run the ip link command from the terminal or when I click the icon.
If I change it afterwards in sway config to either point to the binary directly or to your script, it still crashes consistently.
BUT if I then decide to run it from the command line I can then go back to loading it from my config (not via bar{} but the other two).
Ok I'll look on it
@trobjo But before my first changes, it doesnt crash?
That is correct.
I found out just now that if I comment the "interface": "wlp60s0", line in ~/.config/waybar/config (i.e. DON'T force the interface) the bug now disappears!
I guess this bug isn't solved in a technical sense but for all I care, you can close this issue :-)
And thanks btw. for an amazing piece of software!
Okay, that's it, now I can reproduce the problem, I'll fix it.
Done fixed (a123711a8df93e383dcb5ad82493519fc4f46557)
Most helpful comment
I'll test with your configuration as soon as I can ;)