Files
Omarchy-Stream/files/headless-desktop-gnome.service
Levi Woodard 84ddf8c1c6 Default the x11 headless desktop to GNOME (Openbox still opt-in)
Bare Openbox rendered only a blank slate root — usable but not the
desktop wanted. Make the X11/NVENC capture path render a full GNOME
session by default, with Openbox available via HEADLESS_DESKTOP=openbox
for minimal/low-power hosts.

- files/headless-desktop-gnome.service: full Ubuntu GNOME session forced
  onto the X11 path (XDG_SESSION_TYPE=x11, no dbus-run-session so it
  shares the systemd user bus). Renamed the Openbox unit to
  headless-desktop-openbox.service.
- lib/headless.sh: HEADLESS_DESKTOP (default gnome) selects the unit
  template + the packages to install (gnome-session/gnome-shell vs
  openbox/xsetroot).
- install.sh: step message + usage document HEADLESS_DESKTOP.
- status.sh: the :0 desktop check now reports which desktop is running
  (reads _NET_WM_NAME off the supporting-wm-check window, e.g.
  "GNOME Shell").
- docs: TROUBLESHOOTING §13 + FOLLOWUPS P3 updated for the GNOME default
  and the openbox toggle.

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

31 lines
1.4 KiB
Desktop File

[Unit]
Description=GNOME session on the headless Xorg (gives Sunshine something to capture)
# Without a desktop running on :0, Sunshine's x11 capture grabs an empty black
# X root window — pairing, NVENC, and input all work but the client sees only
# black. This runs a full GNOME session on :0 so the stream shows a real
# desktop. Only relevant to the X11/NVENC capture backend (capture = x11); the
# wlr backend's compositor renders for itself.
Requires=xorg-headless.service
After=xorg-headless.service
PartOf=graphical-session.target
[Service]
Type=simple
# Force the X11 session path (not Wayland) onto the existing headless Xorg.
# No dbus-run-session wrapper: GNOME integrates with the systemd *user* bus,
# which this service already inherits — a fresh bus would break that.
Environment=DISPLAY=:0
Environment=XDG_SESSION_TYPE=x11
Environment=XDG_CURRENT_DESKTOP=ubuntu:GNOME
Environment=GNOME_SHELL_SESSION_MODE=ubuntu
# Wait for the X server to accept connections before launching the session.
ExecStartPre=/bin/sh -c 'for i in $(seq 1 20); do xset -display :0 -q >/dev/null 2>&1 && exit 0; sleep 0.5; done; exit 1'
ExecStart=/usr/bin/gnome-session --session=ubuntu
Restart=on-failure
RestartSec=2s
[Install]
# Lingering user manager reaches default.target without a graphical login,
# matching the headless-boot drop-in pattern used for Sunshine.
WantedBy=default.target