thinkpads.com Support Community Forum Index Bill Morrow's thinkpads.com Open Forum - The Original Thinkpad Support Forum
Follow ThinkpadsForum on Twitter
 Support this forum, shop at newmodeus.com
 Support the forum, shop at newmodeus.com
IBM & lenovo legacy model ThinkPad support files are available on thinkpads.com.
including Hardware Maintenance Manuals, latest or final driver updates and more.
at: thinkpads.com


If you so wish:
Donate using PayPal

It is currently Sat Sep 20, 2014 8:59 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon May 28, 2012 7:28 pm 
Offline

Joined: Mon Dec 26, 2011 2:48 am
Posts: 11
Location: Portland, Oregon
Hi everyone! So, I just installed Ubuntu on my new X220 tablet and I wanted to share a little script that I worked on to make rotation work with the computer, because by default when you rotate the screen orientation the pen, eraser and touch inputs do not rotate as well. So, with this simple script, the screen rotates to the left from default upon clicking it (I'm left-handed; figure it out if you're right-handed) and then back to normal from the left. I did some research in creating the script, but I forgot from where...

Anyways! Put this in a file blah.sh anywhere, and do whatever you want with it! I pinned it to the taskbar thingy in Ubuntu:
Code:
#!/bin/sh

# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.

rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"

# Using current screen orientation proceed to rotate screen and input tools.

case "$rotation" in
    normal)
    # rotate to the left
    xrandr -o left
    xsetwacom set "Wacom ISDv4 E6 Pen stylus" rotate ccw
    xsetwacom set "Wacom ISDv4 E6 Finger touch" rotate ccw
    xsetwacom set "Wacom ISDv4 E6 Pen eraser" rotate ccw
    ;;
    left)
    # rotate to normal
    xrandr -o normal
    xsetwacom set "Wacom ISDv4 E6 Pen stylus" rotate none
    xsetwacom set "Wacom ISDv4 E6 Finger touch" rotate none
    xsetwacom set "Wacom ISDv4 E6 Pen eraser" rotate none
    ;;
esac


Lastly... To pin to the taskbar takes a little skill. Find a icon online that you want (svg works) and follow this guide to pin it to the Unity bar:
http://itshouldbeuseful.wordpress.com/2 ... ntu-11-04/

Good luck! Hope this helped someone... I didn't look to see if something like this had been posted before. If anyone can get it to run when you press the dedicated rotate button, please let me know!

My Unity screenshot: http://lookpic.com/O/i2/956/Zf0xHxN.png
SVG rotate icon: http://www.clker.com/clipart-rotate-ccw-icon.html


EDIT:: Check out this Github installation using this script and some other cool things made by "the undecided":
https://github.com/martin-ueding/think-rotate

_________________
X220 Tablet | Multitouch display | Intel Core i7-2640M Processor | Win7/8/Ubuntu x64 | 256GB Samsung 830 SSD | 8GB DDR3 1333MHz | WiMAX, Bluetooth, Webcam, Fingerprint
T61 | Intel Core 2 Duo 2.4GHz | Widescreen 14.1" | 320GB 7200rpm HDD | 4GB DDR2 |


Last edited by aeharding on Mon Jun 11, 2012 6:30 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu May 31, 2012 8:00 am 
Offline

Joined: Wed May 23, 2012 2:04 am
Posts: 10
Location: Bonn, NRW, Germany
I'll try it when I get my X220 Tablet.

It would be good if you specify a license instead of the ambigious “whatever you want”. I assume you refer to the Expat License (a.k.a. MIT License).

Since your full name is in the screenshot, I'd recomment to put a “Copyright © 2012 yourname <youremail>” into the beginning of the script as well. So in case somebody has a question, they know that it is from you.


Top
 Profile  
 
PostPosted: Fri Jun 08, 2012 11:45 am 
Offline

Joined: Wed May 23, 2012 2:04 am
Posts: 10
Location: Bonn, NRW, Germany
I used your script and enhanced it a little bit. Now you can specify the new orientation as a parameter as well. And I wrote a little manual page for it as well.

The code and everything else is on GitHub


Top
 Profile  
 
PostPosted: Fri Jun 08, 2012 8:08 pm 
Offline
Senior Member
Senior Member

Joined: Sat Jun 19, 2004 8:40 pm
Posts: 834
Location: Pine Grove, PA
Nice, thanks for sharing that and I like your documentation. Well done.

_________________
Thinkpad T420 | Core i-5 2520M | 16gb RAM | 120gb Intel 520 SSD + 750gb 7200 RPM | 6300 N | Ubuntu 12.04 x64
Desktop: AMD FX-8350 (8 cores) | 32gb ECC RAM | 240gb Intel 530 SSD + 1tb 7200 RPM | Ubuntu 14.04 x64 | HP ZR24w
Previous Thinkpads: A21m, R40, X61, T410


Top
 Profile  
 
PostPosted: Mon Jun 11, 2012 6:27 pm 
Offline

Joined: Mon Dec 26, 2011 2:48 am
Posts: 11
Location: Portland, Oregon
Glad you like it wolfman. ;)

Thanks "the undecided"! That implementation rocks and is sure to make it easier to find. :)

I am not going to take credit in copyright because I modified it to the Thinkpad x tablet series (specifically my x220) from some long lost source for some older/different brand touchscreen device.

Also... everyone should see this source for adding the script to physical key execution on the 'tablet rotate' button:
viewtopic.php?p=676410#p676410

_________________
X220 Tablet | Multitouch display | Intel Core i7-2640M Processor | Win7/8/Ubuntu x64 | 256GB Samsung 830 SSD | 8GB DDR3 1333MHz | WiMAX, Bluetooth, Webcam, Fingerprint
T61 | Intel Core 2 Duo 2.4GHz | Widescreen 14.1" | 320GB 7200rpm HDD | 4GB DDR2 |


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group