Skip to content

Stop herdr server in parallel with Hyprland on shutdown - #19919

Merged
dhh merged 1 commit into
quattrofrom
parallel-herdr-shutdown
Nov 23, 2026
Merged

dhh merged 1 commit into
quattrofrom
parallel-herdr-shutdown

Conversation

@dhh

@dhh dhh commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

default/hypr/autostart.lua previously launched setsid herdr server through uwsm-app, which placed it in app-graphical.slice. Because app-graphical.slice is ordered After=graphical-session.target, systemd had to wait ~0.5s for herdr server (and every pane child in its scope) to exit before Hyprland could even begin stopping — and any stubborn pane child stalled session-1.scope until timeout.

Launch herdr server as a transient user service (omarchy-herdr-server.service) in app.slice with:

  • PartOf=graphical-session.target (without After=graphical-session.target) so it stops with the session in parallel with Hyprland (~0.5s saved on every shutdown)
  • systemd's own new session (setsid semantics preserved so remote clients don't prompt to restart it) and inherited graphical environment (WAYLAND_DISPLAY etc.)
  • KillMode=mixed so SIGTERM goes only to herdr server (letting it save pane/workspace state cleanly on logout and shutdown), and remaining pane processes are cleaned up with SIGKILL as soon as herdr server exits
  • --collect so exited/failed transient units don't linger across re-logins.

Verification

  • luac -p default/hypr/autostart.lua
  • ./test/shell.d/config-test.sh
  • Verified systemd-run --user --quiet --collect --slice=app.slice --property=PartOf=graphical-session.target --property=KillMode=mixed sets PartOf=graphical-session.target without After=graphical-session.target and inherits WAYLAND_DISPLAY, HYPRLAND_INSTANCE_SIGNATURE, OMARCHY_PATH, and PATH.

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Moves herdr server from an application scope to a transient user service.

  • Herdr stops alongside Hyprland when the graphical session ends.

No actionable issues were found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Hyprland starts] --> B[Wait two seconds]
  B --> C[Start omarchy-herdr-server.service in app.slice]
  D[Graphical session stops] --> E[Hyprland stops]
  D --> F[SIGTERM to herdr server]
  F --> G[Server exits]
  G --> H[Clean up remaining pane processes]
Loading

Reviews (1) · Last reviewed commit: "Stop herdr server in parallel with Hyprl..." · Reviewed by Greptile

@dhh
dhh merged commit fef807e into quattro Nov 23, 2026
2 checks passed
@dhh
dhh deleted the parallel-herdr-shutdown branch November 23, 2026 14:37
@emirb emirb added this to the 4.6.0 milestone Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants