<%- header %>
<Navbar></Navbar>

# Applications

Applications are refreshed only when Client is restarted

Name | Actions
--- | ---
{{app.name}} |

Application Name
Application Name, as shown on Moonlight
Output
The file where the output of the command is stored, if it is not specified, the output is ignored
Global Prep Commands
Enable/Disable the execution of Global Prep Commands for this application.
Command Preparations
A list of commands to be run before/after this application.
If any of the prep-commands fail, starting the application is aborted.

Do Command | Undo Command | Run as Admin |
--- | --- | --- | ---
|  | Elevated |

Detached Commands
A list of commands to be run in the background.
Note: If the path to the command executable contains spaces, you must enclose it in quotes.
Command
The main application to start. If blank, no application will be started.
Note: If the path to the command executable contains spaces, you must enclose it in quotes.
Working Directory
The working directory that should be passed to the process. For example, some applications use the working directory to search for configuration files. If not set, Sunshine will default to the parent directory of the command
Run as administrator
This can be necessary for some applications that require administrator permissions to run properly.
Continue streaming if the application exits quickly
This will attempt to automatically detect launcher-type apps that close quickly after launching another program or instance of themselves. When a launcher-type app is detected, it is treated as a detached app.
Continue streaming until all app processes exit
This will continue streaming until all processes started by the app have terminated. When unchecked, streaming will stop when the initial app process exits, even if other app processes are still running.
Exit Timeout
Number of seconds to wait for all app processes to gracefully exit when requested to quit.
If unset, the default is to wait up to 5 seconds. If set to zero or a negative value, the app will be immediately terminated.
Image
Application icon/picture/image path that will be sent to client. Image must be a PNG file. If not set, Sunshine will send default box image.

#### About Environment Variables

All commands get these environment variables by default:

Var Name |
SUNSHINE_APP_ID | App ID
SUNSHINE_APP_NAME | App Name
SUNSHINE_CLIENT_WIDTH | The Width requested by the client
SUNSHINE_CLIENT_HEIGHT | The Height requested by the client
SUNSHINE_CLIENT_FPS | The FPS requested by the client
SUNSHINE_CLIENT_HDR | (true/false) if HDR is enabled by the client
SUNSHINE_CLIENT_GCMAP | (int) the requested gamepad mask, in a bitset/bitfield format
SUNSHINE_CLIENT_HOST_AUDIO | (true/false) if the client has requested host audio
SUNSHINE_CLIENT_ENABLE_SOPS | (true/false) if the client has requested the option to optimize the game for optimal streaming
SUNSHINE_CLIENT_AUDIO_CONFIGURATION | The Audio Configuration requested by the client (2.0/5.1/7.1)

Example - QRes for Resolution Automation:

    cmd /C <qres path>\QRes.exe /X:%SUNSHINE_CLIENT_WIDTH% /Y:%SUNSHINE_CLIENT_HEIGHT%

Example - Xrandr for Resolution Automation:

    sh -c "xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}\" --rate 60"

Example - displayplacer for Resolution Automation:

    sh -c "displayplacer "id:<screenId> res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:60 scaling:on origin:(0,0) degree:0""

See More