mirror of
https://github.com/nix-community/home-manager
synced 2024-11-16 16:19:44 +01:00
xsession: use systemd graphical targets
The systemd targets don't allow direct startup so we create our own target for graphical sessions managed by Home Environment.
This commit is contained in:
parent
a9343d8194
commit
acf8d4e985
1 changed files with 9 additions and 14 deletions
|
@ -60,19 +60,12 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# For stuff that needs to start just before a graphical session
|
# A basic graphical session target for Home Manager.
|
||||||
# starts.
|
systemd.user.targets.he-graphical-session = {
|
||||||
systemd.user.targets.graphical-session-pre = {
|
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Pre-graphical session";
|
Description = "Home Manager X session";
|
||||||
};
|
Requires = [ "graphical-session-pre.target" ];
|
||||||
};
|
BindsTo = [ "graphical-session.target" ];
|
||||||
|
|
||||||
# A basic graphical session target. Apparently this will come
|
|
||||||
# standard in future Systemd versions.
|
|
||||||
systemd.user.targets.graphical-session = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Graphical session";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,6 +76,9 @@ in
|
||||||
. "$HOME/.profile"
|
. "$HOME/.profile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If there are any running services from a previous session.
|
||||||
|
systemctl --user stop graphical-session.target graphical-session-pre.target
|
||||||
|
|
||||||
systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS
|
systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS
|
||||||
systemctl --user import-environment DISPLAY
|
systemctl --user import-environment DISPLAY
|
||||||
systemctl --user import-environment SSH_AUTH_SOCK
|
systemctl --user import-environment SSH_AUTH_SOCK
|
||||||
|
@ -90,8 +86,7 @@ in
|
||||||
systemctl --user import-environment XDG_DATA_DIRS
|
systemctl --user import-environment XDG_DATA_DIRS
|
||||||
systemctl --user import-environment XDG_RUNTIME_DIR
|
systemctl --user import-environment XDG_RUNTIME_DIR
|
||||||
|
|
||||||
systemctl --user restart graphical-session-pre.target
|
systemctl --user start he-graphical-session.target
|
||||||
systemctl --user restart graphical-session.target
|
|
||||||
|
|
||||||
${cfg.initExtra}
|
${cfg.initExtra}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue