I need a cli command to disable input devices (keyboard and mouse), as well as a command to enable them again.
To disable input devices on Xorg it's: xinput float <id#>
, and to enable them it's xinput reattach <id#>
, but I'm on Wayland, how to do it there?
There may be other methods depending on what desktop you are using, but for any of them you should be able to use
evtest -grab
on an input device. This program intercepts all events coming from the device (for debugging), and the grab option stops the events going any further. The program has to stay running, and when it is killed the events will once again pass on to Wayland.You can find the name of the mouse and keyboard by looking through the output of commands
For example, I have
so I would need to do
and then kill these processes to regain control.