Skip to content

A automatic display configuration switcher

License

Notifications You must be signed in to change notification settings

TheAngusMcFire/quickrandr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
        }
    }
}

About

A automatic display configuration switcher

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%