• Stars
    star
    197
  • Rank 197,722 (Top 4 %)
  • Language
    Python
  • License
    Other
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fetch location and size of physical screens.

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

More Repositories

1

szurubooru

Image board engine, Danbooru-style.
Python
674
star
2

docstring_parser

Parse Python docstrings in various flavors.
Python
210
star
3

malgraph4

MALgraph: statistics service for MyAnimeList.net users.
PHP
158
star
4

pq-cli

Progress Quest: the CLI edition
Python
132
star
5

drill

A CLI program for learning things through spaced repetition. 🐶
Python
94
star
6

shot

Make screenshots from CLI.
C
90
star
7

CRC-manipulator

Change CRC checksums of your files.
C++
87
star
8

ida-images

Image preview plugin for IDA disassembler.
Python
56
star
9

10ff

Typing tests in CLI
Python
51
star
10

Tomb1Main

Open source re-implementation of Tomb Raider 1 (1996), along with additional enhancements and bugfixes
C
51
star
11

urwid_readline

readline text edit for urwid
Python
27
star
12

pycrcmanip

Change CRC checksums of your files, in Python.
Python
18
star
13

fpl_reader

foobar2000 .fpl playlists reader.
Python
18
star
14

dotfiles

It's not life, it's GNU/life.
Python
15
star
15

vim-hexdec

Convert hexadecimal numbers to decimal and vice versa.
Vim Script
14
star
16

Tomb3Main

C
14
star
17

TRCustoms

A website dedicated to custom levels for classic Tomb Raider games.
TypeScript
8
star
18

ftpfs

FTP over FUSE with Python
Python
7
star
19

termi

Images in your terminal, again.
Python
7
star
20

hexvi

A hex editor inspired by Vim.
Python
6
star
21

tsujidou

Toolkit for translating Tsujidou-san no Jun'ai Road
C
6
star
22

pyindexer

Simple Python file indexer for web servers
Python
5
star
23

pyxdotool

python port of xdotool
Python
4
star
24

ALAS

An utility that lets you run Japanese games.
C#
3
star
25

mdsm

Send mails directly to your local maildir
Python
3
star
26

pyqtcolordialog

Drop-in replacement of QColorDialog for PyQt5
Python
2
star
27

brailleimg

Python
2
star
28

soladm

CLI Soldat Admin Client
Python
2
star
29

bk

Change desktop background in GNU/Linux and Windows from CLI, with fancy features.
Python
2
star
30

rr-

1
star
31

python_template

Python
1
star
32

aoc

Advent of Code solutions
Python
1
star