hadess / iio-sensor-proxy

IIO accelerometer sensor to input device proxy
196 stars 63 forks source link

Launch a script with the help of monitor-sensor for 2 accelerometers ? #294

Closed Tuxman2 closed 4 years ago

Tuxman2 commented 4 years ago

Hi,

I have a tablet PC with 2 accelerometers. I would like to know if with the help of monitor-sensor and inotify I can launch a script who could disable or enable the keyboard and the touchpad when I flip the screen to 180° or 360° and when I'm come back to the laptop mode ?

Thanks.

hadess commented 4 years ago

iio-sensor-proxy only handles a single accelerometer, accelerometers that aren't considered to be in "the display" are ignored, as they don't give out interesting information for display rotation.

If you only want to use the display rotation for your script, you can listen on the D-Bus signals. Here's an example of doing that in shell: https://superuser.com/questions/1147784/how-to-auto-rotate-the-screen-using-yoga-900s-accelerometer