Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.75k stars 708 forks source link

waybar takes too long to start sometimes dosen't #3714

Open sachinchaudhary1808 opened 1 month ago

sachinchaudhary1808 commented 1 month ago

❯ waybar [2024-10-26 19:56:43.272] [info] Using configuration file /home/coco/.config/waybar/config.jsonc [2024-10-26 19:57:08.295] [error] Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached waybar version v0.11.0

atisharma commented 4 weeks ago

I get the same problem starting at boot using river + sddm on boot (riverctl spawn waybar).

[2024-10-27 10:53:47.711] [info] Using configuration file /home/ati/.config/waybar/config [2024-10-27 10:54:12.745] [error] Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached

Starting manually seems to be fine.

Seems to be related to #897 - removing the tray module allows it to start.

atisharma commented 4 weeks ago

I think this is a race condition. Spawning waybar at the end of river's config file works.

sachinchaudhary1808 commented 4 weeks ago

I get the same problem starting at boot using river + sddm on boot (riverctl spawn waybar).

[2024-10-27 10:53:47.711] [info] Using configuration file /home/ati/.config/waybar/config [2024-10-27 10:54:12.745] [error] Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached

Starting manually seems to be fine.

Seems to be related to #897 - removing the tray module allows it to start.

the above one is started manually this happened lot more on river and on sway sometimes

apiraino commented 1 week ago

I have a different theory, based on past similar experiences of these timeouts. I suspect this is related to the XDG Portal Desktop which might not be defined for your window manager.

@sachinchaudhary1808 Having more info would be useful. Which Linux distro are you using? Which window manager are you using? Please also check if you have a file defining the portals the window manager can use. For example in /usr/share/xdg-desktop-portal/portals I have gtk.portal and wlr.portal. SInce I use Sway the relevant one for me is wlr.portal. In one of these files you should find the portal org.freedesktop.portal.Desktop.

sachinchaudhary1808 commented 1 week ago

I have a different theory, based on past similar experiences of these timeouts. I suspect this is related to the XDG Portal Desktop which might not be defined for your window manager.

@sachinchaudhary1808 Having more info would be useful. Which Linux distro are you using? Which window manager are you using? Please also check if you have a file defining the portals the window manager can use. For example in /usr/share/xdg-desktop-portal/portals I have gtk.portal and wlr.portal. SInce I use Sway the relevant one for me is wlr.portal. In one of these files you should find the portal org.freedesktop.portal.Desktop.

I'm on nixos, i use sway, i do have xdg-desktop-portal-gtk in my configuration, i have xdg-portal wlr too, but I don't have /usr/anything cuz of using nixos,

sachinchaudhary1808 commented 1 week ago

though after finding where nixos stores them this i have


❯ ls /run/current-system/sw/share/xdg-desktop-portal/portals/
gnome-keyring.portal  gtk.portal  wlr.portal

~ via 🌙 
❯ ```
sachinchaudhary1808 commented 1 week ago

in wlr.portal i only have this

DBusName=org.freedesktop.impl.portal.desktop.wlr
Interfaces=org.freedesktop.impl.portal.Screenshot;org.freedesktop.impl.portal.ScreenCast;
UseIn=wlroots;sway;Wayfire;river;phosh;Hyprland;
apiraino commented 1 week ago

What I usually try to do when debugging XDG portals issues is: 1) kill all running xdg-desktop-portal-* 2) start xdg-desktop-portal -r -v, inspect the output to see if a specific portal is listed (in your case the "org.freedesktop.portal.Desktop"). If I don't see it, I try adding it to the portal of my compositor (wlr.portal) and restart xdg-desktop-portal. 3) Start the application that causes the timeout and see if xdg-desktop-portal shows something on the stdout

Hope it helps