Pyrandr

A small python xrandr application. It is written as a wrapper around xrandr command line tool.
Alternatives To Pyrandr
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
I36,019
5 months ago14bsd-3-clauseC
A fork of the i3 window manager with gaps and some other features. :warning: i3-gaps has been merged into i3.
X11docker4,642
a month ago10mitShell
Run GUI applications and desktops in docker and podman containers. Focus on security.
Picom3,296
7 days ago278otherC
A lightweight compositor for X11
Warpd2,017
2 months ago20mitC
A modal keyboard-driven virtual pointer
Sddm1,454
2 days ago480gpl-2.0C++
QML based X11 and Wayland display manager
Hypr721
2 months ago17bsd-3-clauseC++
Hypr is a tiling window manager written in modern C++.
Egpu Switcher455
5 days ago5September 11, 20228gpl-3.0Go
🖥🐧 Setup script for eGPUs in Linux (X.Org)
Wallutils335
24 days ago4bsd-3-clauseGo
:city_sunset: Utilities for handling monitors, resolutions, wallpapers and timed wallpapers
Libagar314
3 days ago9bsd-2-clauseC
Cross-Platform GUI Toolkit (stable)
Xf86 Input Wacom294
3 months ago4C
X.Org driver for Wacom devices
Alternatives To Pyrandr
Select To Compare


Alternative Project Comparisons
Readme

pyrandr

A small python xrandr library. It is written as a wrapper around xrandr command line tool.

pyrandrcli

usage: pyrandrcli.py [-h] [--output OUTPUT] [--mode MODE | --auto] [--off]
                     [--dry-run] [--primary]
                     [--rotate {normal,left,right,inverted}]
                     [--left-of OUTPUT | --right-of OUTPUT | --above OUTPUT | --below OUTPUT | --same-as OUTPUT]

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT       Selects an output to reconfigure.
  --mode MODE           Sets a resolution for the selected output
  --auto                Selects default resolution for the output.
  --off                 Disables the output
  --dry-run             Prints the generated cmdline
  --primary             Set the output as primary
  --rotate {normal,left,right,inverted}
                        Rotate the output content in the specified direction

Position the output:
  Use one of these options to position the output relative to the position
  of another output.

  --left-of OUTPUT
  --right-of OUTPUT
  --above OUTPUT
  --below OUTPUT
  --same-as OUTPUT

Usage

Have a look at the source of examples/pyrandrcli to learn how to use it. But it basically boils down to this;


import pyrandr as randr

# get connected screens
cs = randr.connected_screens()[0]

# available resolutions as a tuple in the form of (width, height)
reslist = cs.available_resolutions()

cs.set_resolution((1024, 768))
cs.set_as_primary(True)

# rotate output contents by 90 degrees in the clockwise direction
cs.rotate(RotateDirection.Right)

cs.apply_settings()

Credits

Davydov Denis

Popular X11 Projects
Popular Xorg Projects
Popular User Interface Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
X11
Xorg