feat: don't start sway as a systemd service
This commit is contained in:
parent
b0aa120073
commit
fa7812b21f
|
@ -5,4 +5,5 @@
|
||||||
# https://github.com/swaywm/sway/wiki/Systemd-integration
|
# https://github.com/swaywm/sway/wiki/Systemd-integration
|
||||||
# Also, import the most important environment variables into the D-Bus and systemd
|
# Also, import the most important environment variables into the D-Bus and systemd
|
||||||
# user environments (e.g. required for screen sharing and Pinentry prompts):
|
# user environments (e.g. required for screen sharing and Pinentry prompts):
|
||||||
exec "systemctl --user import-environment; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd $IMPORT_ENVIRONMENT_ENV_LIST DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway"
|
exec "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemctl --user start sway-session.target; dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"
|
||||||
|
exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target
|
||||||
|
|
|
@ -13,7 +13,7 @@ in {
|
||||||
|
|
||||||
# Run when initializing a login shell
|
# Run when initializing a login shell
|
||||||
profileExtra = ''
|
profileExtra = ''
|
||||||
[ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.sway-service}/bin/sway-service
|
[ "$(tty)" = "/dev/tty1" ] && exec systemd-cat --identifier=sway ${pkgs.sway}/bin/sway
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Run when initializing an interactive shell
|
# Run when initializing an interactive shell
|
||||||
|
|
|
@ -99,21 +99,11 @@
|
||||||
in
|
in
|
||||||
BLK + CHR + DIR + EXE + REG + HARDLINK + SYMLINK + MISSING + ORPHAN + FIFO + SOCK + OTHER;
|
BLK + CHR + DIR + EXE + REG + HARDLINK + SYMLINK + MISSING + ORPHAN + FIFO + SOCK + OTHER;
|
||||||
};
|
};
|
||||||
|
|
||||||
envListNames = lib.attrsets.mapAttrsToList (name: value: name) variables;
|
|
||||||
|
|
||||||
# Here we merge an extra variable into the attrset called FULL_ENV_LIST.
|
|
||||||
# It's a list of the variable names defined above.
|
|
||||||
# We can use this to tell `systemctl import-environment` to import the full list above.
|
|
||||||
variablesWithMeta = lib.attrsets.zipAttrsWith (name: values: builtins.head values) [
|
|
||||||
variables
|
|
||||||
{IMPORT_ENVIRONMENT_ENV_LIST = lib.lists.foldl (a: b: a + " " + b) "IMPORT_ENVIRONMENT_ENV_LIST" envListNames;}
|
|
||||||
];
|
|
||||||
in {
|
in {
|
||||||
home-manager.users."${psCfg.user.name}" = {
|
environment.variables = variables;
|
||||||
home.sessionVariables = variablesWithMeta;
|
|
||||||
systemd.user.sessionVariables = variablesWithMeta;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.variables = variablesWithMeta;
|
home-manager.users."${psCfg.user.name}" = {
|
||||||
|
home.sessionVariables = variables;
|
||||||
|
systemd.user.sessionVariables = variables;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ with prev; {
|
||||||
psos-docs = import ./psos-docs.nix final;
|
psos-docs = import ./psos-docs.nix final;
|
||||||
s = writeShellScriptBin "s" (import ./s.nix final);
|
s = writeShellScriptBin "s" (import ./s.nix final);
|
||||||
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
|
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
|
||||||
sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final);
|
|
||||||
swaylock-bg = writeShellScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
|
swaylock-bg = writeShellScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
|
||||||
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
|
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
|
||||||
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
|
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
self:
|
|
||||||
with self; ''
|
|
||||||
# first import environment variables from the login manager
|
|
||||||
systemctl --user import-environment;
|
|
||||||
# then start the service
|
|
||||||
exec systemctl --wait --user start sway.service
|
|
||||||
''
|
|
Loading…
Reference in a new issue