Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-26-2016, 02:27 PM   #1
Senior Member
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
Program to enable or disable trackpad depending if USB mouse is connected

Is there a program out there that will automatically disable/enable the trackpad on a laptop when an external mouse is connected to the machine?
Old 06-26-2016, 02:36 PM   #2
Senior Member
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,075

Rep: Reputation: 725Reputation: 725Reputation: 725Reputation: 725Reputation: 725Reputation: 725Reputation: 725
I think I've seen that in some of the Touchpad setting panel in KDE. Otherwise, you can do it with the synaptic daemon settings if your touchpad uses synaptic drivers.

I imagine you could do it with udev, but frankly I've had mixed luck at best any time I've tried doing anything with udev.

I did find this cool little script when searching the 'net for a good answer, though:

declare -i ID
ID=`xinput list | grep -Eio 'touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
declare -i STATE
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
if [ $STATE -eq 1 ]
    xinput disable $ID
    # echo "Touchpad disabled."
    # notify-send 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
    xinput enable $ID
    # echo "Touchpad enabled."
    # notify-send 'Touchpad' 'Enabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
It appears to work, although I've only just tried it for 4 minutes.

Last edited by notKlaatu; 06-26-2016 at 02:37 PM. Reason: added source for script
1 members found this post helpful.
Old 06-26-2016, 08:44 PM   #3
Senior Member
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Thanks! I looked in the normal mouse settings and all it had was to turn it off when typing, but that doesn't even seem to work for that. So do I have to run that script every time I log in?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable and re-enable mouse and keyboard input? weijie90 Linux - Hardware 2 08-12-2007 08:17 PM
Want to use my trackpad and USB mouse on laptop ComputerMan Linux - Hardware 3 02-21-2006 01:22 AM
usb mouse, and tecra 8100 trackpad problems Lanix1 Linux - Hardware 2 12-31-2005 08:58 PM
looking for a enable/disable mouse command to X samel_tvom Linux - Hardware 2 03-03-2005 12:00 PM
USB Mouse and Trackpad Mouse problems macshark Linux - Hardware 6 12-24-2002 11:56 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:16 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration