I have an HP ENVY 13-ay0000 x360 Convertible Laptop with an AMD Ryzen 5 4500U CPU running Ubuntu 22.10. The auto-rotation is not working, and the keyboard and touchpad are only disabled if the laptop is folded completetly backwards, but not in between. I believe it's due to this bug: https://bugzilla.kernel.org/show_bug.cgi?id=212615.
As a workaround, I was trying to rotate the screen and disable the keyboard manually through a script or something of the sort. The screen rotation and touchpad disabling I managed to get working but I'm struggling to figure out how to disable and reenable the keyboard. Using xinput does not work as I'm using wayland. I checked this thread: https://unix.stackexchange.com/questions/381944/how-to-disable-internal-keyboard-on-fedora-26-wayland
But neither solution worked as I need to disable and reenable on demand and not permanently. I tried grabbing the keyboard events but this results in the touchscren and touchpad behaving erratically.
Any ideas on how this could be achieved?
$ sudo evtest --grab /dev/input/event2 >/dev/null &
but you need to enter evtest into visudo so you don't actually have to enter the sudo password...alternately, don't launch it backgrounded and enter the password.