How-to disable Touchpad on Linux

Disable Touchpad on Fedora 7 - coded by Shailen Sobhee

This method had been tested on Fedora 7, but I suppose that it should also work on other widely supported Linux’es like Red Had Enterprise, Suse, Mandrake.

 

The touchpad is indeed a useful tool but sometimes it can be inadvertently irritating. I haven’t figured out why laptop designers haven’t considered this problem and placed the touchpad a bit further away or re-engineered it such that when the keyboard is in use,the touchpad is momentarily turned off.

In any case, last week was almost the last drop out that overflowed the pot. I was busy having an interesting conversation with my girlfriend and all the time, the cursor would jump off Pidgin(a chat client that supports various protocols,including googletalk and msn).

I decided to search the net for a means to disable the touchpad when linux detects a mouse and found one method but didn’t work. In addition, the tutorial was for the old FC4 and probably didn’t support F7 anymore. However, I love Fedora too much to reboot into windows and chat on MSN there, with the synaptics touchpad driver for windows disabled.

This is the simplest workaround for this problem, so without digressing too much from you attention, here you are:

Step1:

Edit your Xorg.conf file.

su
vi /etc/X11/xorg.conf

Look for the “InputDevice” Section and add the line below before “End Section”. To enter in edit mode, type the letter ‘i’. You should see –INSERT in bold at the bottom of the terminal. To save and quit, hold Shift+ZZ

Option "SHMConfig" "on"

On my laptop, it looks like this: (Yours may be slightly different, but the major parts, like Driver “synaptics” are the same.)

Section “InputDevice”
Identifier “Synaptics”
Driver “synaptics”
Option “Device” “/dev/input/mice”
Option “Protocol” “auto-dev”
Option “Emulate3Buttons” “yes”
Option “SHMConfig” “on”
EndSection

Now, please be careful. WordPress has a relatively poor article-edit interface, so you can’t manage your text properly. Notice the quotes (“) on the words: “SHMConfig” “on” .Just don’t copy paste that line there. Ensure that the quotes are the same as the quotes on the other words. Linux requires that the quotes are the same. If you happen to paste that line in the xorg.conf file, check carefully that the quotes do not look different from others. However, if you are typing the line there, type it exactly as it appears here, as linux is case-sensitive.

Step2:

Download the touchpad scripts I have coded.

Copy the touchpad.tar.gz file in a folder, cd into the folder (Ex: cd /home/your_name/Desktop/) and extract the scripts:

tar -xzf touchpad.tar.gz

Step3:
Copy the file touchpad in the filesystem directory. To do that, go into the directory you have just extracted the script and,

cp -apv touchpad /

Step4:

Bookmark/save/print this page and reboot your computer. This is the best method to reload X. However, you can still restart X from the console, but I don’t recommend this.

Step5:

When you come back to your computer, you can disable the touchpad by issuing the command below. However, before you can do this, you have to set executable properties to the script. This can be done by issuing :

chmod +x /touchpad

Then to disable the touchpad,

/touchpad stop

To start it again, simply type:

/touchpad start

The status function is an added feature I have included for step5, but it is obviously not needed here, because you can test it trying the touchpad.

Step6: (RPM based machines only like Fedora, RedHat Enterprise..but can be re-engineered for Ubuntu)

You have actually succeeded in deploying the scripts. However, if it is a tedious task to always disable the touchpad each time you boot, you can use my second script called touchpadboot. Again, go into the folder you have extracted the scripts.
su
cp -apv /touchpadboot /etc/init.d/touchpadboot
chmod +x /etc/init.d/touchpadboot
/sbin/chkconfig --add /etc/init.d/touchpadboot

