diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 749f7ba..84ac7ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Package Application - uses: JackMcKew/pyinstaller-action-windows@python3-10-pyinstaller-5-3 + uses: JackMcKew/pyinstaller-action-windows@main with: path: src - uses: actions/upload-artifact@v2 diff --git a/src/main.py b/src/main.py index c53816b..13c33fa 100644 --- a/src/main.py +++ b/src/main.py @@ -5,7 +5,7 @@ # Functions for getting display devices and settings from win32api import EnumDisplayDevices from win32api import EnumDisplaySettings -from win32api import ChangeDisplaySettings +from win32api import ChangeDisplaySettingsEx # Display device state flags from win32con import DISPLAY_DEVICE_ATTACHED_TO_DESKTOP @@ -32,7 +32,7 @@ from pywintypes import DEVMODEWType # Application metadata -VERSION: str = "v2.0.0" +VERSION: str = "v2.0.1" NAME: str = "ResolutionSwitcher" # Terminal colors @@ -154,11 +154,11 @@ def print_device_info(device: DisplayDevice, detailed: bool = False): pass -def set_device_mode(device_mode: DEVMODEWType) -> int: +def set_device_mode(device_identifier: str, device_mode: DEVMODEWType) -> int: if device_mode is None: raise ValueError("Display settings cannot be empty") - return ChangeDisplaySettings(device_mode, 0) + return ChangeDisplaySettingsEx(device_identifier, device_mode, 0) def print_human_readable_mode_change_result(result: int): @@ -252,7 +252,7 @@ def print_error(error: str): else: print_message(f'Attempting to change primary display settings to: {str(new_mode)}') - device_mode_change_result: int = set_device_mode(new_mode_as_devmodew_type) + device_mode_change_result: int = set_device_mode(args.device, new_mode_as_devmodew_type) print_human_readable_mode_change_result(device_mode_change_result) if device_mode_change_result != DISP_CHANGE_SUCCESSFUL: diff --git a/src/requirements b/src/requirements new file mode 100644 index 0000000..d0c31db Binary files /dev/null and b/src/requirements differ