Coarse DisplaySwitch projection modes cannot reliably target the virtual display once multiple physical monitors are connected. The setup needs to persist Sunshine's device-specific configuration and document the recovery path so stream startup and abnormal shutdown handling remain predictable.
SunshineDisplaySwitch
English
Configures Sunshine + Moonlight to stream from a selected display device. This is intended for setups with physical monitors plus an IDD virtual monitor: Sunshine activates the selected monitor for the stream and deactivates the other monitors while the stream is active.
Files
| File | Purpose |
|---|---|
select_sunshine_monitor.bat |
All-in-one terminal tool to list monitors, select the streaming monitor, write Sunshine settings, and reset them |
register_task.bat |
Optional logon fallback for abnormal shutdown while the stream is still using the IDD-only topology |
Setup
Run select_sunshine_monitor.bat by double-clicking it.
The terminal menu shows all Sunshine display devices with their IDs and status:
- enter a number to select the monitor Sunshine should use for streaming
- enter
Rto remove the display-device settings and return Sunshine to its defaults - enter
Qto cancel
Select the IDD virtual monitor, for example IDD HDR. If Windows asks for administrator permission, allow it so the tool can update Sunshine's config under C:\Program Files\Sunshine\config\sunshine.conf.
After saving, restart Sunshine when prompted. Stop the current Moonlight session completely and start a new stream.
Optional Startup Fallback
Sunshine restores the original display topology after a normal stream end. If Windows is shut down from Steam or another streamed app while the stream is still active, Sunshine may not get a chance to revert the IDD-only topology. In that case Windows can boot with the physical monitor still disabled.
Run register_task.bat as administrator if you want a logon fallback for that case. It registers the MoonlightTeardown task for the current user and runs DisplaySwitch.exe /internal at logon to bring a physical display back.
This fallback is separate from the normal Sunshine display-device workflow. It is only meant as a recovery path after abnormal shutdowns.
Sunshine Settings
The tool writes these settings:
output_name = {selected-display-device-id}
dd_configuration_option = ensure_only_display
dd_resolution_option = auto
dd_refresh_rate_option = auto
dd_config_revert_delay = 3000
ensure_only_display tells Sunshine to activate the selected display and deactivate the other monitors during the stream.
Resolution and refresh-rate automation are enabled so Sunshine applies the Moonlight client's requested mode to the selected display. Make sure the virtual display driver supports all client modes you want to use, for example 3840x2160 @ 120 Hz; otherwise Sunshine can fail the display switch.
Reset
Use R in select_sunshine_monitor.bat to remove the settings written by this tool:
output_name
dd_configuration_option
dd_resolution_option
dd_refresh_rate_option
dd_config_revert_delay
This returns Sunshine to its default display selection behavior.
Requirements
- Windows 10/11
- Sunshine as streaming server
- IDD (Indirect Display Driver) or another virtual display driver
Deutsch
Konfiguriert Sunshine + Moonlight so, dass von einem ausgewählten Display-Gerät gestreamt wird. Das ist für Setups mit physischen Monitoren plus IDD-virtuellem Monitor gedacht: Sunshine aktiviert den ausgewählten Monitor für den Stream und deaktiviert die anderen Monitore, solange der Stream aktiv ist.
Dateien
| Datei | Zweck |
|---|---|
select_sunshine_monitor.bat |
All-in-one-Terminaltool zum Auflisten der Monitore, Auswählen des Streaming-Monitors, Schreiben der Sunshine-Einstellungen und Zurücksetzen |
register_task.bat |
Optionaler Logon-Fallback nach abnormalem Herunterfahren, während der Stream noch die IDD-only-Topologie verwendet |
Einrichtung
select_sunshine_monitor.bat per Doppelklick starten.
Das Terminalmenü zeigt alle Sunshine-Display-Geräte mit ID und Status:
- Zahl eingeben, um den Monitor auszuwählen, den Sunshine zum Streamen verwenden soll
Reingeben, um die Display-Device-Einstellungen zu entfernen und Sunshine auf Default zurückzusetzenQeingeben, um abzubrechen
Den virtuellen IDD-Monitor auswählen, zum Beispiel IDD HDR. Falls Windows Administratorrechte anfordert, bestätigen, damit das Tool die Sunshine-Konfiguration unter C:\Program Files\Sunshine\config\sunshine.conf aktualisieren kann.
Nach dem Speichern Sunshine neu starten, wenn das Tool danach fragt. Eine laufende Moonlight-Sitzung vollständig beenden und anschließend einen neuen Stream starten.
Optionaler Start-Fallback
Sunshine stellt die ursprüngliche Display-Topologie nach einem normalen Streamende wieder her. Wenn Windows aber aus Steam oder einer anderen gestreamten Anwendung heruntergefahren wird, während der Stream noch aktiv ist, bekommt Sunshine eventuell keine Gelegenheit mehr, die IDD-only-Topologie zurückzusetzen. Dann kann Windows beim nächsten Start mit deaktiviertem physischem Monitor hochfahren.
register_task.bat als Administrator ausführen, wenn dieser Fall abgesichert werden soll. Das Skript registriert den Task MoonlightTeardown für den aktuellen Benutzer und führt beim Logon DisplaySwitch.exe /internal aus, um einen physischen Bildschirm zurückzuholen.
Dieser Fallback ist getrennt vom normalen Sunshine-Display-Device-Workflow. Er ist nur als Recovery-Pfad nach abnormalem Herunterfahren gedacht.
Sunshine-Einstellungen
Das Tool schreibt diese Einstellungen:
output_name = {ausgewaehlte-display-device-id}
dd_configuration_option = ensure_only_display
dd_resolution_option = auto
dd_refresh_rate_option = auto
dd_config_revert_delay = 3000
ensure_only_display weist Sunshine an, das ausgewählte Display zu aktivieren und die anderen Monitore während des Streams zu deaktivieren.
Auflösungs- und Hz-Automatik sind aktiviert, damit Sunshine den vom Moonlight-Client angeforderten Modus auf dem ausgewählten Display setzt. Der virtuelle Display-Treiber muss alle gewünschten Client-Modi unterstützen, zum Beispiel 3840x2160 @ 120 Hz; andernfalls kann Sunshine die Display-Umschaltung abbrechen.
Zurücksetzen
Mit R in select_sunshine_monitor.bat werden die von diesem Tool geschriebenen Einstellungen entfernt:
output_name
dd_configuration_option
dd_resolution_option
dd_refresh_rate_option
dd_config_revert_delay
Damit verwendet Sunshine wieder sein Standardverhalten für die Display-Auswahl.
Voraussetzungen
- Windows 10/11
- Sunshine als Streaming-Server
- IDD (Indirect Display Driver) oder ein anderer virtueller Display-Treiber