Merge pull request #243834 from LunNova/lunnova/i3-update-session-environment
This commit is contained in:
commit
c4b7e013aa
1 changed files with 15 additions and 0 deletions
|
@ -4,6 +4,10 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.xserver.windowManager.i3;
|
cfg = config.services.xserver.windowManager.i3;
|
||||||
|
updateSessionEnvironmentScript = ''
|
||||||
|
systemctl --user import-environment PATH DISPLAY XAUTHORITY DESKTOP_SESSION XDG_CONFIG_DIRS XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID DBUS_SESSION_BUS_ADDRESS || true
|
||||||
|
dbus-update-activation-environment --systemd --all || true
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -19,6 +23,15 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateSessionEnvironment = mkOption {
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Whether to run dbus-update-activation-environment and systemctl import-environment before session start.
|
||||||
|
Required for xdg portals to function properly.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraSessionCommands = mkOption {
|
extraSessionCommands = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
@ -51,6 +64,8 @@ in
|
||||||
start = ''
|
start = ''
|
||||||
${cfg.extraSessionCommands}
|
${cfg.extraSessionCommands}
|
||||||
|
|
||||||
|
${lib.optionalString cfg.updateSessionEnvironment updateSessionEnvironmentScript}
|
||||||
|
|
||||||
${cfg.package}/bin/i3 ${optionalString (cfg.configFile != null)
|
${cfg.package}/bin/i3 ${optionalString (cfg.configFile != null)
|
||||||
"-c /etc/i3/config"
|
"-c /etc/i3/config"
|
||||||
} &
|
} &
|
||||||
|
|
Loading…
Reference in a new issue