From 674c7a504bc368637f36141f14681077d27e6ef0 Mon Sep 17 00:00:00 2001 From: KnightBlue Date: Tue, 24 Jun 2025 16:00:04 +0100 Subject: [PATCH 1/2] Adding Resolution Swapping app --- PYTHON APPS/ResolutionSwapper/Readme.md | 21 +++++++++++++ .../ResolutionSwapper/ResolutionMulti.py | 30 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 PYTHON APPS/ResolutionSwapper/Readme.md create mode 100644 PYTHON APPS/ResolutionSwapper/ResolutionMulti.py diff --git a/PYTHON APPS/ResolutionSwapper/Readme.md b/PYTHON APPS/ResolutionSwapper/Readme.md new file mode 100644 index 00000000..ebd6eeb2 --- /dev/null +++ b/PYTHON APPS/ResolutionSwapper/Readme.md @@ -0,0 +1,21 @@ +# Resolution +This is a small application for switching monitor resolution without having to go into your computer settings. Very useful if you have an older system, and are having trouble running newer/more demanding games. + +# Prerequisites +pywintypes +win32con +win32api +time +Pyinstaller (optional, but recommended) + +# Usage +This app currently features 720p, 1080p and 1440p resolutions. If you wish to add more, add them in the same format as the other resolutions. The number is a string, so you could choose to set the input to letters if that is your preference. + +When run, the app will create a popup terminal for you to enter the resolution you want. It will first check if what you input is valid, then set your monitor's resolution based on the preset dimensions. + +# Export to exe + For ease of use, I'd recommend exporting this to an exe using pyinstaller. + Instructions for this can be found here - + ```https://pyinstaller.org/en/stable/usage.html``` +From there, create a shortcut to have it on your taskbar. To set the image, you can use any image you choose, but it will need to be in a .ico format. You can find converters to make these from other formats online. +That done, simply click on the icon, then enter your resolution in the terminal popup (only the width). diff --git a/PYTHON APPS/ResolutionSwapper/ResolutionMulti.py b/PYTHON APPS/ResolutionSwapper/ResolutionMulti.py new file mode 100644 index 00000000..ff38e433 --- /dev/null +++ b/PYTHON APPS/ResolutionSwapper/ResolutionMulti.py @@ -0,0 +1,30 @@ +import pywintypes +import win32con +import win32api +import time + + +devmode = pywintypes.DEVMODEType() +valid = 0 +while valid == 0: + heightinp = input('Set resolution: -- ') + if heightinp in ['720','1080','1440']: + valid += 1 + else: + print('Invalid resolution. Please try again') + time.sleep(2) + + +if heightinp == '720': + devmode.PelsWidth = 1280 + devmode.PelsHeight =720 +if heightinp == '1080': + devmode.PelsWidth = 1920 + devmode.PelsHeight =1080 +if heightinp == '1440': + devmode.PelsWidth = 2560 + devmode.PelsHeight = 1440 + +devmode.Fields = win32con.DM_PELSWIDTH | win32con.DM_PELSHEIGHT + +win32api.ChangeDisplaySettings(devmode, 0) From f6f1a7a278a851d67cf2e27bd33fcab42fa89587 Mon Sep 17 00:00:00 2001 From: KnightBlue Date: Tue, 24 Jun 2025 16:06:41 +0100 Subject: [PATCH 2/2] Added project to main Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8505b537..d6a6abe6 100644 --- a/README.md +++ b/README.md @@ -124,4 +124,4 @@ guide [HERE](https://github.com/larymak/Python-project-Scripts/blob/main/CONTRIB | 75 | [Quadratic Equation Solver](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Quadratic-Equation-Solver) | [Akinfenwa Ezekiel](https://github.com/Ezek-iel) | | 76 | [Internet Connectivity Monitor](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/InternetConnectivityMonitor) | [Prince Khunt](https://github.com/princekhunt) | | 76 | [E-commerce](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/E-commerce) | [Eter Nada](https://github.com/tarenjk24) | - +| 77 | [Resolution Swapper](https://github.com/larymak/Python-project-Scripts/tree/main/PYTHON%20APPS/ResolutionSwapper) | [KnightBlue](https://github.com/KnightBlue14) |