4.8 KiB
Overview
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:
input {
keyboard {
xkb {
// layout "us"
// variant "colemak_dh_ortho"
// options "compose:ralt,ctrl:nocaps"
// model ""
// rules ""
}
// repeat-delay 600
// repeat-rate 25
// track-layout "global"
}
touchpad {
tap
// dwt
// dwtp
natural-scroll
// accel-speed 0.2
// accel-profile "flat"
// tap-button-map "left-middle-right"
// click-method "clickfinger"
}
mouse {
// natural-scroll
// accel-speed 0.2
// accel-profile "flat"
}
trackpoint {
// natural-scroll
// accel-speed 0.2
// accel-profile "flat"
}
tablet {
map-to-output "eDP-1"
}
touch {
map-to-output "eDP-1"
}
// disable-power-key-handling
// warp-mouse-to-focus
// focus-follows-mouse
// workspace-auto-back-and-forth
}
Keyboard
Layout
In the xkb section, you can set layout, variant, options, model and rules.
These are passed directly to libxkbcommon, which is also used by most other Wayland compositors.
See the xkeyboard-config(7) manual for more information.
input {
keyboard {
xkb {
layout "us"
variant "colemak_dh_ortho"
options "compose:ralt,ctrl:nocaps"
}
}
}
When using multiple layouts, niri can remember the current layout globally (the default) or per-window.
You can control this with the track-layout option.
global: layout change is global for all windows.window: layout is tracked for each window individually.
input {
keyboard {
track-layout "global"
}
}
Repeat
Delay is in milliseconds before the keyboard repeat starts. Rate is in characters per second.
input {
keyboard {
repeat-delay 600
repeat-rate 25
}
}
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.0to1.0where the default is0.0.accel-profile: can beadaptive(the default) orflat(disables pointer acceleration).
Settings specific to touchpads:
tap: tap-to-click.dwt: disable-when-typing.dwtp: disable-when-trackpointing.tap-button-map: can beleft-right-middleorleft-middle-right, controls which button corresponds to a two-finger tap and a three-finger tap.click-method: can bebutton-areasorclickfinger, changes the click method.
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
Normally, switching to the same workspace by index twice will do nothing (since you're already on that workspace). If this flag is enabled, switching to the same workspace by index twice will switch back to the previous workspace.
Niri will correctly switch to the workspace you came from, even if workspaces were reordered in the meantime.
input {
workspace-auto-back-and-forth
}