Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

programs.autorandr.enable

Whether to enable Autorandr.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.autorandr.package

The autorandr package to use.

Type: null or package

Default:

pkgs.autorandr

Declared by:

programs.autorandr.hooks

Global hook scripts

Type: submodule

Default:

{ }

Example:

{
  postswitch = {
    "notify-i3" = "${pkgs.i3}/bin/i3-msg restart";
    "change-background" = readFile ./change-background.sh;
    "change-dpi" = ''
      case "$AUTORANDR_CURRENT_PROFILE" in
        default)
          DPI=120
          ;;
        home)
          DPI=192
          ;;
        work)
          DPI=144
          ;;
        *)
          echo "Unknown profile: $AUTORANDR_CURRENT_PROFILE"
          exit 1
      esac

      echo "Xft.dpi: $DPI" | ${lib.getExe pkgs.xrdb} -merge
    ''
  };
}

Declared by:

programs.autorandr.hooks.postswitch

Postswitch hook executed after mode switch.

Type: attribute set of strings concatenated with “\n”

Default:

{ }

Declared by:

programs.autorandr.hooks.predetect

Predetect hook executed before autorandr attempts to run xrandr.

Type: attribute set of strings concatenated with “\n”

Default:

{ }

Declared by:

programs.autorandr.hooks.preswitch

Preswitch hook executed before mode switch.

Type: attribute set of strings concatenated with “\n”

Default:

{ }

Declared by:

programs.autorandr.profiles

Autorandr profiles specification.

Type: attribute set of (submodule)

Default:

{ }

Example:

{
  "work" = {
    fingerprint = {
      eDP1 = "<EDID>";
      DP1 = "<EDID>";
    };
    config = {
      eDP1.enable = false;
      DP1 = {
        enable = true;
        crtc = 0;
        primary = true;
        position = "0x0";
        mode = "3840x2160";
        gamma = "1.0:0.909:0.833";
        rate = "60.00";
        rotate = "left";
      };
    };
    hooks.postswitch = readFile ./work-postswitch.sh;
  };
}

Declared by:

programs.autorandr.profiles.<name>.config

Per output profile configuration.

Type: attribute set of (submodule)

Default:

{ }

Declared by:

programs.autorandr.profiles.<name>.config.<name>.enable

Whether to enable the output.

Type: boolean

Default:

true

Declared by:

programs.autorandr.profiles.<name>.config.<name>.crtc

Output video display controller.

Type: null or (unsigned integer, meaning >=0)

Default:

null

Example:

0

Declared by:

programs.autorandr.profiles.<name>.config.<name>.dpi

Output DPI configuration.

Type: null or (positive integer, meaning >0)

Default:

null

Example:

96

Declared by:

programs.autorandr.profiles.<name>.config.<name>.extraConfig

Extra lines to append to this profile’s config.

Type: strings concatenated with “\n”

Default:

""

Example:

''
  x-prop-non_desktop 0
  some-key some-value
''

Declared by:

programs.autorandr.profiles.<name>.config.<name>.filter

Interpolation method to be used for scaling the output.

Type: null or one of “bilinear”, “nearest”

Default:

null

Example:

"nearest"

Declared by:

programs.autorandr.profiles.<name>.config.<name>.gamma

Output gamma configuration.

Type: string

Default:

""

Example:

"1.0:0.909:0.833"

Declared by:

programs.autorandr.profiles.<name>.config.<name>.mode

Output resolution.

Type: string

Default:

""

Example:

"3840x2160"

Declared by:

programs.autorandr.profiles.<name>.config.<name>.position

Output position

Type: string

Default:

""

Example:

"5760x0"

Declared by:

programs.autorandr.profiles.<name>.config.<name>.primary

Whether output should be marked as primary

Type: boolean

Default:

false

Declared by:

programs.autorandr.profiles.<name>.config.<name>.rate

Output framerate.

Type: string

Default:

""

Example:

"60.00"

Declared by:

programs.autorandr.profiles.<name>.config.<name>.rotate

Output rotate configuration.

Type: null or one of “normal”, “left”, “right”, “inverted”

Default:

null

Example:

"left"

Declared by:

programs.autorandr.profiles.<name>.config.<name>.scale

Output scale configuration.

Either configure by pixels or a scaling factor. When using pixel method the xrandr(1) option --scale-from will be used; when using factor method the option --scale will be used.

This option is a shortcut version of the transform option and they are mutually exclusive.

Type: null or (submodule)

Default:

null

Example:

{
  x = 1.25;
  y = 1.25;
}

Declared by:

programs.autorandr.profiles.<name>.config.<name>.scale.method

Output scaling method.

Type: one of “factor”, “pixel”

Default:

"factor"

Example:

"pixel"

Declared by:

programs.autorandr.profiles.<name>.config.<name>.scale.x

Horizontal scaling factor/pixels.

Type: floating point number or (positive integer, meaning >0)

Declared by:

programs.autorandr.profiles.<name>.config.<name>.scale.y

Vertical scaling factor/pixels.

Type: floating point number or (positive integer, meaning >0)

Declared by:

programs.autorandr.profiles.<name>.config.<name>.transform

Refer to xrandr(1) for the documentation of the transform matrix.

Type: null or (3×3 matrix of floating point numbers)

Default:

null

Example:

[
  [
    0.6
    0.0
    0.0
  ]
  [
    0.0
    0.6
    0.0
  ]
  [
    0.0
    0.0
    1.0
  ]
]

Declared by:

programs.autorandr.profiles.<name>.fingerprint

Output name to EDID mapping. Use autorandr --fingerprint to get current setup values.

Type: attribute set of string

Default:

{ }

Declared by:

programs.autorandr.profiles.<name>.hooks

Profile hook scripts.

Type: submodule

Default:

{ }

Declared by:

programs.autorandr.profiles.<name>.hooks.postswitch

Postswitch hook executed after mode switch.

Type: strings concatenated with “\n”

Default:

""

Declared by:

programs.autorandr.profiles.<name>.hooks.predetect

Predetect hook executed before autorandr attempts to run xrandr.

Type: strings concatenated with “\n”

Default:

""

Declared by:

programs.autorandr.profiles.<name>.hooks.preswitch

Preswitch hook executed before mode switch.

Type: strings concatenated with “\n”

Default:

""

Declared by: