You are not logged in.

#1 2012-06-10 09:13:44

Padfoot
Member
Registered: 2010-09-03
Posts: 381

OrientX - auto rotate your X11 display with an accelerometer

Hi,

I have written a python app called OrientX for tablet devices with an accelerometer. It is launched on your desktop login and monitors the accelerometer to automatically rotate your X11 display on device rotation.

Until I decide on a location to host the code, I have a PKGBUILD available here (complete with source) http://home.exetel.com.au/padfoot/downl … src.tar.gz

Once I put the source on a host, I will look at adding the package to the AUR (not there yet as I know we should not include the source in the PKGBUILD).

Configure OrientX by editing the file /etc/orientX.conf

There is a convenience command to use with applications where a particular orientation is required.

$ orientX -h
usage: orientX [-h] (-s | -l | -u | -m MODE | -o ORIENT)

Query and set state of OrientX auto X11 rotation monitor

optional arguments:
  -h, --help            show this help message and exit

options:
  -s, --state           print current state to stdout
  -l, --lock            lock auto-rotation
  -u, --unlock          unlock auto-rotation
  -m MODE, --mode MODE  rotate display to MODE layout {landscape,portrait}
  -o ORIENT, --orient ORIENT
                        rotate display to ORIENT orientation
                        {normal,left,right,inverted}

As you can see above, you can apply a software lock so the screen will not be rotated but the accelerometer is still able to be used, in a game for example.
You can also manually rotate the screen (not affected by the software lock) so if your app needs to be rotated a particular way, you can set that either with orientX -o or more conveniently orientX -m to select from landscape or portrait.

Any questions, just ask.

All feedback and suggestions welcome.

Enjoy.

Cheers.

Last edited by Padfoot (2012-06-10 11:36:02)

Offline

#2 2012-06-10 11:16:59

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: OrientX - auto rotate your X11 display with an accelerometer

You can try to setup a Github account to host your source: https://github.com/

Lots of people use it and it's really easy once you set this up!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#3 2016-06-08 17:07:56

Gaara14
Member
Registered: 2016-06-08
Posts: 1

Re: OrientX - auto rotate your X11 display with an accelerometer

Hi !
I hope you're still here smile
I'm very interested by your script for my project, a linux tablet using a Pi (Orange Pi)

If you're here can we speak in private, by email ?

Thanks!

Offline

Board footer

Powered by FluxBB