I have a Yoga 530-14IKB Laptop (ideapad) - Type 81EK @lenovo.com and it has a feature where you can fold the laptop backward and turn the laptop into a pad. This works very well in windows as it disables the physical keyboard.
I am using ubuntu 18.04 LTS and the touch screen is working fine.. the only problem is that it is not automatically disabling when I fold the monitor backwards.
I would probably disable it manually with a terminal command and then enable it again in such a way, but there must be a sensor as it is automatic in windows 10 and I would love to find a way to do this in linux as well.
I found this script Tablet mode detection and setup scripts for linux @GitHub but I can not work out how it is supposed to work...
I installed ruby ( sudo apt install ruby )
Than I copied the two files form the page... the settings file and the script.
The instructions say...
- Install ruby and stdbuf (most likely you already have them preinstalled)
- Clone it somewhere, and optionally symlink watch_tablet into any directory in your $PATH
- Copy a config file into ~/.config/watch_tablet.yml
- Adjust the config (see below)
- Add watch_tablet & to your ~/.xinitrc 6.Restart your desktop session and enjoy
I did everything but (2).. I do not know what that means.
The config instructions say...
input_device is a path to the device that provides the tablet mode switch. To find it you may run [I]stdbuf -oL libinput debug-events|grep switch[/I] and notice something like event4 in the leftmost column. That would correspond to /dev/input/event4. Device numbers may be unstable across reboots, so you may consider doing ls -lh /dev/input/by-path and finding a symlink to that device. For X1 Yoga Gen2 it's /dev/input/by-path/platform-thinkpad_acpi-event.
modes.laptop, modes.tablet - this contain commands that will be executed when mode changes. Most likely this will contain xinput enable and xinput disable commands to enable/disable kb/touchpad/trackpoint (just run xinput to look them up). You may use any other commands to adjust your desktop environment (e.g. hide or show additional panels, increase button size, hide/show onscreen keyboard etc.)
But the command "stdbuf -oL libinput debug-events|grep switch" dose not work?
:~$ stdbuf -oL libinput debug-events|grep switch stdbuf: failed to run command ‘libinput’: No such file or directory
Anyone know how I can get this working or know a method to turn off the keyboard when the Yoga is folded backward?
Thanks!