wiki: Input and more Overview
Browse files at this commit26c48240471898c87f9b67fef66297e2e5a4c060Parent: 78dbb232 changed files +162 -1
wiki/Configuration:-Input.mdmodified+86 -1
| @@ -2,6 +2,10 @@ | ||
| 2 | 2 | |
| 3 | 3 | In this section you can configure input devices like keyboard and mouse, and some input-related options. |
| 4 | 4 | |
| 5 | +There's a section for each device type: `keyboard`, `touchpad`, `mouse`, `trackpoint`, `tablet`, `touch`. | |
| 6 | +Settings in those sections will apply to every device of that type. | |
| 7 | +Currently, there's no way to configure specific devices individually (but that is planned). | |
| 8 | + | |
| 5 | 9 | All settings at a glance: |
| 6 | 10 | |
| 7 | 11 | ``` |
| @@ -106,4 +110,85 @@ input { | ||
| 106 | 110 | } |
| 107 | 111 | ``` |
| 108 | 112 | |
| 109 | -### TBD | |
| 113 | +### Pointing Devices | |
| 114 | + | |
| 115 | +Most settings for the pointing devices are passed directly to libinput. | |
| 116 | +Other Wayland compositors also use libinput, so it's likely you will find the same settings there. | |
| 117 | +For flags like `tap`, omit them or comment them out to disable the setting. | |
| 118 | + | |
| 119 | +A few settings are common between `touchpad`, `mouse` and `trackpoint`: | |
| 120 | + | |
| 121 | +- `natural-scroll`: if set, inverts the scrolling direction. | |
| 122 | +- `accel-speed`: pointer acceleration speed, valid values are from `-1.0` to `1.0` where the default is `0.0`. | |
| 123 | +- `accel-profile`: can be `adaptive` (the default) or `flat` (disables pointer acceleration). | |
| 124 | + | |
| 125 | +Settings specific to `touchpad`s: | |
| 126 | + | |
| 127 | +- `tap`: tap-to-click. | |
| 128 | +- `dwt`: disable-when-typing. | |
| 129 | +- `dwtp`: disable-when-trackpointing. | |
| 130 | +- `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. | |
| 131 | +- `click-method`: can be `button-areas` or `clickfinger`, changes the [click method](https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html). | |
| 132 | + | |
| 133 | +Tablets and touchscreens are absolute pointing devices that can be mapped to a specific output like so: | |
| 134 | + | |
| 135 | +``` | |
| 136 | +input { | |
| 137 | + tablet { | |
| 138 | + map-to-output "eDP-1" | |
| 139 | + } | |
| 140 | + | |
| 141 | + touch { | |
| 142 | + map-to-output "eDP-1" | |
| 143 | + } | |
| 144 | +} | |
| 145 | +``` | |
| 146 | + | |
| 147 | +Valid output names are the same as the ones used for output configuration. | |
| 148 | + | |
| 149 | +### General Settings | |
| 150 | + | |
| 151 | +These settings are not specific to a particular input device. | |
| 152 | + | |
| 153 | +#### `disable-power-key-handling` | |
| 154 | + | |
| 155 | +By default, niri will take over the power button to make it sleep instead of power off. | |
| 156 | +Set this if you would like to configure the power button elsewhere (i.e. `logind.conf`). | |
| 157 | + | |
| 158 | +``` | |
| 159 | +input { | |
| 160 | + disable-power-key-handling | |
| 161 | +} | |
| 162 | +``` | |
| 163 | + | |
| 164 | +#### `warp-mouse-to-focus` | |
| 165 | + | |
| 166 | +Makes the mouse warp to newly focused windows. | |
| 167 | + | |
| 168 | +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. | |
| 169 | + | |
| 170 | +``` | |
| 171 | +input { | |
| 172 | + warp-mouse-to-focus | |
| 173 | +} | |
| 174 | +``` | |
| 175 | + | |
| 176 | +#### `focus-follows-mouse` | |
| 177 | + | |
| 178 | +Focuses windows and outputs automatically when moving the mouse over them. | |
| 179 | + | |
| 180 | +``` | |
| 181 | +input { | |
| 182 | + focus-follows-mouse | |
| 183 | +} | |
| 184 | +``` | |
| 185 | + | |
| 186 | +#### `workspace-auto-back-and-forth` | |
| 187 | + | |
| 188 | +If enabled, switching to the same workspace by index twice will switch back to the previous workspace. | |
| 189 | + | |
| 190 | +``` | |
| 191 | +input { | |
| 192 | + workspace-auto-back-and-forth | |
| 193 | +} | |
| 194 | +``` |
wiki/Configuration:-Overview.mdmodified+76 -0
| @@ -15,6 +15,9 @@ To use a different config file path, pass it in the `--config` or `-c` argument | ||
| 15 | 15 | ### Syntax |
| 16 | 16 | |
| 17 | 17 | The config is written in [KDL]. |
| 18 | + | |
| 19 | +#### Comments | |
| 20 | + | |
| 18 | 21 | Lines starting with `//` are comments; they are ignored. |
| 19 | 22 | |
| 20 | 23 | 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: | ||
| 26 | 29 | } |
| 27 | 30 | ``` |
| 28 | 31 | |
| 32 | +#### Flags | |
| 33 | + | |
| 34 | +Toggle options in niri are commonly represented as flags. | |
| 35 | +Writing out the flag enables it, and omitting it or commenting it out disables it. | |
| 36 | +For example: | |
| 37 | + | |
| 38 | +``` | |
| 39 | +// "Focus follows mouse" is enabled. | |
| 40 | +input { | |
| 41 | + focus-follows-mouse | |
| 42 | + | |
| 43 | + // Other settings... | |
| 44 | +} | |
| 45 | +``` | |
| 46 | + | |
| 47 | +``` | |
| 48 | +// "Focus follows mouse" is disabled. | |
| 49 | +input { | |
| 50 | + // Other settings... | |
| 51 | +} | |
| 52 | +``` | |
| 53 | + | |
| 54 | +#### Sections | |
| 55 | + | |
| 56 | +Most sections cannot be repeated. For example: | |
| 57 | + | |
| 58 | +``` | |
| 59 | +// This is valid: every section appears once. | |
| 60 | +input { | |
| 61 | + keyboard { | |
| 62 | + // ... | |
| 63 | + } | |
| 64 | + | |
| 65 | + touchpad { | |
| 66 | + // ... | |
| 67 | + } | |
| 68 | +} | |
| 69 | +``` | |
| 70 | + | |
| 71 | +``` | |
| 72 | +// This is NOT valid: input section appears twice. | |
| 73 | +input { | |
| 74 | + keyboard { | |
| 75 | + // ... | |
| 76 | + } | |
| 77 | +} | |
| 78 | + | |
| 79 | +input { | |
| 80 | + touchpad { | |
| 81 | + // ... | |
| 82 | + } | |
| 83 | +} | |
| 84 | +``` | |
| 85 | + | |
| 86 | +Exceptions are for example sections that configure different devices by name: | |
| 87 | + | |
| 88 | +``` | |
| 89 | +output "eDP-1" { | |
| 90 | + // ... | |
| 91 | +} | |
| 92 | + | |
| 93 | +// This is valid: this section configures a different output. | |
| 94 | +output "HDMI-A-1" { | |
| 95 | + // ... | |
| 96 | +} | |
| 97 | + | |
| 98 | +// This is NOT valid: "eDP-1" already appeared above. | |
| 99 | +// It will either throw a config parsing error, or otherwise not work. | |
| 100 | +output "eDP-1" { | |
| 101 | + // ... | |
| 102 | +} | |
| 103 | +``` | |
| 104 | + | |
| 29 | 105 | ### Defaults |
| 30 | 106 | |
| 31 | 107 | Omitting most of the sections of the config file will leave you with the default values for that section. |