LinuxCommandLibrary

autorandr

Automatically configure display setup based on connected monitors

TLDR

Save the current screen layout

$ autorandr [[-s|--save]] [profile_name]
copy

Show the saved profiles
$ autorandr
copy

Load the first detected profile
$ autorandr [[-c|--change]]
copy

Load a specific profile
$ autorandr [[-l|--load]] [profile_name]
copy

Set the default profile
$ autorandr [[-d|--default]] [profile_name]
copy

SYNOPSIS

autorandr [options] [profilename]

PARAMETERS

--save
    Save current display setup as named profile

--load
    Load specified profile, matching or forcing

--change
    Detect display changes and auto-load matching profile

--batch
    Skip confirmation prompts in interactive mode

--force
    Load profile even if hardware doesn't match

--default
    Set fallback profile for unknown configurations

--list-profiles
    List all saved profiles

--current-profile
    Print name of currently loaded profile

--update
    Update existing profile with current setup

--delete
    Remove a saved profile

-c, --config
    Use alternative config directory

--version
    Display version information

--help
    Show usage summary

DESCRIPTION

Autorandr simplifies managing display configurations on Linux systems using X11. It automatically detects connected monitors via EDID identifiers and applies the appropriate saved setup using xrandr. Users create named profiles for different scenarios, such as laptop-only (mobile), external monitor, or multi-monitor setups.

Key features include profile auto-detection on hotplug events, customizable match predicates (EDID hash, connector names), and hooks for post-configuration scripts. It supports gamma correction, DPI scaling hints, and fallback profiles. Ideal for users switching between docks, projectors, or home/office displays without manual xrandr commands.

Configuration resides in ~/.config/autorandr/, storing JSON profiles with xrandr parameters. Integrate with desktop environments or login managers for seamless sessions. Note: primarily for X11; Wayland support is experimental or absent.

CAVEATS

X11-only; no native Wayland support. Requires xrandr and EDID access. May conflict with DE display managers. Profiles hardware-specific; mismatches need --force.

HOOKS

Supports pre-switch, post-switch scripts in profile dirs for custom actions like xsetwacom or audio routing.

MATCHERS

Customizable via ~/.config/autorandr.d/: EDID hash (default), primary, connector, or scripts for detection logic.

HISTORY

Originated as bash script by Philipp Gesang (2012) for personal use. Rewritten in Python (2015) for better maintainability. Actively developed on GitHub; v1.14+ adds JSON profiles, hooks. Widely used in Arch/Manjaro AUR, Debian repos.

SEE ALSO

xrandr(1), arandr(1), randr(7)

Copied to clipboard