alesya-h / linux_detect_tablet_mode

Detect if your laptop is in normal or tablet mode. Useful for Yoga laptops to disable keyboard/trackpoint/touchpad in a tablet mode
MIT License
137 stars 29 forks source link

Support other types of sensors as well #4

Closed dos1 closed 6 years ago

dos1 commented 6 years ago

The script assumes accelerometers only, so it fails when it detects just one accelerometer, while my Lenovo Yoga 2 Pro seems to use gyroscope instead of second accelerometer.

dos@yoga:~/git/linux_detect_tablet_mode$ cat /sys/bus/iio/devices/iio\:device*/name
accel_3d
incli_3d
als
gyro_3d
magn_3d
dev_rotation
dos1 commented 6 years ago

Actually, I have played a bit more with it and seems like all of this comes from the screen :( While there is some sensor on the keyboard side for sure, it doesn't seem to be reachable from Linux yet.