Skip to content

Adding new app #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions PYTHON APPS/ResolutionSwapper/Readme.md
Original file line number Diff line number Diff line change
@@ -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).
30 changes: 30 additions & 0 deletions PYTHON APPS/ResolutionSwapper/ResolutionMulti.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |