Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix herbstluftwm session command with other desktop managers #237364

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

fdietze
Copy link
Contributor

@fdietze fdietze commented Jun 12, 2023

Description of changes

Enabling for example xfce and herbstluftwm generates a xsession script like this:

#! /nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/bash

# Legacy session script used to construct .desktop files from
# `services.xserver.displayManager.session` entries. Called from
# `sessionWrapper`.

# Start the window manager.
/nix/store/43syrfrpxc3d7dyhbhkh1i3wpzq8knfz-herbstluftwm-0.9.5/bin/herbstluftwm

# Start the desktop manager.
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/bash /nix/store/hqrwlx6h1bdqq3vbzxladczbql7f0q03-xfce4-session-4.18.2/etc/xdg/xfce4/xinitrc &
waitPID=$!


/nix/store/v0lv3kpj2ppv9k6y48azc6m6m2barasr-dbus-1.14.6/bin/dbus-update-activation-environment --systemd --all


test -n "$waitPID" && wait "$waitPID"

/run/current-system/systemd/bin/systemctl --user stop graphical-session.target

exit 0

Note, that the herbstluftwm command launches a permanently running process, so the following commands will never be executed, until herbstluftwm is quit.

This PR runs herbstluftwm in a background job instead.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jun 12, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jun 12, 2023
@SuperSandro2000 SuperSandro2000 merged commit d6d6d42 into NixOS:master Jul 11, 2023
@fdietze fdietze deleted the patch-3 branch September 21, 2023 21:57
@fdietze
Copy link
Contributor Author

fdietze commented Sep 21, 2023

I think I made a mistake here. This change allows using herbstluftwm with xfce, but it breaks the standalone usage of herbstluftwm, because the xsession script quits immediately and therefore also kills the herbstluftwm background process. How can we support both?

@B4rc1
Copy link
Contributor

B4rc1 commented Nov 30, 2023

but it breaks the standalone usage of herbstluftwm, because the xsession script quits immediately and therefore also kills the herbstluftwm background process. How can we support both?

I ran into this issue upon the release of 23.11, would #271198 work in your case?
I think it would since waitPID would be overwritten before waiting for it, could you please test it?

@fdietze
Copy link
Contributor Author

fdietze commented Jan 19, 2024

@B4rc1 Thanks for your effort and sorry for my long silence! I just wanted to test your fix, but currently my internet connection is way too bad...

What I would test:

desktopManager.xfce.enable = true;
windowManager.herbstluftwm.enable = true;

And then try to login with those sessions:

  • none+herbstluftwm
  • xfce+herbstluftwm

If both just work, we have a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants