ITADN

fix: pass session-specific vars to units launched by uwsm app

#212Pull Requestybbat 创建于 2026-03-27
Y
ybbatcommented
Since 0.26.0, session-specific vars (XDG_SESSION_ID, XDG_SEAT, etc.) have intentionally not been exported to activation environments and been put into env_session.conf instead. However, uwsm app did not seem to be correctly providing these vars to applications. This was causing issues for me trying to use [soteria](https://github.com/imvaskel/soteria) because it tries to read the XDG_SESSION_ID. This patch: - Adds a separator argument to load_env to support newline-separated files - Passes the session vars from env_session.conf via --setenv for scope units - Passes them via EnvironmentFile= and --setenv for service units, with os.environ taking precedence if vars are explicitly set Tested on Arch Linux system with niri managed by uwsm. uwsm app -- printenv XDG_SESSION_ID now prints the expected session ID to journalctl where it would be blank before. If this is not correct behaviour and I misinterpreted the note on the README just let me know.
合并状态:未合并 2 条评论