Skip to main content

screeninfo

Build

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

Metadata

Release files for screeninfo 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for screeninfo 0.8
File Size Uploaded
screeninfo-0.8.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for screeninfo 0.8
File Interpreter ABI Platform
screeninfo-0.8-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / screeninfo-0.8.tar.gz

Download URL screeninfo-0.8.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9501bf8b8458c7d1be4cb0ac9abddddfa80b932fb3f65bfcb54f5586434b1dc5
BLAKE2b-256 checksum
How to use checksums
88c6621d4fc5c9364cec5bd36b93e41683b55766f01adf71647f11985c017894
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.9 Linux/5.15.5-arch1-1

Release files / screeninfo-0.8-py3-none-any.whl

Download URL screeninfo-0.8-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dac455fbed79e82c481d59a00962f543e5a9bf3c2cc9f0e48e2714eb8d3cec23
BLAKE2b-256 checksum
How to use checksums
d0453542d25929d28a6d476e909b5285cb82ce999d36833303395b5011b2d22e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.9 Linux/5.15.5-arch1-1

Release history Release notifications | RSS feed

0.8.1

2 release files

This release

0.8 This release

2 release files

0.7

1 release file

0.6.7

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6

1 release file

0.5

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4

1 release file

0.3.1

1 release file

0.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page