0

I have Fedora Workstation 36 running Wayland.

I need to disable the keyboard that comes with my laptop, without keeping a terminal open all the time.

The solution here is to run:

sudo evtest --grab /dev/input/event2

but this requires to keep a terminal open at all times, plus a background process running all time.

  • Create a .desktop file? – Artem S. Tashkinov May 15 '22 at 15:12
  • @ArtemS.Tashkinov and run it every time the PC starts? – robertspierre May 15 '22 at 15:26
  • No idea, you've not specified your use case and requirements. – Artem S. Tashkinov May 15 '22 at 18:39
  • @ArtemS.Tashkinov my use case is that the keyboard of the laptop is broken and I'm using an external USB keyboard. The requirements are: deactivate laptop's keyboard in Fedora Workstation 36 running Wayland, possibly through config and not through a background process constantly running. – robertspierre May 16 '22 at 02:01
  • @robertspierre - find out what driver it uses and locate it in /sys/bus/... - you should be able to unbind the device... for example, i unbind my integrated camera in my laptop, like so: 'echo '1-4' | sudo tee /sys/bus/usb/drivers/usb/unbind'... you won't need a terminal open for this and you could script it and/or at it as a systemd service on boot. – jrdnjhntsn May 16 '22 at 02:15
  • 1
    @jrdnjhntsn I need more details on "find out what driver it uses" and "locate it in /sys/bus/" please :) – robertspierre May 16 '22 at 04:17
  • https://askubuntu.com/questions/160945/is-there-a-way-to-disable-a-laptops-internal-keyboard - add this to rc.local or create a systemd unit. GOOGLE knows everything. – Artem S. Tashkinov May 16 '22 at 06:08
  • @ArtemS.Tashkinov there's no xinput on Wayland – robertspierre May 16 '22 at 08:24
  • You're right, sorry, googling hasn't revealed anything interesting, also someone has already asked the question and no one replied: https://unix.stackexchange.com/questions/671972/disable-latptop-keyboard-on-wayland-gnome – Artem S. Tashkinov May 16 '22 at 08:45
  • It's above me why people insist on using half-assed Wayland. Sorry. I cannot call this abomination a graphics system, it's a crap system for those who want to have nothing but troubles. – Artem S. Tashkinov May 16 '22 at 08:46
  • Funnily someone else has asked the same question today almost at the same time as you: https://ask.fedoraproject.org/t/how-to-disable-laptop-keyboard-on-wayland/22414 – Artem S. Tashkinov May 16 '22 at 08:56
  • @robertspierre - google "linux unbind usb": there are examples on the web on how to do this -- but you will need to know what device/bus your keyboard is on... as it's a laptop, it's likely in /sys/bus/usb, but it could be elsewhere, maybe /sys/bub/hid – jrdnjhntsn May 16 '22 at 10:44
  • you should be able to identify your keyboard by using 'lsmod' or 'lsusb', etc. then navigating through /sys/bus or sys/devices/platform, etc to find it in sysfs / the file system – jrdnjhntsn May 16 '22 at 10:53
  • 1
    I've achieved it and posted instructions here. Marking this as a duplicate of that one :) – robertspierre May 17 '22 at 07:38

0 Answers0