README
This tool automatically switches your main display to a dummy plug (or any virtual display) that you have set up for Sunshine. The goal is to seamlessly switch from your normal monitor setup to a dummy display when you start streaming (e.g., using Moonlight on a mobile device).
How It Works
- Normal Operation: When you’re not streaming, your PC uses your regular monitor arrangement.
- While Streaming: As soon as you start a Moonlight stream on another device, the script automatically switches to a dummy monitor configuration (or another specified monitor layout).
Important Notes
-
Dummy Plug / Virtual Display:
This script is designed for systems with a dummy plug or virtual display, but it can be used in other scenarios. For instance, you can use it to switch from a dual-monitor setup to a single monitor while streaming. -
Windows 11 Users:
Due to a known bug, you must set the default terminal to Windows Console Host.-
On newer Windows 11 versions:
- Open Settings.
- Go to System > For Developers.
- Locate the Terminal setting (which defaults to "Let Windows decide").
- Change it to Terminal [Windows Console Host].
-
On older Windows 11 versions:
- Open Settings.
- Go to Privacy & Security > Security > For Developers.
- Find the Terminal option.
- Change it from "Let Windows decide" to Terminal [Windows Console Host].
Without this setting, the script may not work correctly.
-
-
Do Not Move the Script’s Folder After Installation:
If you move the installation folder after setting up the script, it may stop working. In that case, simply reinstall it. -
Cold Reboots / Hard Crashes Issue:
On a cold boot (from a fully powered-off state), Windows may not allow the script to switch monitors immediately.Workaround:
- After a cold boot, start your PC and log in using the "Desktop" stream option in Moonlight.
- End the stream, then start it again.
After doing this once, subsequent uses should work normally.
-
Sunshine Web UI Setting:
Do not set an “Output Name” in the Sunshine Web UI under the Audio/Video tab. Leave it blank. Setting an output name may break the script’s functionality.
Requirements
-
For GFE (GeForce Experience) Users:
This script no longer supports GFE. If you need the older version that worked with GFE, download the Legacy Version. -
For Sunshine Users:
- Sunshine version 0.19.1 or higher.
- Host computer must be running Windows.
Step-by-Step Setup for Monitor Configuration
-
Sunshine Output Settings:
- In the Sunshine Web UI, ensure the “Output Name” field is blank under Audio/Video settings.
-
Install the Script:
- Follow the provided installer instructions to set up the script on your computer.
-
Set Your Baseline (Primary) Monitor Setup:
- Arrange your monitors as desired for normal operation (e.g., when you’re not streaming).
-
Save Your “Primary” Monitor Profile:
- Open Terminal/Command Prompt in the script’s folder.
- Run the following command:
.\MonitorSwitcher.exe -save:Primary.xml
- This creates a snapshot of your current monitor configuration as
Primary.xml
.
-
Prepare to Save Your “Dummy” Monitor Profile:
- Start a Moonlight stream from another device (e.g., phone, tablet) so you can view and control your PC remotely.
- This is essential because your physical monitor will go dark when switching to the dummy monitor.
-
Configure the Dummy Monitor Setup (While Streaming):
- With the remote stream running:
- On your Windows PC, open Settings > System > Display.
- Click Identify to determine the monitor number for streaming. For a dummy plug, identify the monitor number that is not physically visible.
- If multiple monitors are active, disconnect secondary monitors:
- Select the monitor to disconnect (e.g., monitor #2).
- Use the dropdown menu to choose Disconnect this display.
- Repeat until only the primary monitor is active.
- This is required in order to see the Show only on {NUMBER} options.
- Ensure you are remotely viewing the PC on another device before proceeding, as you will not be able to see the screen physically on this next step.
- In Display settings, set the dropdown to Show only on {NUMBER}, where
{NUMBER}
is the dummy/streaming monitor. - While at your computer confirm the display settings by clicking "Keep Changes", use your other device that is currently streaming for guidance on moving the mouse.
- With the remote stream running:
-
Save Your “Dummy” Monitor Profile:
- In the Terminal (still in the script’s folder), run the following command:
.\MonitorSwitcher.exe -save:Dummy.xml
- This saves your dummy/streaming monitor configuration as
Dummy.xml
.
- In the Terminal (still in the script’s folder), run the following command:
-
Completing the Setup:
- End the Moonlight stream session.
- Your display should revert to the original configuration on your physical monitor.
Now, the script will automatically switch to the dummy display configuration when streaming and restore your original setup when you stop streaming.
Troubleshooting
If the ResolutionAutomation script doesn’t switch resolutions properly or is unreliable:
- Increase the start delay in settings.json (located in the script’s folder) to 3 or 4 seconds. This gives the monitor-switching process more time before the resolution change occurs.
Change Log
v2.0.2
- More bug fixes that prevented primary monitor from restoring after a stream was ended.
v2.0.1
- Fixed a bug that prevented the primary monitor from restoring after ending a stream.
v2.0.0
- Switched from Nirsoft MultiMonitorTool to MonitorSwitcher for better compatibility with Windows 24H2 and improved reliability.
v1.2.0
- Added changes to support Hybrid GPU fixes, assisting laptop users in forcing NVIDIA encoding.
v1.1.9
- Updated MultiMonitorTool to v2.10.
- Improved validation for restoring primary monitors.
v1.1.8
- Added debug logging.
- Fixed monitor flicker issue related to known workarounds.