Files
Omarchy-Stream/files/sway-headless.service
Levi Woodard ab23107300 Add runtime status checker + headless/X11 docs; distro-support refinements
- status.sh: runtime health check (service state, boot wiring, display backend auto-detect, encoder, ports, web UI, /dev/uinput, pairing) ending in a g2g verdict or concrete TODO list

- docs: TROUBLESHOOTING §12 (headless graphical-session.target boot trap) + §13 (X11/NVENC path & stale wlr drop-in env conflict); ARCHITECTURE capture-backend comparison; FOLLOWUPS P3 (installer X11/Ubuntu support); README diagnostics pointer

- lib/{config,packages,permissions,service}.sh, files/sway-headless.service: in-progress Debian/Ubuntu + headless support refinements

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 22:57:03 +00:00

38 lines
1.5 KiB
Desktop File

[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.
#
# GLES2 renderer: the Vulkan backend strictly requires
# VK_EXT_external_memory_dma_buf, which the proprietary NVIDIA driver
# doesn't expose on every build (esp. data-center / -server branches). GLES2
# is universally available and Sunshine's capture path uses its own dma-buf
# flow, so we don't lose hardware acceleration.
Environment=WLR_BACKENDS=headless
Environment=WLR_LIBINPUT_NO_DEVICES=1
# Pixman (software) renderer. The GLES2 path needs a GBM-allocated framebuffer,
# which fails on the proprietary NVIDIA driver: its GBM bridge doesn't permit
# unprivileged CREATE_DUMB even on render nodes (Mesa drivers do). The trade-
# off: Sunshine's wlr-screencopy then takes the shm path and uses libx264
# software encoding. For NVENC on NVIDIA cloud GPUs, sunshine should be
# pointed at a virtual KMS connector (vkms or Xorg+Dummy) instead of wlroots.
Environment=WLR_RENDERER=pixman
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