• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created about 6 years ago
  • Updated 11 months ago

Reviews

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

Repository Details

💻➡️ Extend a HIDPI screen to a normal DPI external display

xrandr-extend

image python versions

Extend a HIDPI screen to a normal DPI external display. This command line tool implements various solutions described in the HIDPI Arch Linux wiki page.

  • Free software: GNU General Public License v3

asciicast

Installation

pip install xrandr-extend --user

or alternatively use pipx:

pipx install xrandr-extend

Configuration

python -m xrandr_extend.config

This creates a file ~/.config/xrandr-extend.cfg which looks like this:

[provider:modesetting]
primary = eDP-1
hdmi = HDMI-1
vga = DP-1

[provider:intel]
primary = eDP1
hdmi = HDMI1
vga = DP1

[resolutions]
primary = 3200, 1800
hdmi = 1920, 1080
vga = 1920, 1200

# [scaling]
# primary = 1.0
# hdmi = 2.0
# vga = 2.0

# [rotation]
# hdmi = left
# vga = right

The first few sections have the name in the format [provider:display_driver]. Run xrandr --listproviders to find what your system has. The values in this section should be given as profile = monitor_name, as in the output of xrandr --listmonitors command. You may even remove existing sections and add more sections for your display driver.

Each line in the [resolutions] section signifies a resolution profile in the format profile = [width_in_pixels, height_in_pixels]. The profile primary should contain the resolution of your built-in display. You may edit or remove the remaining values hdmi and vga.

The [scaling] section contains the scale factors, which if uncommented, overrides the scale factor computed from the resolutions.

The [rotation] section specifies the directions to rotate the output contents similarly to xrandr --rotate.

Quick reference

usage: xrandr-extend [-h] [-p PRI_RES PRI_RES] [-e EXT_RES EXT_RES]
                     [-x EXT_SCALE] [-m] [-n] [-o] [-s] [-d]
                     profile

Extend a HIDPI screen to a normal DPI external display

positional arguments:
  profile               Use preset external resolution profiles (available:
                        ['hdmi', 'vga']).

optional arguments:
  -h, --help            show this help message and exit
  -p PRI_RES PRI_RES, --pri-res PRI_RES PRI_RES
                        Modify preset resolution of primary display (default: 1920, 1080)
  -e EXT_RES EXT_RES, --ext-res EXT_RES EXT_RES
                        Modify preset resolution of external display (default based on
                        profile)
  -x EXT_SCALE, --ext-scale EXT_SCALE
                        Sets the scale factor of external display (DPI of primary display /
                        DPI of external display), overriding scale factor estimation from
                        resolutions
  -r {normal,left,right,inverted,same}, --rotate {normal,left,right,inverted,same}
                        Rotation can be one of the above strings. This causes the output
                        contents of external display to be rotated in the specified direction.
                        For example 'right' specifies a clockwise rotation, 'normal' orients
                        it horizontally and 'same'preserves the current orientation.
  -m, --mirror          Mirror the external display
  -n, --pan             Pan the position of external display
  -o, --only            Extend and use only external display
  -s, --pos             Set the position of external display explicitly
  -d, --dry-run         Preview command without executing it

Examples
--------
# Built-in options or user-configured options are used when only the display
# profile is mentioned

$ xrandr-extend --dry-run vga
$ xrandr-extend vga
$ xrandr-extend hdmi

# Other options to extend the display

$ xrandr-extend --pan hdmi
$ xrandr-extend --only hdmi
$ xrandr-extend -e 1024 768 -n vga  # Pan with custom external resolution
$ xrandr-extend -x 2.0 hdmi         # Custom scale factor
$ xrandr-extend -r left hdmi        # Custom direction to rotate

Credits

This package was created with Cookiecutter and the ashwinvis/cookiecutter-pypackage project template.

More Repositories

1

caeroc

☴🖩 Compressible Aerodynamics Calculator for Python
Python
26
star
2

umatrix2ublock

Migrate rulesets from uMatrix to uBlock-Origin
Python
20
star
3

github-retro

Retrofit the repository interface prior to June 2020 GitHub update.
CSS
18
star
4

cython_capi

Where is __pyx_capi__?
Python
11
star
5

TomoKTH

Tomographic PIV code done as a part of a KTH course
Python
7
star
6

phd-thesis

🎓 Source code for my Ph.D. thesis made with 💗 using Pandoc + LaTeX
PostScript
6
star
7

mastodon-relax

A relaxed view for Mastodon's advanced interface.
CSS
5
star
8

myst-reader

MyST Reader is a Pelican plugin that processes Markdown content via MyST parser
Python
4
star
9

pyenv-virtualenv-migrate

Migrate all pyenv virtual environments from a Python compiler version to another
Shell
4
star
10

ashwinvis.github.io

Academic profile/blog website
HTML
3
star
11

sthlm-bostad-vis

Stockholm bostad visualizer : a Python based web scraper to make sense of Stockholm's infamous housing queues
Python
3
star
12

apt-local

📦 Simple package manager for local installations (without sudo) for Debian-based distros
Python
3
star
13

kdv-compact

Solving KdV equation with finite difference optimized compact scheme for first- and third-derivatives
PostScript
3
star
14

doctor-mastodon

Space-time(line) manipulation from the comfort your terminal
Python
2
star
15

awkupy

A simple Python interface for running AWK (development moved to Codeberg).
Python
2
star
16

userscripts

A repository of Greasemonkey scripts synced with Greasy Fork and OpenUserJS
JavaScript
2
star
17

Lumpy

UML diagrams for Python: object and class diagrams
Python
1
star
18

talks

Archive of all my talks
HTML
1
star
19

augieretal_jfm_2019_shallow_water

🌊 "Shallow water wave turbulence": source code and scripts
Jupyter Notebook
1
star
20

property-testing

Property based testing and friends
Python
1
star
21

assignments

Old school and college assignments
C++
1
star
22

experiments-with-cxx

C++1x and beyond
C++
1
star
23

experiments-with-haskell

A journal for the journey to enlightenment
Jupyter Notebook
1
star
24

beyond-100-test-cov

A.K.A. Why 100% test coverage is not good enough OR Typing + Unit tests
Python
1
star
25

jupyter-wordcloud

💬 Generate wordclouds from jupyter notebooks
Python
1
star
26

pelican-bluedrop

A responsive Pelican theme suitable to be used as an academic profile / blog
JavaScript
1
star
27

alarm-chroot

ArchLinuxARM chroot script for Raspberry Pi 2/3
Shell
1
star
28

spectral_energy_budget_sw1l

Notes in deriving the spectral energy budget for shallow water equations
Jupyter Notebook
1
star