autorandr - Man Page

automatically select a display configuration based on connected devices

Examples (TL;DR)

Synopsis

autorandr [OPTION] [PROFILE]

Description

This program automatically detects connected display hardware and then loads an appropriate X11 setup using xrandr. It also supports the use of display profiles for different hardware setups.

Autorandr also includes several virtual configurations including off, common, clone-largest, horizontal, and vertical. See the documentation for explanation of each.

Options

-h,  --help

Display help text and exit

-c,  --change

Automatically load the first detected profile

-d,  --default PROFILE

Make profile PROFILE the default profile. The default profile is used if no suitable profile can be identified. Else, the current configuration is kept.

-l,  --load PROFILE

Load profile PROFILE

-s,  --save PROFILE

Save the current setup to profile PROFILE

-r,  --remove PROFILE

Remove profile PROFILE

--batch

Run autorandr for all users with active X11 sessions

--current

List only the current (active) configuration(s)

--config

Dump the variable values of your current xrandr setup

--cycle

Cycle through all detected profiles

--debug

Enable verbose output

--detected

List only the detected (i.e. available) configuration(s)

--dry-run

Don't change anything, only print the xrandr commands

--fingerprint

Fingerprint the current hardware setup

--match-edid

Match displays based on edid instead of name

--ignore-lid

By default, closed lids are considered as disconnected if other outputs are detected. This flag disables this behaviour.

--force

Force loading or reloading of a profile

--list

List all profiles

--skip-options [OPTION] ...

Set a comma-separated list of xrandr arguments to skip both in change detection and profile application. See xrandr(1) for xrandr arguments.

--version

Show version information and exit

Files

Configuration files are searched for in the autorandr directory in the colon separated list of paths in $XDG_CONFIG_DIRS - or in /etc/xdg if that var is not set.  They are then looked for in ~/.autorandr and if that doesn't exist, in $XDG_CONFIG_HOME/autorandr or in ~/.config/autorandr if that var is unset.

In each of those directories it looks for directories with config and setup in them.  It is best to manage these files with the autorandr utility.

Default Options

You can store default values for any option in an INI-file located at ~/.config/autorandr/settings.ini. In a config section, you may place any default values in the form option-name=option-argument.

Hook Scripts

Three more scripts can be placed in the configuration directory:

postswitch

Executed after a mode switch has taken place. This can be used to notify window managers or other applications about the switch.

preswitch

Executed before a mode switch takes place.

postsave

Executed after a profile was stored or altered.

predetect

Executed before autorandr attempts to run xrandr.

These scripts must be executable and can be placed directly in the configuration directory, where they will always be executed, or in the profile subdirectories, where they will only be executed on changes regarding that specific profile.

Instead (or in addition) to these scripts, you can also place as many executable files as you like in subdirectories called script_name.d (e.g. postswitch.d).

Some of autorandr's state is exposed as environment variables prefixed with AUTORANDR_, such as: AUTORANDR_CURRENT_PROFILE, AUTORANDR_CURRENT_PROFILES, AUTORANDR_PROFILE_FOLDER, and AUTORANDR_MONITORS with the intention that they can be used within the hook scripts.

The one kink is that during preswitch, AUTORANDR_CURRENT_PROFILE is reporting the upcoming profile rather than the current one.

Author

Phillip Berndt <phillip.berndt@googlemail.com>
See https://github.com/phillipberndt/autorandr for a full list of contributors.

Reporting Bugs

Report issues upstream on GitHub:  https://github.com/phillipberndt/autorandr/issues
Please attach the output of xrandr --verbose to your bug report if appropriate.

See Also

For examples, advanced usage (including predefined per-profile & global hooks and wildcard EDID matching), and full documentation, see https://github.com/phillipberndt/autorandr.