Fetch location and size of physical screens.
Project Links
Meta
Author: Marcin Kurczewski
Requires Python: >=3.6.2,<4.0.0
Classifiers
Development Status
- 4 - Beta
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Natural Language
- English
Operating System
- MacOS :: MacOS X
- Microsoft :: Windows
- POSIX :: Linux
Programming Language
- Python :: 3
- Python :: 3.10
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
Topic
- Desktop Environment
- System :: Operating System
Typing
- Typed
screeninfo
Fetch location and size of physical screens.
Supported environments
- MS Windows
- MS Windows: Cygwin
- GNU/Linux: X11 (through Xinerama)
- GNU/Linux: DRM (experimental)
- OSX: (through AppKit)
I don't plan on testing OSX or other environments myself. For this reason, I strongly encourage pull requests.
Installation
pip install screeninfo
Usage
from screeninfo import get_monitors
for m in get_monitors():
print(str(m))
Output:
Monitor(x=3840, y=0, width=3840, height=2160, width_mm=1420, height_mm=800, name='HDMI-0', is_primary=False)
Monitor(x=0, y=0, width=3840, height=2160, width_mm=708, height_mm=399, name='DP-0', is_primary=True)
Forcing environment
In some cases (emulating X server on Cygwin etc.) you might want to specify the
driver directly. You can do so by passing extra parameter to get_monitors()
like this:
from screeninfo import get_monitors, Enumerator
for m in get_monitors(Enumerator.OSX):
print(str(m))
Available drivers: windows, cygwin, x11, osx.
Contributing
git clone https://github.com/rr-/screeninfo.git # clone this repo
cd screeninfo
poetry install # to install the local venv
poetry run pre-commit install # to setup pre-commit hooks
poetry shell # to enter the venv
This project uses poetry for packaging, install instructions at poetry#installation
0.8.1
Sep 09, 2022
0.8
Dec 04, 2021
0.7
Aug 03, 2021
0.6.7
Dec 27, 2020
0.6.6
Oct 23, 2020
0.6.5
Apr 15, 2020
0.6.4
Apr 15, 2020
0.6.3
Apr 03, 2020
0.6.2
Apr 02, 2020
0.6.1
Nov 26, 2019
0.6
Nov 26, 2019
0.5
Nov 05, 2019
0.4.2
Nov 05, 2019
0.4.1
Sep 11, 2019
0.4
Jul 28, 2019
0.3.1
Feb 09, 2019
0.3
Apr 12, 2017
0.2.2
Feb 17, 2017
0.2.1
Jul 02, 2015
0.2
Jul 01, 2015
0.1
Jul 01, 2015