Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have recently installed Ubuntu (and its derivatives Xubuntu and Kubuntu) on my laptop.

On my computer, I have both a touchpad and a trackpoint. In Windows, the touchpad is disabled when I use the trackpoint.

Is there any way to recreate this in Linux?

share|improve this question
    
Check out this site –  Raystafarian Feb 9 '12 at 19:24
add comment

1 Answer

I Googled and Googled for a fix for this exact problem and this is what I came up with to suit my system:

#!/bin/bash
#
#Change /dev/input/event13 to your trackstick event
    cat /dev/input/event13 > /tmp/mousemove &
#initialize counter to prevent garbage file from growing
    i="0";
    while true ; do 
        i=$[$i+1];
        #variables  
        oldchecksum=${newchecksum};
        newchecksum=`md5sum /tmp/mousemove | awk '{print $1}'`
        #see if trackpad is already disabled
        if [ "$trackpad" = "off" ]; then

            #compare previous checksum to current if they're same trackstick is not moving
            if [ "$oldchecksum" = "$newchecksum" ]; then
                #make sure trackpad is enabled
                xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1;
                trackpad="on";
            fi

        else

            #compare previous checksum to current if they're different trackstick is moving
            if [ "$oldchecksum" != "$newchecksum" ]; then
                #disable trackpad
                xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0;
                trackpad="off";
            fi

        fi

        #check for count to keep poll file smaller
        if [ "$i" = "300" ]; then
            echo '' > /tmp/mousemove;
            i="0";
            newchecksum=`md5sum /tmp/mousemove | awk '{print $1}'`
        fi
            #sleep for 1 second so we don't eat up resources
            #if the update speed is not fast enough for you a smaller number such as .75 may be better
            sleep 1;
    done

Since I run fluxbox on arch I added the script call in my ~/.fluxbox/apps

Only caveat I could find was that if you manage to pkill cat as root, which this script must be run as to access the mouse event, you’ll kill the script, at the same time if you kill the script and don’t kill cat it will continue to run until you either run out of space in /tmp, pkill cat, or reboot the system.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.