sunshine: size the virtual output to the client

The work laptop drives two 3840x2160 panels, so a fixed 1920x1080 capture
was being upscaled 2x on the client — fine for Big Picture's large UI,
visibly soft for terminal text on the Desktop app.

A headless wlroots output has no physical size, so it can take any mode.
Both apps now set HEADLESS-1 to SUNSHINE_CLIENT_WIDTH/HEIGHT/FPS in their
prep-cmd and restore 1920x1080 on undo. SWAYSOCK joins the environment
import so Sunshine's prep-cmds can reach the compositor at all.
This commit is contained in:
2026-09-14 16:28:32 -04:00
parent 2a2e94cc71
commit eb6a42c4d7
2 changed files with 13 additions and 7 deletions
+12 -6
View File
@@ -5,19 +5,25 @@
"apps": [
{
"name": "Desktop",
"image-path": "desktop.png"
"image-path": "desktop.png",
"prep-cmd": [
{
"do": "swaymsg output HEADLESS-1 mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}Hz",
"undo": "swaymsg output HEADLESS-1 mode 1920x1080@60Hz"
}
]
},
{
"name": "Steam Big Picture",
"image-path": "steam.png",
"detached": [
"setsid steam -gamepadui"
],
"prep-cmd": [
{
"do": "",
"undo": "setsid steam -shutdown"
"do": "swaymsg output HEADLESS-1 mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}Hz",
"undo": "swaymsg output HEADLESS-1 mode 1920x1080@60Hz"
}
],
"detached": [
"setsid steam -gamepadui"
]
}
]
+1 -1
View File
@@ -23,7 +23,7 @@ xwayland force
# DISPLAY to the apps it launched. Steam then failed with "Unable to open a
# connection to X" even though Xwayland was up and the manager environment was
# correct.
exec systemctl --user import-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP && systemctl --user start sunshine.service
exec systemctl --user import-environment WAYLAND_DISPLAY DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP && systemctl --user start sunshine.service
# Input arrives from the Moonlight client, so keybinds are worth having even
# though nobody is sitting at this machine. Without them the Desktop app