nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.56k stars 1.73k forks source link

bug: polybar started before i3 #3722

Open DPDmancul opened 1 year ago

DPDmancul commented 1 year ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Starting the session the modules i3 and xwindow are disabled because polybar is run before i3

❯ journalctl --user -xeu polybar
...
Feb 28 22:24:02 PereBook polybar-start[1990]: polybar|notice:  Loading module 'i3' of type 'internal/i3'
Feb 28 22:24:02 PereBook polybar-start[1990]: polybar|error: Disabling module "i3" (reason: Could not find socket: <empty>)
Feb 28 22:24:02 PereBook polybar-start[1990]: polybar|notice:  Loading module 'window' of type 'internal/xwindow'
Feb 28 22:24:02 PereBook polybar-start[1990]: polybar|error: Disabling module "window" (reason: The WM does not list _NET_ACTIVE_WINDOW as a supported hint)
...

Maybe it could be solved adding

After = [ "graphical-session.target" ]

Manually restarting the service it works perfectly.

Maintainer CC

@h7x4

System information

- system: `"x86_64-linux"`
 - host os: `Linux 5.15.91, NixOS, 22.11 (Raccoon), 22.11.20230204.8e82401`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `""`
 - channels(dpd-): `""`
 - nixpkgs: `/nix/store/f30dcvgm875ksqbhmp97wqvxmrzlbbjc-source`
stale[bot] commented 1 year ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

mattiasflodin commented 1 year ago

Adding After = [ "graphical-session.target" ] will not help. The design of the polybar configuration is fundamentally broken because polybar is run as a systemd service and i3 is not. The generated .xsession file runs

systemctl --user start hm-graphical-session.target

first, then it starts i3 as an ordinary shell command. But polybar expects i3 to already be running at the time it is started by systemd, so it will always fail.

Edit: I worked around this by not using the service variables. I just install polybar directly using home.packages (with an override to set i3Support = true) and then start it from the i3 config.

MaroonRaccoon commented 11 months ago

Experiencing the same issue here with bspwm. I've worked around this by setting services.polybar.script = "" and starting polybar from xsession.windowManager.bspwm.extraConfig.

borg1622 commented 11 months ago

Yeah. I don't think systemd will help here, because i3 is not wrapped in a systemd service unit. polybar must be started from within i3. Otherwise you'll loose polybar if i3 restarts.

stale[bot] commented 8 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.