mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-26 05:54:35 +00:00
greetd: Run session command from user's shell
This commit is contained in:
parent
03d4c5e69a
commit
a39d39ec1e
|
@ -16,6 +16,20 @@
|
||||||
|
|
||||||
sessionData = config.services.displayManager.sessionData.desktops;
|
sessionData = config.services.displayManager.sessionData.desktops;
|
||||||
|
|
||||||
|
# Run the session / application using the appropriate shell configured for this user.
|
||||||
|
# This will make sure all of the environment variables are set before the WM session
|
||||||
|
# is started. This is very important, as without it, variables for things like qt theme
|
||||||
|
# will not be set, and applications executed by the WM will not be themed properly.
|
||||||
|
sessionWrapperScript = pkgs.writeShellScriptBin "tuigreet-session-wrapper" ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
script_name="$0"
|
||||||
|
shell="$(getent passwd itsdrike | awk -F: '{print $NF}')"
|
||||||
|
command=("$@")
|
||||||
|
|
||||||
|
exec "$shell" -c 'exec "$@"' "$script_name" "''${command[@]}"
|
||||||
|
'';
|
||||||
|
|
||||||
defaultSession = {
|
defaultSession = {
|
||||||
user = "greeter";
|
user = "greeter";
|
||||||
command = concatStringsSep " " [
|
command = concatStringsSep " " [
|
||||||
|
@ -28,6 +42,8 @@
|
||||||
"--theme ${tuiGreetTheme}"
|
"--theme ${tuiGreetTheme}"
|
||||||
"--sessions '${sessionData}/share/wayland-sessions'"
|
"--sessions '${sessionData}/share/wayland-sessions'"
|
||||||
"--xsessions '${sessionData}/share/xsessions'"
|
"--xsessions '${sessionData}/share/xsessions'"
|
||||||
|
"--session-wrapper ${sessionWrapperScript}/bin/tuigreet-session-wrapper"
|
||||||
|
"--xsession-wrapper ${sessionWrapperScript}/bin/tuigreet-session-wrapper startx /usr/bin/env \"$@\""
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
Loading…
Reference in a new issue