Sunshine Utils offers some useful utils for using with Sunshine / Moonlight / Playnite game streaming.
If this helps you please consider buying me a coffee as a token of appreciation.
resolution_change
- a Windows utility to change the screen resolution before a gaming session and reset it after
- Copy
resolution_change.exe
to a folder on your computer - I useC:\Program Files\sunshine_utils
- In Sunshine Add a "Command Perparations"
- In the "Do" box set the resolution you want e.g.
C:\Program Files\sunshine_utils\resolution_change.exe -p 1080p
- In the "Undo" box to reset the resolution:
C:\Program Files\sunshine_utils\resolution_change.exe -r
- In the "Do" box set the resolution you want e.g.
- If using this with Playnite use the following in the "Command" for Playnite
"C:\<PLAYNITE_FOLDER>\Playnite.FullscreenApp.exe" --hidesplashscreen
usage: resolution_change.py [-h] [-l] [--width WIDTH] [--height HEIGHT]
[--refreshrate REFRESHRATE] [-d DISPLAY]
[--detach-other-monitors] [-p PRESET] [-r]
[--detach-monitor] [--wait WAIT] [--debug]
Changes monitor resolution
options:
-h, --help show this help message and exit
-l, --list-displays List current displays and exit
--width WIDTH Resolution Width
--height HEIGHT Resolution Height
--refreshrate REFRESHRATE
The refresh rate in hertz
-d DISPLAY, --display DISPLAY
Which display to use e.g. \\.\DISPLAY1 (defaults to
current primary)
--detach-other-monitors
Detach other monitors except the named one
-p PRESET, --preset PRESET
A preset to use can be one of: 4k, 2k, 1080p, 800p, 720p
-r, --reset Reset the resolution that a previous run has changed
--detach-monitor Detach the named display
--wait WAIT Time in seconds to wait after changing resolution
before exiting
--debug Enable debug mode so the program won't exit after
running
You can list out displays on your machine using -l
or --list-displays
this will show the current enabled displays
By default, the primary monitor's resolution will be changed. You can target resolution changes to a particular display using -d
or --display
e.g. resolution_change.exe --width 1920 --height 1080 -d "\\.\DISPLAY2"
You can detach all other monitors using --detach-other-monitors
Or you can just detach a named monitor using --detact-monitor
To return your settings back to normal call --reset
Not all of these have been tested please raise an issue if you find any.
This is a Windows based utilities so development needs to be done on Windows.
- Install Python 3.11 for Windows, ensuring that you select "Add Python to PATH" during installation.
- Install pipenv via
pip install pipenv
. - Install git for windows
- Open a command prompt
- Clone this repo
- In the repo directory run
python.exe -m venv venv
- To active the venv run
.\venv\Scripts\activate.bat
- Run
pipenv install
to install the dependencies - To run locally
python resolution_change.py -p 1080p
- When finished to deactive the virtual env
.\venv\Scripts\deactivate.bat
- Activate the venv as above (and ensure you have installed the dependencies)
- Run
build.bat
- You will find the exe in the dist folder
A big thank you goes out to cgarst. He wrote gamestream_launchpad a lot of the code in this repo uses his methods for changing the resolution. Also thanks to ventorvar whose pull request on gamestream_launchpad helped with multi monitor support.