![]() |
Sunshine latest
Self-hosted game stream host for Moonlight.
|
Since not all applications behave the same, we decided to create some examples to help you get started adding games and applications to Sunshine.
Output field).| Field | Value |
|---|---|
| Application Name | Desktop
|
| Image | desktop.png
|
| Field | Value |
|---|---|
| Application Name | Steam Big Picture
|
| Command Preporations -> Undo | setsid steam steam://close/bigpicture
|
| Detached Commands | setsid steam steam://open/bigpicture
|
| Image | steam.png
|
| Field | Value |
|---|---|
| Application Name | Steam Big Picture
|
| Command Preporations -> Undo | setsid steam steam://close/bigpicture
|
| Detached Commands | setsid steam steam://open/bigpicture
|
| Image | steam.png
|
| Field | Value |
|---|---|
| Application Name | Steam Big Picture
|
| Command Preporations -> Undo | open steam://close/bigpicture
|
| Detached Commands | open steam://open/bigpicture
|
| Image | steam.png
|
| Field | Value |
|---|---|
| Application Name | Steam Big Picture
|
| Command Preporations -> Undo | steam://close/bigpicture
|
| Detached Commands | steam://open/bigpicture
|
| Image | steam.png
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Commands | com.epicgames.launcher://apps/d759128018124dcabb1fbee9bb28e178%3A20729b9176c241f0b617c5723e70ec2d%3AOvenbird?action=launch&silent=true
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | MarsEpic.exe
|
| Working Directory | "C:\Program Files\Epic Games\SurvivingMars"
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | "C:\Program Files\Epic Games\SurvivingMars\MarsEpic.exe"
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Detached Commands | setsid steam steam://rungameid/464920
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Detached Commands | setsid steam steam://rungameid/464920
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Detached Commands | open steam://rungameid/464920
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Detached Commands | steam://rungameid/464920
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | MarsSteam
|
| Working Directory | ~/.steam/steam/SteamApps/common/Survivng Mars
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | MarsSteam
|
| Working Directory | ~/.steam/steam/SteamApps/common/Survivng Mars
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | MarsSteam
|
| Working Directory | ~/.steam/steam/SteamApps/common/Survivng Mars
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | MarsSteam.exe
|
| Working Directory | "C:\Program Files (x86)\Steam\steamapps\common\Surviving Mars"
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | ~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | ~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | ~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam
|
| Field | Value |
|---|---|
| Application Name | Surviving Mars
|
| Command | "C:\Program Files (x86)\Steam\steamapps\common\Surviving Mars\MarsSteam.exe"
|
| Prep Step | Command |
|---|---|
| Do | sh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"
|
| Undo | xrandr --output HDMI-1 --mode 3840x2160 --rate 120
|
Do command to this: set-custom-res.sh will have this content: | Prep Step | Command |
|---|---|
| Do | sh -c "wlr-xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}Hz\""
|
| Undo | wlr-xrandr --output HDMI-1 --mode 3840x2160@120Hz
|
wlr-xrandr only works with wlroots-based compositors.| Prep Step | Command |
|---|---|
| Do | sh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"
|
| Undo | xrandr --output HDMI-1 --mode 3840x2160 --rate 120
|
| Prep Step | Command |
|---|---|
| Do | sh -c "displayconfig-mutter set --connector HDMI-1 --resolution ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --refresh-rate ${SUNSHINE_CLIENT_FPS} --hdr ${SUNSHINE_CLIENT_HDR}"
|
| Undo | displayconfig-mutter set --connector HDMI-1 --resolution 3840x2160 --refresh-rate 120 --hdr false
|
Installation instructions for displayconfig-mutter can be found here. Alternatives include gnome-randr-rust and gnome-randr.py, but both of those are unmaintained and do not support newer Mutter features such as HDR and VRR.
--hdr flag from both Do and Undo steps.| Prep Step | Command |
|---|---|
| Do | sh -c "kscreen-doctor output.HDMI-A-1.mode.${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}"
|
| Undo | kscreen-doctor output.HDMI-A-1.mode.3840x2160@120
|
HDMI-A-0, but on Wayland, it may be called HDMI-A-1.HDMI-A-1 with the display name of the monitor you would like to use for Moonlight. You can list the monitors available to you with: kscreen-doctor output.HDMI-A1.mode.0) or using the above do command to fetch the resolution requested by your Moonlight client (which has a chance of not being supported by your monitor).| Prep Step | Command |
|---|---|
| Do | sh -c "nvidia-settings -a CurrentMetaMode=\"HDMI-1: nvidia-auto-select { ViewPortIn=${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}, ViewPortOut=${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}+0+0 }\""
|
| Undo | nvidia-settings -a CurrentMetaMode=\"HDMI-1: nvidia-auto-select { ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0 }"
|
displayplacer tool to change the resolution. This tool can be installed following instructions in their GitHub repository.| Prep Step | Command |
|---|---|
| Do | sh -c "displayplacer \"id:<screenId> res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:${SUNSHINE_CLIENT_FPS} scaling:on origin:(0,0) degree:0\""
|
| Undo | displayplacer "id:<screenId> res:3840x2160 hz:120 scaling:on origin:(0,0) degree:0"
|
Sunshine has built-in support for changing the resolution and refresh rate on Windows. If you prefer to use a third-party tool, you can use QRes as an example.
| Prep Step | Command |
|---|---|
| Do | cmd /C "FullPath\qres.exe /x:%SUNSHINE_CLIENT_WIDTH% /y:%SUNSHINE_CLIENT_HEIGHT% /r:%SUNSHINE_CLIENT_FPS%"
|
| Undo | FullPath\qres.exe /x:3840 /y:2160 /r:120
|
flatpak-spawn --host.Elevating Commands (Windows)
If you've installed Sunshine as a service (default), you can specify if a command should be elevated with administrative privileges. Simply enable the elevated option in the WEB UI, or add it to the JSON configuration. This is an option for both prep-cmd and regular commands and will launch the process with the current user without a UAC prompt.
Example