sway: don't launch s6 from within the sway session

This commit is contained in:
Colin 2024-03-23 13:04:48 +00:00
parent 4418c16967
commit db2801c652
2 changed files with 4 additions and 43 deletions

View File

@ -186,8 +186,6 @@ in
# bind ALL of ~/.config/sway into the sandbox instead of just the individual configs.
# this way `swaymsg -- reload` can work even if the fd for ~/.config/sway/config changes.
".config/sway"
".config/s6"
".local/state/s6" #< TODO: remove?
];
sandbox.extraConfig = [
"--sane-sandbox-keep-namespace" "pid"
@ -222,41 +220,14 @@ in
env.DISPLAY = ":0";
env.WAYLAND_DISPLAY = "wayland-1";
# services.sway-session = {
# description = "sway-session: active iff sway desktop environment is baseline operational";
# documentation = [
# "https://github.com/swaywm/sway/issues/7862"
# "https://github.com/alebastr/sway-systemd"
# ];
# # we'd like to start graphical-session after sway is ready, but it's marked `RefuseManualStart` because Lennart.
# # instead, create `sway-session.service` which `bindsTo` `graphical-session.target`.
# # we can manually start `sway-session`, and the `bindsTo` means that it will start `graphical-session`,
# # and then track `graphical-session`s state (that is: it'll stop when graphical-session stops).
# #
# # additionally, set `ConditionEnvironment` to guard that the sway environment variables *really have* been imported into systemd.
# unitConfig.ConditionEnvironment = "SWAYSOCK";
# # requiredBy = [ "graphical-session.target" ];
# before = [ "graphical-session.target" ];
# bindsTo = [ "graphical-session.target" ];
# serviceConfig = {
# ExecStart = "${pkgs.coreutils}/bin/true";
# Type = "oneshot";
# RemainAfterExit = true;
# };
# };
# services.sway-session = {
# description = "sway-session: meta-service for everything wanted by sway (after launch)";
# wants = [ "graphical-session.target" ];
# };
services.sway = {
description = "sway: tiling wayland desktop environment";
partOf = [ "default" ];
dependencyOf = [ "graphical-session" ];
command = "sway";
readiness.waitExists = "$SWAY_SOCK";
};
# link the graphical-session into the default target, so sway gets auto-started
services.graphical-session.partOf = [ "default" ];
};

View File

@ -253,15 +253,5 @@ exec --no-startup-id dbus-update-activation-environment --systemd PATH XDG_DATA_
# - WAYLAND_DISPLAY
# - SWAYSOCK
# - XDG_CURRENT_DESKTOP
# include /etc/sway/config.d/*
# signal to systemd that sway is active,
# and therefore let it start any downstream services (e.g. apps that would like to auto-start)
# see `systemctl --user cat sway-session` for links to docs
# exec --no-startup-id systemctl start --user sway-session.service
# TODO: remove this. likely, the variables above can/should be set *before* launching the service manager at all.
# and if need be we can replace this line with a "notify ready" signal to the service manager instead.
exec --no-startup-id s6-rc -l $HOME/.config/s6/live start graphical-session
@extra_lines@