How to disable builtin keyboard in Wayland
Written , a less then a minute read
Few days ago, the keyboard in my Thinkpad x270 died. After dissasembly and through cleaning it sadly didn't come back to life. The next day, it was worse then dead - it was in a need of exorcits. It was entering 6s into all my terminals and text inputs. So I needed to learn how to disable keyboard in Wayland.
First, find what is the identifier of the keyboard. You can see all devices with:
libinput list-devices
Output for my keyboard
Device: AT Translated Set 2 keyboard
Kernel: /dev/input/event4
Group: 8
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
In the Kernel
field is a path for the event file, that you should pass to the next command:
udevadm info -a -p /sys/class/input/event#
Copy attributes that are unique for this device and enter it to a file:
sudoedit /etc/udev/rules.d/99-ignore-thinkpad-keyboard.rules
with content based on the previous command:
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"
And reboot! Enjoy your new keyboardless life!