diff --git a/.config/systemd/user/sway-session.target b/.config/systemd/user/sway-session.target new file mode 100644 index 0000000..73a9f5d --- /dev/null +++ b/.config/systemd/user/sway-session.target @@ -0,0 +1,11 @@ +[Unit] +Description=Sway compositor session +Documentation=man:systemd.special +RefuseManualStart=yes +StopWhenUnneeded=yes +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/sway.service b/.config/systemd/user/sway.service index 5477d74..e1fd353 100644 --- a/.config/systemd/user/sway.service +++ b/.config/systemd/user/sway.service @@ -1,11 +1,18 @@ [Unit] -Description=Sway window manager +Description=sway - SirCmpwn's Wayland window manager +Documentation=man:sway(5) +BindsTo=sway-session.target +Before=sway-session.target [Service] +Type=notify +EnvironmentFile=-%h/.config/sway/env ExecStart=/usr/bin/sway -Restart=always -RestartSec=10 +Restart=on-failure +RestartSec=1 +TimeoutStopSec=10 +NotifyAccess=all +ExecStopPost=/usr/bin/systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY [Install] -WantedBy=wm.target - +WantedBy=sway-session.target diff --git a/install b/install index 9f534ed..4fb96c8 100755 --- a/install +++ b/install @@ -77,6 +77,7 @@ install() { configure() { systemctl --user enable ssh-agent + systemctl --user enable sway-session.target systemctl --user enable sway }