Ubuntu 14.04 on Thinkpad Yoga (tweaks)

I recently managed to get myself a Thinkpad Yoga, and (being me) I wanted to get a nicely-working install of Linux on it.

Some notes about extra configuration:

  1. Working clickpad / trackpoint setupSave the following to /etc/X11/xorg.conf.d/90-trackpoint.conf
    Section "InputClass"
            Identifier "Default clickpad buttons"
            MatchDriver "synaptics"
    	
    	Option "SoftButtonAreas" "60% 0 0 2400 40% 60% 0 2400"
    	Option "AreaTopEdge" "2400"
    
    	Option "TapButton1" "1"
    	Option "TapButton3" "2"
    	Option "TapButton2" "3"
    
    	# Calm the pad down while clicking
    	Option "VertHysteresis" "50"
    	Option "HorizHysteresis" "50"
    
    	# Drag lock
    	Option "LockedDrags" "1"
    
    	# Tap to click
    	Option "FingerLow" "50"
    	Option "FingerHigh" "55"
    	
    	# Prevent accidental clicks
    	Option "PalmDetect" "1"
    	Option "PalmMinWidth" "5"
    	Option "PalmMinZ" "40"
    	
    	# Natural scrolling
    	Option "VertTwoFingerScroll" "1"
    	Option "VertScrollDelta" "-90"
    	Option "HorizTwoFingerScroll" "1"
    	Option "HorizScrollDelta" "-90"
    	
    	Option "MinSpeed" "1"
    	Option "MaxSpeed" "1"
    	
    	Option "AccelerationProfile" "2"
    	Option "ConstantDeceleration" "4"
    EndSection
    

    and run
    sudo apt-get install xserver-xorg-input-synaptics

  2. Rotate screen on flipSave to /etc/acpi/rotate-screen.sh

    #!/bin/bash
    
    # Note: xrandr needs to execute in the context of the X server
    
    # Find the user running the X server
    user="$(who -u | grep -F '(:0)' | head -n 1 | awk '{print $1}')"
    
    # A convenience function to run a command in the X server context
    with_display() { DISPLAY=:0 su -c "$(printf "%q " "$@")" "$user"; }
    
    # As the same ACPI event is currently emitted for both going in and out
    # of the tablet mode, we need to toggle the orientation
    
    # Figure out the current rotation:
    current=`with_display xrandr -q --verbose | grep eDP1 | grep -o -E 'left|normal' | head -1`
    
    
    # Set the next orientation
    case $current in
        normal)      next=left;;
        left)        next=normal;;
    esac
    
    with_display xrandr -o $next
    case $next in
        normal)
            with_display xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1
            killall onboard
            ;;
        left)
            with_display xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
            with_display onboard&
            ;;
    esac
    
    

    Save to /etc/acpi/events/tablet-mode

    event=ibm/hotkey LEN0068:00 00000080 000060c0
    action=/etc/acpi/rotate-screen.sh
    
  3. Disable touchscreen when using penRun this on startup:

    #!/bin/bash
    
    # Deactivate touchscreen when wacom pen is in proximity
    # Activate touchscreen when wacom pen gets out
    
    sleeptime="0.3s"
    lastPenPosition="Proximity=Out"
    while true
    do 
        mssg="`xinput query-state "Wacom ISDv4 EC Pen stylus" | grep Proximity`"
        if [ ${#mssg} -gt 1 ]
        then
            inout="`echo $mssg | awk '{print $3}'`"
            case "$inout" in
                "Proximity=In" )
                    if [ $lastPenPosition != $inout ]
                    then
                        xinput --disable "ELAN Touchscreen"
                        lastPenPosition=$inout
                    fi
                    ;;
                "Proximity=Out" )
                    if [ $lastPenPosition != $inout ]
                    then
                        xinput --enable "ELAN Touchscreen"
                        lastPenPosition=$inout
                    fi
                    ;;
            esac
        fi
        sleep $sleeptime
    done
    

Everything else appears to work out of the box 😀

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>