YaLTeR / niri

A scrollable-tiling Wayland compositor.

Home Page:https://matrix.to/#/#niri:matrix.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specific input device configuration

YaLTeR opened this issue · comments

Ability to configure specific input devices.

Syntax: something along

input {
    mouse "identifier" {
        // Settings for this device.
    }
}

Resolution for a given device:

  1. Search for settings block matching this device's identifier.
  2. If not found, use the general block for this device's type.

Identifier: check what other compositors use, guess it's something libinput should be exposing.

For keyboards, it should support per-keyboard XKB config.

This should include the ability to disable the device, too

commented

I was looking through the current implementation and at the smithay code, and I don't see how to accomplish this at the moment. 100% possible I'm just missing something obvious, still trying to get to know the code base.

Are you referring to something in particular? For libinput settings, it should be possible to simply get the device name and find the right config section in apply_libinput_settings().

For dynamic XKB, you need to look in on_keyboard(), extract the libinput device like this (pretty cursed, but possible), then switch the XKB settings similar to how config hot-reload works I guess?

This should include the ability to disable the device, too

I'm expand the request: it should be permanent/toggle (via config file) or eventually (via niri msg action ...).

Use cases are: hotkeys to on/off touchpad, temporary off touchpad while mouse is connected.

This can work similarly to niri msg output: apply a config change transiently until the input section is modified in the real config.

commented

@YaLTeR Aha, that was the "obvious" hint I was missing. My cursory look through the config and input code just missed this. Thanks!