Waybar tray disappears on config reload and I can't get it back without rebooting

I have a laptop with Fedora 41 KDE spin installed, onto which I’ve installed Sway. While for the most part everything works fine, one problem I’ve been running into is that when I reload my config, tray disappears. The rest of the bar is present, just the tray is gone (the little section with wifi/bluetooth/minimized applications/etc). This happens whether or not I’ve modified my config file. I’ve tried moving tray to the left or center section but it doesn’t make a difference. And killing waybar and starting it manually doesn’t fix it. The only thing that brings my tray back is rebooting, and it’s gone as soon as I do another config reload.

Is there anything I can do to stop this from happening? Or at least is there something I can do to make it come back without rebooting?

Have you tried restarting sway? There’s two different commands/shortcuts: reload and restart. I assume by “config” you mean sway config reload.

Are you using the default configs, from which package?

If you can’t find your answere here, I get my Sway questions answered at chat.fedoraproject.org in the Sway channel #sway:fedoraproject.org

I’m confused whether you mean a Sway config reload or a Waybar config reload? And how are you doing the reload?

I’m reloading with $mod+shift+c, which I believe reloads both since the keybind is set in sway config (bindsym $mod+Shift+c reload) but it also reloads waybar’s configuration.

I meant reload (default binding of $mod+ctrl+c). I’m using my own local configs in ~/.config/sway/ and ~/.config/waybar that are just the prepackaged configurations from sway-config-fedora which I’ve been adjusting for my own requirements.

I suspect that because the tray is a separate process forked from the (original) waybar instance, it gets lost when only the parent (Sway) gets renewed. Waybar would have to be fully restarted in that case.

You can try testing this by:

  1. Reload Sway with $mod+ctrl+c
  2. Kill waybar from a terminal with $ killall waybar
  3. Start waybar again with $ waybar

The tray is then likely available again.

I previously tried killing and restarting waybar which didn’t help, and I don’t have any keybinds set for $mod+ctrl+c (unless that’s a nonconfigurable default? It doesn’t appear to do anything though).

I do notice that it seems to only happen after I’ve been logged in for a little while. If I reboot and try reloading in the first 5-10 minutes, the tray comes back like normal. But after it’s been sitting for a while (half an hour or so?) the problem starts happening.

I see this error in the log which shows up as soon as I hit the reload keybind. I’m not sure if it’s related or not.

[error] Host: GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path ‘/StatusNotifierWatcher’

Ok maybe it’s a different issue in that case. I’m afraid i don’t have a good clue about that DBus error…

“Reload” in sway reloads the configuration file.

“Restart” in sway restarts sway, in particular it restarts processes which sway starts on startup. This is what you may want to use to restart sway and waybar.

Bindings differ, of course.

If you just want to reload the (way)bar you can killall -SIGUSR1 waybar.

I remember that setting up the tray was finicky with swaybar, but I didn’t have to use special settings with waybar’s tray module.

Note that you can start waybar on the commandline (terminal) and watch its output.