Pages

Friday, May 25, 2012

Lenovo X220 Tablet rotation script

I've finally done it. I've gotten my Lenovo X220 Tablet rotation script up to usable parlance. You can just map this to the rotation button (which I'll explain in another post how to do) and it will rotate the screen, the pen, eraser, and touch inputs to the correct orientation. It takes care of the TouchPoint issue as well (the back of the screen doesn't play so well with it).
It's all written in bash, and I've tried to stick as closely as I can to deep, core OS utilities as possible so it'll work in any DE or distro.

ThinkPad X220 Tablet rotation script

(Note: the file is a .txt, but you can just change it to a .sh. I didn't want it to be taken down or be accused of trying to hand out malicious scripts.)

Thursday, December 22, 2011

Lenovo X220 Tablet Screen Rotation Script

#!/bin/bash

currentConfig=( `xrandr -q | grep LVDS1` )
currentRotation=`echo ${currentConfig[3]}`

# Turns the TouchPoint off if in portrait mode
setTouchPoint() {
    if [ $1 == "on" ] ; then
        toggle="1"
    else
        toggle="0"
    fi;
   
    xinput set-prop "TPPS/2 IBM TrackPoint" "Device Enabled" $toggle;
}

# Main
if [ $currentRotation == "left" ] ; then
    desiredRotation="normal"
    desiredWacom="0"
    setTouchPoint on
elif [ $currentRotation == "right" ] ; then
    desiredRotation="inverted"
    desiredWacom="3"
    setTouchPoint off
elif [ $currentRotation == "inverted" ] ; then
    desiredRotation="left"
    desiredWacom="2"
    setTouchPoint off
else
    desiredRotation="right"
    desiredWacom="1"
    setTouchPoint off
fi

xrandr --output LVDS1 --rotate $desiredRotation
xinput set-prop "Wacom ISDv4 E6 Pen stylus" "Wacom Rotation" $desiredWacom
xinput set-prop "Wacom ISDv4 E6 Finger touch" "Wacom Rotation" $desiredWacom

Middle Click Scrolling with Lenovo TrackPoint

I just found this handy script when I got my new Lenovo X220 Tablet with a TrackPoint.  I couldn't get the middle click to work correctly with it; it was configured to be a middle click button (which makes perfect sense) but I wanted it to have scrolling capabilities.
You just add this to /etc/gdm/PostLogin/Default and give it executable rights.

#!/bin/sh

xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
do
        case `xinput list-props $id` in
        *"Middle Button Emulation"*)
                xinput set-int-prop $id "Evdev Wheel Emulation" 8 1
                xinput set-int-prop $id "Evdev Wheel Emulation Button" 8 2
                xinput set-int-prop $id "Evdev Wheel Emulation Timeout" 8 200
                xinput set-int-prop $id "Evdev Wheel Emulation Axes" 8 6 7 4 5
                xinput set-int-prop $id "Evdev Middle Button Emulation" 8 0
                ;;
        esac
done


# disable middle button
xmodmap -e "pointer = 1 9 3 4 5 6 7 8 2"

Thursday, April 22, 2010

Mono on Linux

Yay!  Now we can develop Windows binaries from anywhere!  With Mono, you too can become a cross-platform programmer who sticks to one platform!

How is this productive?  A new de-facto standard developed for the Windows platform.  Why does everyone think this is such a great thing?  I remember a quote I read from Linus once which said something along the lines of, "When Microsoft starts writing programs for Linux, I'll know that I've won."  Well, how about all your Linux developers starting to write programs for Windows?!  That sounds like a great idea.  Then we can all rest assured that our blood, sweat, and tears going into developing a complete, feature rich F/OSS OS can be put onto a Microsoft Windows bandwagon and sold for millions of dollars.  Then maybe we can suck from the teet of M$ with their "developer" releases on the operating system that we wrote for them!  "Oh, good!  You mean I can buy my own code from you for only $200 a pop?!  Fabulous!  I'll take three!"

What the F*&%, OLPC?

So it's been released that OLPC has put an extensive amount of work into getting Windows XP to be bootable on their laptops.  Why?  Because it will "help drive competition" and Microsoft declared that they would either have to completely rewrite the bios for the machine or it would have to be written so Windows can boot from it.  This is bullshit.  The reason no one had built a port for OpenFirmware to Windows is because no one cared to run Windows on a machine that would be emphasizing F/OSS.  No one in the F/OSS community, so far as I know, would consider the assimilation a considerably forward-looking step for the NON-PROFIT organization which is supposed to be producing laptops for small children around the world.  Is this an effort to get information into small children's hands, or is it an effort to create a worldwide standard for communications and information technology?  Well, Microsoft had to be stopped in the United States due to monopolistic standings back in the 80's/90's, but can we stop them if they become the de-facto operating system worldwide?  I think not.

Tuesday, March 2, 2010

I Love Dell...

I don't care what people say about Dell Computer Company.  I love the fact that they are pioneers in the mass-production field of the computer industry, in terms of supporting Linux and the Linux community.  I know that when Dell comes out with a new BIOS update for the XPS M1330, I can still do updates to the BIOS.  This is the one major thing that has kept me with 1) Linux, and 2) Dell.  I will continue to purchase Dell computers if they keep up this kind of support.  I understand that their support for the Windows community is a little shoddy, but that's because you're trying to support Windows.  Kind of a daunting task to begin with.

Wednesday, February 17, 2010

GNOME

I'm really quite frustrated with most Linux desktop environments.  Nothing seems to really be able to top GNOME imho.  What is it exactly that makes this arena of environment so elegant?  It's simple, yet extensible.  It's not bloated, but does everything well.  It's quick, efficient, and has plenty of development so anything you want to do with it, you can most likely find a patch or package which will do it.  If someone uses Flubox or some other extremely minimalistic interface, let me know why you use it.  KDE users... best of luck.  I liked KDE 3.5... Once 4.0 hit, there was just not enough stability.  It seemed like stability came at the cost of speed.  If you're in KDE development, please enlighten us with why this is so.  KDE seems to be getting more and more bloated, with fewer and fewer features for the buck.

*****Edit*****
I have since tried KDE 4 for quite some time, and they've really made some improvements.  It's by far more stable and scalable than I remember.  Great job, guys.

Followers