Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/debakarr/pymultimonitor
This module can be used to interact with Windows display
https://github.com/debakarr/pymultimonitor
Last synced: 2 days ago
JSON representation
This module can be used to interact with Windows display
- Host: GitHub
- URL: https://github.com/debakarr/pymultimonitor
- Owner: debakarr
- License: gpl-3.0
- Created: 2021-11-07T17:22:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-14T12:58:05.000Z (about 3 years ago)
- Last Synced: 2024-10-13T21:51:00.413Z (about 1 month ago)
- Language: Python
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyMultiMonitor
This module can be used to interact with Windows Display. Currently, it supports:
- Getting and setting current display topology (i.e. CLONE, EXTERNAL, INTERNAL, EXTENDED)
- Getting display name
- Getting and setting current display brightness## Example
### Getting current display topology
```python
>>> from pymultimonitor.core.DisplayTopology import DisplayTopology
>>> from pymultimonitor.cinterface.constants import DisplayConfigTopology
>>> dt = DisplayTopology()
>>> dt.get_display_topology()
< DisplayConfigTopology.DISPLAYCONFIG_TOPOLOGY_EXTEND: 4 >
>>> dt.get_display_topology() == DisplayConfigTopology.DISPLAYCONFIG_TOPOLOGY_EXTEND
True
```### Setting display topology
```python
>>> from pymultimonitor.core.DisplayTopology import DisplayTopology
>>> from pymultimonitor.cinterface.constants import DisplayConfigTopology
>>> dt = DisplayTopology()
>>> dt.set_topology_extend()
>>> dt.get_display_topology() == DisplayConfigTopology.DISPLAYCONFIG_TOPOLOGY_EXTEND
True
>>> dt.set_topology_external()
>>> dt.get_display_topology() == DisplayConfigTopology.DISPLAYCONFIG_TOPOLOGY_EXTERNAL
True
```### Getting current display device friendly name
```python
>>> from pymultimonitor.core.DisplayInfo import DisplayInfo
>>> di = DisplayInfo()
>>> di.get_display_names()
{'\\\\.\\DISPLAY1': 'LG ULTRAWIDE'}
```### Getting and setting current display brightness for a particular monitor
```python
>>> from pymultimonitor.core.DisplayMonitors import DisplayMonitors
>>> dm = DisplayMonitors()
>>> physical_monitors = dm.get_physical_monitor_handles()
>>> physical_monitors
[PhysicalMonitor(hPhysicalMonitor=1, szPhysicalMonitorDescription='Generic PnP Monitor')]
>>> from pymultimonitor.core.DisplayBrightness import DisplayBrightness
>>> db = DisplayBrightness()
>>> db.get_display_brightness_for_monitor(physical_monitors[0])
Brightness(minimum=0, current=20, maximum=100)
>>> db.set_display_brightness_for_monitor(physical_monitors[0], 50)
```