xsession: add option xsession.initBeforeSystemd
This commit add an option called xsession.initBeforeSystemd to setup xsession related options such as merging xresources and doing other x11 related setup before hm-graphical-session.target is started. For example, before this commit, if we set dpi using xresources, it won't work for user graphical systemd services since xresources is merged after hm-graphical-session.target is started.
This commit is contained in:
parent
98282a481d
commit
f2b5f8c61d
|
@ -139,7 +139,7 @@ in {
|
|||
}
|
||||
|
||||
(mkIf cfg.x11.enable {
|
||||
xsession.initExtra = ''
|
||||
xsession.initBeforeSystemd = ''
|
||||
${pkgs.xorg.xsetroot}/bin/xsetroot -xcf ${cursorPath} ${
|
||||
toString cfg.size
|
||||
}
|
||||
|
|
|
@ -99,6 +99,6 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
xsession.initExtra = xrdbMerge;
|
||||
xsession.initBeforeSystemd = xrdbMerge;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -70,6 +70,13 @@ in {
|
|||
description = "Extra shell commands to run before session start.";
|
||||
};
|
||||
|
||||
initBeforeSystemd = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description =
|
||||
"Shell commands to run before starting hm-graphical-session.target. For example, configuring x11 cursor and dpi.";
|
||||
};
|
||||
|
||||
initExtra = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
|
@ -200,6 +207,8 @@ in {
|
|||
fi
|
||||
unset HM_XPROFILE_SOURCED
|
||||
|
||||
${cfg.initBeforeSystemd}
|
||||
|
||||
systemctl --user start hm-graphical-session.target
|
||||
|
||||
${cfg.initExtra}
|
||||
|
|
|
@ -3,6 +3,8 @@ if [ -z "$HM_XPROFILE_SOURCED" ]; then
|
|||
fi
|
||||
unset HM_XPROFILE_SOURCED
|
||||
|
||||
|
||||
|
||||
systemctl --user start hm-graphical-session.target
|
||||
|
||||
init extra commands
|
||||
|
|
Loading…
Reference in a new issue