Files
dotfiles/hosts/mainframe/sunshine/apps.json
T
connor 79da785ed4 sunshine: wrap the resolution prep-cmd in sh -c
eb6a42c set HEADLESS-1 from SUNSHINE_CLIENT_WIDTH/HEIGHT/FPS but never
actually ran: Sunshine execs a prep-cmd directly, with no shell, so ${...}
was passed through literally. swaymsg received "mode ${SUNSHINE_CLIENT_WIDTH}
x..." as its argument, exited 2, and Sunshine reports any failed prep-cmd to
the client as the one opaque "failed to start the specified application".

The variable names were right and Sunshine does export them; the shell was
the missing part, which is why upstream's own example wraps the command.
Verified live at 2560x1440@60 and 1920x1080@120.

Worth keeping for the next time this breaks: swaymsg exits 2 when the socket
is reachable and the command is rejected, and 1 when it cannot find the
socket at all. That distinction is what ruled out a SWAYSOCK problem and
confirmed the malformed mode string without guessing.
2026-09-15 12:06:25 -04:00

31 lines
822 B
JSON

{
"env": {
"PATH": "$(PATH):$(HOME)/.local/bin:$(HOME)/.dotfiles/common/bin"
},
"apps": [
{
"name": "Desktop",
"image-path": "desktop.png",
"prep-cmd": [
{
"do": "sh -c \"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",
"prep-cmd": [
{
"do": "sh -c \"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"
]
}
]
}