NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.31k stars 13.55k forks source link

Waybar not displayed in Sway after upgraded to 23.11 #278004

Closed xinyifly closed 6 months ago

xinyifly commented 8 months ago

Describe the bug

After I upgraded from 23.05 to 23.11, my configured waybar in sway does not launch automatically untill I reload sway several times.

Steps To Reproduce

Steps to reproduce the behavior:

  1. With home-manager config wayland.windowManager.sway.config.bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
  2. Upgrade to 23.11 from 23.05
  3. Reboot found that waybar is not displayed.

Expected behavior

Waybar is not displayed.

Screenshots

Under 23.11

2024-01-01T12:37:28,137787239+08:00

Under 23.05

2024-01-01T12:37:50,371485005+08:00

Additional context

Related configuration.nix

{
  programs.sway.enable = true;
  services.greetd.enable = true;
  services.greetd.settings.default_session = {
    user = "xinyifly";
    command = "sway";
  };
}

I didn't see any waybar process running on startup while it exists under 23.05

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.69, NixOS, 23.11 (Tapir), 23.11.20231225.d02d818`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - channels(xinyifly): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

arthsmn commented 8 months ago

Can you try launching waybar in a terminal to see if there are any errors?

Aleksanaa commented 6 months ago

This looks like a home-manager issue, probably caused by some kind of race condition between waybar and sway. Since there is no further information, I will close this issue first.

xinyifly commented 6 months ago

@Aleksanaa Thank you for your clue of race condition, which inspired me checked failed systemd user units, I found that systemctl --user status xdg-desktop-portal-wlr.service is complaining:

Mar 12 23:57:13 t8 systemd[2511]: Starting Portal service (wlroots implementation)...
Mar 12 23:57:13 t8 xdg-desktop-portal-wlr[25131]: 2024/03/12 23:57:13 [ERROR] - pipewire: couldn't connect to context
Mar 12 23:57:13 t8 xdg-desktop-portal-wlr[25131]: 2024/03/12 23:57:13 [ERROR] - xdpw: failed to initialize screencast
Mar 12 23:57:13 t8 xdg-desktop-portal-wlr[25131]: 'impl->enter_count > 0' failed at ../spa/plugins/support/loop.c:362 loop_leave()

And finally found adding services.pipewire.enable = true; to configuration.nix solved this issue.