https://github.com/spyoungtech/ahk-wmutil
Python ahk extension for working with monitors
https://github.com/spyoungtech/ahk-wmutil
Last synced: 2 months ago
JSON representation
Python ahk extension for working with monitors
- Host: GitHub
- URL: https://github.com/spyoungtech/ahk-wmutil
- Owner: spyoungtech
- License: mit
- Created: 2024-07-09T22:37:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T23:25:46.000Z (almost 2 years ago)
- Last Synced: 2025-11-28T01:47:04.247Z (7 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ahk-wmutil
This is an extension package intended to be used with the Python [ahk](https://github.com/spyoungtech/ahk) package.
It adds functionality provided by the [`wmutil`](https://github.com/spyoungtech/wmutil) package into a convenient
ahk extension.
## Installation
```
pip install ahk-wmutil
```
## Usage
```python
from ahk import AHK
import wmutil
from ahk_wmutil import wmutil_extension
ahk = AHK(extensions=[wmutil_extension])
win = ahk.active_window
primary_monitor = wmutil.get_primary_monitor()
# move a window to a given monitor
win.move_to_monitor(primary_monitor)
# Get the monitor the window is using
mon = win.get_monitor()
assert mon == primary_monitor # True
# Get the monitor that the mouse cursor is on
mon = ahk.monitor_from_mouse_position()
```
Possible future work:
- [ ] A customized `Monitor` class that provides additional functionality, like listing all windows on a monitor
- [ ] Easy positioning of windows within a monitor (e.g., split left/right, quadrants, etc.)