Skip to content

Conversation

@jamesmcm
Copy link
Owner

  • 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/ 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//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.

  - 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.
@jamesmcm jamesmcm merged commit 59646e6 into master Sep 14, 2025
2 checks passed
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