shiftbuttons: HTC Shift Hardware Buttons control

shiftbuttons is a program that monitors the two right side hardware buttons on HTC shift, and launches any desired program when a button is pressed.

Typical usage is to start it as daemon (-d option) when you start your X session, and map each button to the desired function. For example, you can go into Gnome menu System -> Settings -> Sessions. There you find a tab named ‘Startup Programs’, and add the following:

    shiftbuttons -d -c \"gksudo /usr/bin/hsect2\" -r htcshift-rotate

This will launch hsect2 when you press the CommManager button, and will rotate the screen when you press the switch resolution button.

System wide configuration can be changed at /etc/xdg/autostart/shiftbuttons.desktop.

htcshift-rotate is also included in the tarball and the debian package.

Download

Source code: shiftbuttons-1.0.tar.gz
Ubuntu / Debian package: shiftbuttons_1.0-1_i386.deb


meneame del.icio.us | Technorati tags: , , , , , , ,

8 comentaris per a “shiftbuttons: HTC Shift Hardware Buttons control”

Gravatar de ferrett1968

ferrett1968
June 11th, 2008 @ 20:58    

It’s amazing!!!!
I use KDE but when I run the exec the mdg is:
Can’t access shared memory area. SHMConfig disabled?

any suggest?

Thanks

Gravatar de ferrett1968

ferrett1968
June 11th, 2008 @ 21:36    

solved
just added

Option “SHMConfig” in xorg.conf

thanks POF

Gravatar de Snorry

Snorry
June 11th, 2008 @ 22:42    

pof,

The rotate screen gives me a rotation to the right but my screen gets divided.
Looking at your script and reading your comments on xda-developer is saw you use the command xrandr.

Reading the help file for xrandr is saw it is possible to also give the possible size for the screen.
But xorg.conf needs to be adjusted for that. Using the easy setup way I saw you copied the xorg.cof and added a new one. If I adjust my xorg.conf to allow the resolution 600×800 won’t it be overwritten when I swicth between kernel and synce?

Also I would be in trouble since the easy setup uses the .deb package which doesn’t include the alterations in htschift-rotate.c

Rotation to the right could be:
xrandr -o right -s 600×800

Default could be:
xrandr -0 0 -s800×600

Is my reasoning correct?

Gravatar de Snorry

Snorry
June 11th, 2008 @ 22:44    

Oops should be 480×800 and 800×480

Gravatar de pof

pof
June 12th, 2008 @ 0:35    

@ferrett1968: yes, it’s on the README ;)

@Snorry: yes your reasoning seems correct. What do you mean by “my screen gets divided”? For me it’s rotating correctly (I’m using gnome desktop + netbook-remix). What happens if you rotate it from command line?

Gravatar de Snorry

Snorry
June 12th, 2008 @ 6:07    

If I use the same command like in the script on the commandline.
My screen rotates to the right. 2/3 on top is the left side of my normal screen (starting from the left). lower 1/3 is the same but starting from the right.

Gravatar de ferrett1968

ferrett1968
June 12th, 2008 @ 16:48    

oh oh!
or better….. doh!

:-)

Gravatar de Jorge

Jorge
July 17th, 2008 @ 0:03    

Yo tengo el mismo problema que Snorry. La pantalla aparece dividida y la pantalla táctil no funciona.

I have the same problem that Snorry. The screen gets divided y lo otro no sé traducirlo.

Deixa el teu comentari...