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, trackball, 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).
Keyboard
Layout
In thexkb 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 on XKB options.Using a custom .xkb file (Since: 25.02)
Using a custom .xkb file (Since: 25.02)
Alternatively, you can directly set a path to a .xkb file containing an xkb keymap. This overrides all other xkb settings.
Systemd-localed integration (Since: 25.08)
Systemd-localed integration (Since: 25.08)
If the These settings are picked up by some other programs too, like GDM.
xkb section is empty (like it is by default), niri will fetch xkb settings from systemd-localed at org.freedesktop.locale1 over D-Bus.You can see this layout in localectl and change it with localectl set-x11-keymap:Layout Tracking
When using multiple layouts, niri can remember the current layout globally (the default) or per-window.Controls how keyboard layouts are tracked:
global: layout change is global for all windowswindow: layout is tracked for each window individually
Repeat Settings
Delay in milliseconds before the keyboard repeat starts
Rate in characters per second
Num Lock
Set thenumlock flag to turn on Num Lock automatically at startup.
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.Common Settings
A few settings are common betweentouchpad, mouse, trackpoint, and trackball:
If set, inverts the scrolling direction
Pointer acceleration speed. Valid values are from
-1.0 to 1.0Can be
adaptive (the default) or flat (disables pointer acceleration)When to generate scroll events instead of pointer motion events. Can be:
no-scrolltwo-fingeredgeon-button-down
If set, changes the device to left-handed mode
Emulate a middle mouse click by pressing left and right mouse buttons at once
Touchpad Settings
Enable tap-to-click
Disable-when-typing
Disable-when-trackpointing
Controls if tap-and-drag is enabled
If set, lifting the finger off for a short time while dragging will not drop the dragged item.
Can be
left-right-middle or left-middle-right. Controls which button corresponds to a two-finger tap and a three-finger tap.Can be
button-areas or clickfinger. Changes the click method.Do not send events while external pointer device is plugged in
Scales the scrolling speed by this value You can also override horizontal and vertical scroll factor separately:
Mouse Settings
scroll-factor.
Tablet and Touch Settings
Tablets and touchscreens are absolute pointing devices that can be mapped to a specific output:Map the device to a specific output. Valid output names are the same as the ones used for output configuration.
Set to six floating point numbers to change the calibration matrix.
- for
tablet - for
touch
When a tablet is not mapped to any output, it will map to the union of all connected outputs, without aspect ratio correction.
General Settings
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).
Warp Mouse to Focus
Makes the mouse warp to newly focused windows. Does not make the cursor visible if it had been hidden.Warp Mode (Since: 25.05)
Warp Mode (Since: 25.05)
You can customize the warp behavior with the
mode property:default: warps separately horizontally and verticallycenter-xy: warps by both X and Y coordinates togethercenter-xy-always: always warps to center, even if mouse was already inside the window
Focus Follows Mouse
Focuses windows and outputs automatically when moving the mouse over them.Max Scroll Amount (Since: 0.1.8)
Max Scroll Amount (Since: 0.1.8)
You can optionally set
max-scroll-amount. Then, focus-follows-mouse won’t focus a window if it will result in the view scrolling more than the set amount. The value is a percentage of the working area width.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.
Modifier Keys
Customize theMod key for key bindings. Only valid modifiers are allowed, e.g. Super, Alt, Mod3, Mod5, Ctrl, Shift.
The modifier key to use for bindings when running niri on a TTY (default:
Super)The modifier key to use for bindings when running niri as a nested window (default:
Alt)