Skip to main content

This is a unifying wrapper around xrandr and swaymsg to control your monitors/outputs,

Project description

This is a unifying wrapper around xrandr and swaymsg to control your monitors/outputs, mainly intended for setups where only one or two monitors are enabled at the same time.

xrandr's syntax is too verbose for direct usage and too explicit to use it in an i3/sway config file. This script tries to make things easier.

Examples

  • crandr cycles through all connected monitors.
  • crandr toggle toggles between the internal monitor and an external monitor.
  • crandr extend left turns on another monitor and positions it left of the currently enabled monitor.
  • crandr mirror turns on another monitor and mirrors the displayed content. If the monitors have different resolutions the internal monitor is scaled to match the resolution of the external monitor. If you want another monitor to be scaled you can specify the monitor which should not be scaled with --original. (Sway does not support mirroring yet, see this issue.)
  • crandr scale .8 if everything is displayed too small and you want to make things bigger.
  • crandr rotate left rotates the content of the currently enabled monitor so that the top of the content is at the left edge of the monitor.
  • crandr reset external enables the external monitor with default rotation and scaling and turns off all other monitors (the internal monitor).
  • crandr list to list all connected monitors.

Help

For more information see

  • crandr --help
  • crandr cycle --help
  • crandr toggle --help
  • crandr extend --help
  • crandr mirror --help
  • crandr scale --help
  • crandr rotate --help
  • crandr reset --help
  • crandr list --help

Installation

$ pipx install crandr

Dependencies

  • Python >= 3.8
  • xrandr and RandR >= version 1.3 or swaymsg

Dependencies for running the tests:

Alternatives

  • arandr (for X) and wdisplays (for wayland) are graphical user interfaces to control monitors.
  • autorandr (for X) and kanshi (for wayland) are programs which automatically enable output profiles when connecting and disconnecting monitors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crandr-1.4.0.tar.gz (24.4 kB view hashes)

Uploaded Source

Built Distribution

crandr-1.4.0-py3-none-any.whl (16.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page