In this post I will describe how you could enable the gyro-sensor for automatic display rotation under Ubuntu 10.10 (Should also work under all debian based os)
This post and delivered scripts are based on the work of arobase40 from http://ubuntuforums.org/
and Imarune from the french ubuntu forum.
Thanks for your nice job!
sudo su -
#add new startup modules
echo -e "i2c-i801\ni2c-dev\nlis3lv02d_i2c" >> /etc/modules
arobase40 describes in the mentioned forum post two more ways to access the gyro-sensor. I choose this way because, you do not need to compile the kernel or anything else, also the suspend modes works fine.
download: i2c-gsensor (5.06KB)
description: A small application and a corresponding script for enabling the gyro-sensor autorotation feature of the Acer 1825 series.
Download this file and extract it.
The application i2c-gsensor is based on http://pof.eslack.org/blog/2008/06/03/i2c-gsensor-lis3lv02dl-accelerometer-on-htc-shift-g-sensor/
Change with the terminal into the extracted directory and run make!
You got the application i2c-gsensor. Copy the application and the script to /usr/bin/ and
set script and application execution rights with:
sudo cp gyro-auto-rotate.run i2c-gsensor /usr/bin/
sudo chmod +x /usr/bin/i2c-gsensor
sudo chmod +x /usr/bin/gyro-auto-rotate.run
Now you could check if everything works:
i2c-gsensor 0 [loop] #loop is optional if you want output in endless loop //0 specifies the i2c-bus, should be correct
#if this works fine, you should see some xyz coordinates corresponding to the current notebook position
#now check the auto rotation script:
Turn around your notebook and the display should switch in the correct position (left and right correct for tablet mode).
If everything works fine you could add the script to System->Start programs