[Unit] Description=sway - Wayland window manager Documentation=man:sway(5) BindsTo=sway-session.target Wants=sway-session-pre.target After=sway-session-pre.target Before=sway-session.target [Service] # sway doesn't support systemd notifications, but can be modified to # synthesize such an event. this can be done with something like this # in the sway configuration # #exec systemctl --user import-environment SWAYSOCK \ # DISPLAY \ # I3SOCK \ # WAYLAND_DISPLAY \ # XCURSOR_SIZE \ # XCURSOR_THEME \ # && systemd-notify --ready # # the point of this is to propagate the sway and wayland environments # out to the rest of the systemd session and only *then* notify # systemd that the unit is ready. that way other units get started # only at this anchor point. Type=notify NotifyAccess=all ExecStart=/usr/bin/sway # this runs after `systemd-notify --ready` and hopefully keeps sway # subprocesses from taking over MainPID, see # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1039857 ExecStartPost=systemctl --user unset-environment NOTIFY_SOCKET Restart=on-failure RestartSec=1 TimeoutStopSec=10 # This line make you able to logout to dm and login into sway again ExecStopPost=/usr/bin/systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY # don't crash the session when a subprocess OOM's OOMPolicy=continue