From 26c48240471898c87f9b67fef66297e2e5a4c060 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 26 Mar 2024 08:12:55 +0400 Subject: wiki: Input and more Overview --- wiki/Configuration:-Input.md | 87 ++++++++++++++++++++++++++++++++++++++++- wiki/Configuration:-Overview.md | 76 +++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 1 deletion(-) diff --git a/wiki/Configuration:-Input.md b/wiki/Configuration:-Input.md index a88f830d..48bb3f68 100644 --- a/wiki/Configuration:-Input.md +++ b/wiki/Configuration:-Input.md @@ -2,6 +2,10 @@ In this section you can configure input devices like keyboard and mouse, and some input-related options. +There's a section for each device type: `keyboard`, `touchpad`, `mouse`, `trackpoint`, `tablet`, `touch`. +Settings in those sections will apply to every device of that type. +Currently, there's no way to configure specific devices individually (but that is planned). + All settings at a glance: ``` @@ -106,4 +110,85 @@ input { } ``` -### TBD +### Pointing Devices + +Most settings for the pointing devices are passed directly to libinput. +Other Wayland compositors also use libinput, so it's likely you will find the same settings there. +For flags like `tap`, omit them or comment them out to disable the setting. + +A few settings are common between `touchpad`, `mouse` and `trackpoint`: + +- `natural-scroll`: if set, inverts the scrolling direction. +- `accel-speed`: pointer acceleration speed, valid values are from `-1.0` to `1.0` where the default is `0.0`. +- `accel-profile`: can be `adaptive` (the default) or `flat` (disables pointer acceleration). + +Settings specific to `touchpad`s: + +- `tap`: tap-to-click. +- `dwt`: disable-when-typing. +- `dwtp`: disable-when-trackpointing. +- `tap-button-map`: can be `left-right-middle` or `left-middle-right`, controls which button corresponds to a two-finger tap and a three-finger tap. +- `click-method`: can be `button-areas` or `clickfinger`, changes the [click method](https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html). + +Tablets and touchscreens are absolute pointing devices that can be mapped to a specific output like so: + +``` +input { + tablet { + map-to-output "eDP-1" + } + + touch { + map-to-output "eDP-1" + } +} +``` + +Valid output names are the same as the ones used for output configuration. + +### General Settings + +These settings are not specific to a particular input device. + +#### `disable-power-key-handling` + +By default, niri will take over the power button to make it sleep instead of power off. +Set this if you would like to configure the power button elsewhere (i.e. `logind.conf`). + +``` +input { + disable-power-key-handling +} +``` + +#### `warp-mouse-to-focus` + +Makes the mouse warp to newly focused windows. + +X and Y coordinates are computed separately, i.e. if moving the mouse only horizontally is enough to put it inside the newly focused window, then it will move only horizontally. + +``` +input { + warp-mouse-to-focus +} +``` + +#### `focus-follows-mouse` + +Focuses windows and outputs automatically when moving the mouse over them. + +``` +input { + focus-follows-mouse +} +``` + +#### `workspace-auto-back-and-forth` + +If enabled, switching to the same workspace by index twice will switch back to the previous workspace. + +``` +input { + workspace-auto-back-and-forth +} +``` diff --git a/wiki/Configuration:-Overview.md b/wiki/Configuration:-Overview.md index ea8f6561..15acb2ef 100644 --- a/wiki/Configuration:-Overview.md +++ b/wiki/Configuration:-Overview.md @@ -15,6 +15,9 @@ To use a different config file path, pass it in the `--config` or `-c` argument ### Syntax The config is written in [KDL]. + +#### Comments + Lines starting with `//` are comments; they are ignored. Also, you can put `/-` in front of a node to comment out the entire node: @@ -26,6 +29,79 @@ Also, you can put `/-` in front of a node to comment out the entire node: } ``` +#### Flags + +Toggle options in niri are commonly represented as flags. +Writing out the flag enables it, and omitting it or commenting it out disables it. +For example: + +``` +// "Focus follows mouse" is enabled. +input { + focus-follows-mouse + + // Other settings... +} +``` + +``` +// "Focus follows mouse" is disabled. +input { + // Other settings... +} +``` + +#### Sections + +Most sections cannot be repeated. For example: + +``` +// This is valid: every section appears once. +input { + keyboard { + // ... + } + + touchpad { + // ... + } +} +``` + +``` +// This is NOT valid: input section appears twice. +input { + keyboard { + // ... + } +} + +input { + touchpad { + // ... + } +} +``` + +Exceptions are for example sections that configure different devices by name: + +``` +output "eDP-1" { + // ... +} + +// This is valid: this section configures a different output. +output "HDMI-A-1" { + // ... +} + +// This is NOT valid: "eDP-1" already appeared above. +// It will either throw a config parsing error, or otherwise not work. +output "eDP-1" { + // ... +} +``` + ### Defaults Omitting most of the sections of the config file will leave you with the default values for that section. -- cgit