[Unit] Description=Headless Sway compositor for Sunshine wlr capture # Don't auto-restart on `systemctl --user stop` — but bring sway back if it # actually crashes mid-stream. After=graphical-session-pre.target PartOf=graphical-session.target [Service] Type=simple # Tell wlroots to use the headless backend (no DRM master needed) and skip # libinput device probing — there are no input devices on a real headless box. # The Vulkan renderer is preferred on NVIDIA + handles NVENC capture cleanly; # wlroots falls back to GLES2 automatically if Vulkan isn't usable. Environment=WLR_BACKENDS=headless Environment=WLR_LIBINPUT_NO_DEVICES=1 Environment=WLR_RENDERER=vulkan Environment=XDG_SESSION_TYPE=wayland ExecStart=/usr/bin/sway --config %h/.config/sway/config-headless --unsupported-gpu Restart=on-failure RestartSec=2s TimeoutStopSec=5s [Install] WantedBy=default.target