I’m working on a hyprland setup with Waybar. For a while, I was using sddm, but I switched to ly recently because sddm is ugly without Plasma installed. However, after switching to ly, waybar fails to start. Here’s the output:
[2024-11-28 12:38:37.697] [info] Using configuration file /home/devin/.config/waybar/config
[2024-11-28 12:39:02.198] [error] Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached
The weirdest thing is this: when i rebuild my system, waybar starts working again. It doesn’t seem to matter if I change anything about the config. On startup, waybar doesn’t load. But, if I rebuild the system, it works again.
What the hell is up here?
Did you ever find a solution for the issue?
This seems to me like Waybar is trying to fire before a suitable XDG Desktop Portal program is active. Perhaps you should wrap Waybar in a systemd service and orient it to start After=xdg-desktop-portal.target graphical-session.target
?
I only want to launch waybar when starting sway, but I also sometimes use gnome. AFAICT is that a problem.
Are you using NixOS? If you are, this is a trivial problem to solve. Just disable the service within your specialisation, so it doesn’t fire.
I am launching gnome and sway from gdm. I think I cannot use specializations (or am I wrong). PS: I never heard of specializations before and had to look it up quickly.
Add the waybar-startup code to your sway config, it will only start with sway.
Specialisations are a way to create NixOS configurations within their own isolated context, they are added to the bootloader as separate entries so you can choose to boot into either or. For example, I also have a GNOME and Sway system, except my GNOME one is exclusively configured within it’s own specialisation. That means none of the GNOME programs leak into my Sway environment, and likewise, none of my Sway programs leak into GNOME.
If you aren’t using specialisations, I’d heavily encourage it. They are very awesome.
I will consider it, but I for now I will keep searching for another solution. But it is also nice to know about specialisations, thank you!
Try what @waffle8946 wrote, set it to execute as part of your Sway configuration.
If that still doesn’t work, then IIRC NixOS has a special sway-session.target
that you could use for your systemd service as an alternative to graphical-session.target
. That would prevent it from firing on GNOME.
Oh, I overlooked your post @waffle8946, sorry. I will try that!
Okay, I got it working by adding the below to my sway config (source), I guess it is the same for hyrland.
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
a week ago i installed niri
and it came with xdg-desktop-portal-gnome
, and it apparently made my waybar
take to start too long… specifically in hyprland
(UWSM).
without it i only have xdg-desktop-portal
, xdg-desktop-portal-gtk
and xdg-desktop-portal-hyprland
, and the slow start is gone!