XDG Autostart

Create the generator service in ~/.config/systemd/user/xdg-autostart-generator.service.

[Unit]
Description=Run systemd-xdg-autostart-generator on login

[Service]
Type=oneshot
ExecStartPre=mkdir -p %t/systemd/user
ExecStart=/usr/lib/systemd/user-generators/systemd-xdg-autostart-generator %t/systemd/user

[Install]
WantedBy=default.target

Then create an override file for the autostart.target as ~/.config/systemd/user/xdg-desktop-autostart.target.d/override.conf.

[Unit]
After=xdg-autostart-generator.service
Requires=sway-session.target
BindsTo=sway-session.target

[Install]
WantedBy=sway-session.target