daemon: forward GUI envs; use user XDG config;#333
Merged
Conversation
- Forward essential X/Wayland env vars from client to daemon-launched apps:
DISPLAY, WAYLAND_DISPLAY, XAUTHORITY, XDG_RUNTIME_DIR, XDG_CONFIG_HOME,
XDG_SESSION_TYPE, MOZ_ENABLE_WAYLAND, QT_QPA_PLATFORM, GTK_MODULES, GTK3_MODULES, I3SOCK.
Default XDG_RUNTIME_DIR to /run/user/<uid> when missing.
- Extend DaemonRequest to carry the forwarded env map; merge into child env in daemon path.
- Respect XDG_CONFIG_HOME in daemon mode: add thread-local config_dir override
and set it per client to forwarded XDG_CONFIG_HOME (if it exists) or fall back
to ~/.config of the connecting user. Clear the override when the handler exits.
This fixes false “config files … do not exist” when the daemon runs under systemd.
- Demote noisy “Could not get PULSE_SERVER from host” to debug in daemon mode
(still warn in non-daemon). Daemon continues to set PULSE_SERVER to
unix:/run/user/<uid>/pulse/native for the connecting user.
- Add daemon mode flag in core (set_daemon_mode/is_daemon_mode); mark daemon context
in main and use it for conditional logging.
- Avoid interactive auto-sync in daemon mode: setup_namespace now accepts
auto_sync_if_missing; daemon passes false (bails with a clear message if configs
are missing), CLI path passes true (preserving previous behavior).
- Pass env and stdio consistently for both TTY and non-TTY client cases.
Result:
- GUI apps launched via the daemon get correct X/Wayland/desktop env and no longer fail with
“no DISPLAY”.
- Daemon resolves configs from the user’s XDG config dir instead of /root/.config under
systemd.
- Systemd logs are quieter; no spurious PULSE warnings or “not a terminal” from attempted
interactive sync.
a4bd8c9 to
74ddd87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Result: