Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andrebocchini authored Apr 29, 2024
1 parent 979f8a8 commit f8c135b
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,28 @@

A command line tool to change the display resolution and HDR state of computers running Windows.

## Usage Examples
# Usage

```0 errors, 0 warnings, 0 informations
usage: ResolutionSwitcher --version | --monitors | --monitor <ID> | --width <width> --height <height> --refresh <refresh> | hdr <true/false>
Command line tool to change Windows display settings
options:
-h, --help show this help message and exit
--monitors List all active monitors
--monitor MONITOR List all available modes for a monitor (e.g. \\.\DISPLAY1)
--version show program's version number and exit
--width WIDTH The width of the new display mode (e.g. 1920)
--height HEIGHT The height of the new display mode (e.g. 1080)
--refresh REFRESH The refresh rate of the new display mode (e.g. 144)
--hdr <true|false> Enable/Disable HDR on the monitor
```

# Examples

List all available devices on the system

Expand Down Expand Up @@ -46,27 +67,27 @@ Display available help information
ResolutionSwitcher --help
```

## Sunshine "Do" and and "Undo" Commands
# Sunshine "Do" and and "Undo" Commands

The tool is useful for scenarios where you need to programmatically change the resolution of a display, for example,
during "do" and "undo" commands run as part of a [Moonlight](https://moonlight-stream.org/) session via [Sunshine](https://github.com/LizardByte/Sunshine).

These examples assume the application is installed at `C:\Program Files\ResolutionSwitcher\ResolutionSwitcher.exe`.

### Do Commands
## Do Commands

```shell
cmd /C "C:\Program Files\ResolutionSwitcher\ResolutionSwitcher.exe" --width %SUNSHINE_CLIENT_WIDTH% --height %SUNSHINE_CLIENT_HEIGHT% --refresh %SUNSHINE_CLIENT_FPS% --hdr %SUNSHINE_CLIENT_HDR%
```

### Undo Commands
## Undo Commands

```shell
cmd /C "C:\Program Files\ResolutionSwitcher\ResolutionSwitcher.exe" --width 3840 --height 2160 --refresh 144 --hdr false
```

## Building
# Building

The tool is written in [Python](https://www.python.org/) and uses the [ctypes](https://docs.python.org/3/library/ctypes.html) library to interact with the Windows API.

For distribution, the Python script is compiled into an executable using [`pyinstaller`](https://www.pyinstaller.org/).
For distribution, the Python script is compiled into an executable using [`pyinstaller`](https://www.pyinstaller.org/).

0 comments on commit f8c135b

Please sign in to comment.