#automatic #configuration #display

bin+lib quickrandr

A command line tool for saving and restoring xrandr display configurations

3 releases

Uses old Rust 2015

0.3.2 Nov 24, 2017
0.3.1 Nov 24, 2017
0.3.0 Nov 24, 2017

#309 in #automatic

MIT license

26KB
525 lines

quickrandr

A command line tool for saving and restoring xrandr display configurations.

It works by parsing xrandrs output, and generating commands for it.

NOTE: The tool currently completely ignores xrandrs VIRTUAL* outputs due to technical reasons.

CLI interface

USAGE:
    quickrandr [FLAGS] [OPTIONS]

FLAGS:
    -a, --auto            Automatically configures the displays according to the config file.
    -n, --create-empty    Creates an empty config file.
        --debug           Does verbose printing, and only simulates calls to xrandr.
    -h, --help            Prints help information
    -i, --info            Prints the contents of the config file and the current connected hardware in an abbreviated
                          form.
    -s, --save            Stores the current display configuration to the config file for a later automatic display
                          configuration.
    -V, --version         Prints version information

OPTIONS:
    -c, --config <FILE>                Sets a custom config file. If not given, it stores it in the users config file
                                       directory.
    -d, --default-profile <PROFILE>    Selects a profile to apply in case --auto does not recognize the current system
                                       config.
    -p, --profile <PROFILE>            Applies the given profile.

Example config file

  • The entries under autoprofiles are automatically generated by the --save option, and represent the database of all known display configurations.
  • The entries under profiles are optional, user-specified display configurations, that can be used either as a fallback for the automatic configuration, or for forcefully applying a different display configuration regardless of connected displays.
{
    "autoprofiles": [
        {
            "LVDS1": {
                "edid": "00ffffffffffff0030e435030000000000150103801f1178ead1059558578f2920505400000001010101010101010101010101010101121b5668500012302020350036ae10000019000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503134305748322d544c463100d5",
                "geometry": {
                    "width": 1366,
                    "height": 768,
                    "x_offset": 0,
                    "y_offset": 0,
                    "orientation": "Normal",
                    "is_primary": true
                }
            }
        },
        {
            "LVDS1": {
                "edid": "00ffffffffffff0030e435030000000000150103801f1178ead1059558578f2920505400000001010101010101010101010101010101121b5668500012302020350036ae10000019000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503134305748322d544c463100d5",
                "geometry": {
                    "width": 1366,
                    "height": 768,
                    "x_offset": 0,
                    "y_offset": 0,
                    "orientation": "Normal",
                    "is_primary": true
                }
            },
            "HDMI1": {
                "edid": "00ffffffffffff001ab3e807a89301002715010380331d782afe25a85337ae24115054a54b00a940b300950081008180010101010101023a801871382d40582c9600fd1e11000018000000fd00314c0f5211000a202020202020000000fc00503233542d36204950530a2020000000ff00595633513130333333360a2020006f",
                "geometry": {
                    "width": 1920,
                    "height": 1080,
                    "x_offset": 1366,
                    "y_offset": 0,
                    "orientation": "Normal",
                    "is_primary": false
                }
            }
        }
    ],
    "profiles": {
        "default": {
            "outputs": {
                "LVDS1": "--auto --primary"
            },
            "other_outputs": "--auto --right-of LVDS1"
        },
        "only-lvds": {
            "outputs": {
                "LVDS1": "--auto --primary"
            },
            "other_outputs": "--off"
        }
    }
}

Dependencies

~2.1–3.5MB
~59K SLoC