Note: There are two hyphens before the command add, after chkconfig. (/sbin/chkconfig – -add … (there is no space between the hyphens though). WordPress tends to obfuscate text, and it is an incredible feat to post a neat, well formatted blog text. I wonder what tool the wordpress engineers use to post their articles-it is definitely not the common online wordpress editor or else they would know their editor is ludicrously weak.

Step7:

That’s it, your computer will always start with touchpad disabled. Note that it will hence be mandatory to move around with your mouse. You can still enable the touchpad by issuing the ‘/touchpad start’ command. I will recommend to set a shortcut key to launch a terminal (Fedora7: System>Preferences>Personal>Keyboard Shortcuts).

Updates: 01 March 2008 : Updated the touchpad scripts.
Added a note about pasting code in the xorg.conf file, regarding quotes.
Changed the article a little for beginners to understand.
Tested scripts on Fedora 8 – Works perfectly.

Thanks Hsieg , Jso, Joe Rogers and James Redpath for pointing out the bugs i’ve left in the old article.

Shailen is a Technical Consulting Engineer at Intel Corporation. He has a Master degree in Computational Science and Engineering from the Technical University of Munich and a Bachelor degree in Electrical Engineering and Computer Science from Jacobs Univerity Bremen. Shailen has conducted research in power modelling for HPC applications and has high interests in the mobile sector. At Intel, Shailen is responsible for the Intel Integrated Native Developer Experience (INDE) suite of software for mobile developers. Shailen comes from the beautiful island of Mauritius. He has a LinkedIn and a Xing profile. Lastly, his name is unique in the world and he admires Bill Gates.

Tagged with:
Posted in Fedora, Linux, Philosophy, Ubuntu, Windows
18 comments on “How-to disable Touchpad on Linux
  1. twilight says:

    Acer Laptops have a hotkeys for touchpad disabling with absolutely no configuration necessary.

    I use Arch Linux but never gave a try to Fedora. The 8th edition looks good and I am interested in trying it.

    Like

  2. anneberly says:

    hi i thought we’re going to xlink..so where is my link? lols.. I dont think i’ll be able to appreciate linus but I’ve heard a lot of good security on it when it come to hacking..good for business…

    I will put ur link to mine now ok…gud blogging day to you

    Like

  3. hsieg says:

    Strange… I was full of hope when I saw that, but it desperately refuses to work. The problem is with the “touchpad stop” command which always gets me the status:
    bash: ./touchpad: cannot execute binary file
    which is quite odd: seems this is not a valid executable file (387 bytes, just in case)…
    I am actually running fedora core 7, so this should be the proper configuration. “uname -a” gets me:
    Linux nx0165.nextenso.alcatel.fr 2.6.23.1-21.fc7 #1 SMP Thu Nov 1 21:09:24 EDT 2007 i686 i686 i386 GNU/Linux
    So this should be fine. Any idea, a I am really starting to get pissed at that touchpad and getting close to glue a piece of wood on top of it… Thanks

    Like

  4. Hi Hsieg,

    Thank you for pointing out something I forgot to write in the post. Actually the problem here lies in the fact that the touchpad script hasn’t been given executable properties.

    What you have to do, is execute the command below on the script:
    su
    chmod +x /touchpad

    Then try the /touchpad stop
    It should work. Keep me informed howz its going over there..

    Kind regards,

    I have updated my article to cope with the problem you had.

    Thanks.

    Like

  5. Joe Rogers says:

    I am having the same issue as hsieg. I am running as root, and the touchpad script has executable permissions. The file is a binary file, and the operating system won’t run it. Any ideas?

    Thanks.

    Like

  6. jso says:

    Thank you for the scripts. They are working well for me except for enabling the touchpadboot script for autostart. Whenever I use the command:
    /sbin/chkconfig –add /etc/init.d/touchpadboot
    (BTW, note that it is –add not -add as above in the article)
    I get the following error:
    error reading information on service /etc/init.d/touchpadboot: No such file or directory
    But, the file is there, is properly chmod’d to 755 and chown’d to root:root.
    Any ideas?

    Thanks!

    Like

  7. jso says:

    OK< so in my case, (Enterprise Linux 5) I had to switch the order of the arguments:
    su
    cd /etc/init.d
    chkconfig touchpadboot –add

    That did the trick!

    Thanks!

    Like

  8. @jso:
    Hello, that’s great. Maybe I should include your trick into the article 🙂
    Btw, try to enter Services from the Administration menu. Try to click start and stop and see if you get the desirable effect.

    Clicking start shoud..hmm stop the touchpad, and obviously, stop, should start the touchpad, because you are actually stopping a scrip that stops the touchpad 8-|

    Anyway,

    I hope that helps,
    Come back if you have any issue, we shall help each other.

    Kind regards,

    Like

  9. Richard says:

    Excellent! I’ve been trying to kill my touchpad ever since I switched over to linux. The touchpad script works flawlessly. Here is a tip for people who want to make this happen on boot for Ubuntu w/ Gnome, though: you don’t need touchpadboot. To make it happen on startup, just go through System->Preferences->Sessions and add “touchpad stop” as a new startup program. Very simple and you don’t have to go traipsing about init.d.

    Anyway, thank you for writing this up! I love you.

    Like

  10. James Redpath says:

    Thank god you have this posted. It has been so frustrating. I tried this on a purchased license Linux Enterprise Desktop 2.6.18-92.1.6.el5 on Sony Vaio and it works. What a relief.

    It a appears that you have a typo for the chkconfig add command, it needs two hyphens. But I think that is from the cut and paste for the font.

    /sbin/chkconfig –add /etc/init.d/touchpadbootave a typo

    Thank you Jim.

    Like

  11. Michalak says:

    Hello. Thanks for hint about using synclient.
    To switch on/off my touchpad where plug in/on a mouse I created a script like this:

    (
    while true
    do
    synclient TouchpadOff=`lsusb | grep Mouse | wc -l`
    sleep 10
    done
    ) &

    You can put it in session stratup scripts (if in init.d you must add full paths to all tools – synclient,lsusb,grep,wc).

    Like

  12. Brilliant work Michalak! This is why a adore blogging – People come up with their ideas, and you learn from them, while sharing your own knowledge.

    Hope your little piece of code will help other blog viewers.

    Keep up the good job!

    Like

  13. Mario says:

    thanks a lot;

    works like a charm!

    Regards

    Like

  14. arnav says:

    i want to use f11 my touchpad has become irresponsive but sometimes responds sensitively how could i disable it

    Like

  15. Anonymous Coward says:

    “Linux’es”? Jesus H. Christ. It’s “Linux distributions”.

    Like

  16. Otto says:

    The scripts link is broken. Can you fix that? Thanks.

    Like

  17. This article, “How-to disable Touchpad on Linux Shailen Sobhee : Blog” was amazing.
    I’m printing out a clone to present to my buddys.

    I appreciate it,Dick

    Like

  18. Thanks for your personal marvelous posting! I truly enjoyed
    reading it, you will be a great author.I will make certain to bookmark your blog and may come back later in life.
    I want to encourage you to continue your great writing, have a nice holiday weekend!

    Like

Leave a comment

Blog Stats
  • 234,880 hits