LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-23-2011, 07:39 AM   #1
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Rep: Reputation: 9
Question How to auto disable the synaptic touchpad if usb mouse present?


Hi all

Is there a way to disable the synaptic touchpad automatically if a usb mouse is plugged into the laptop? This touchpad gets in the way when typing and I mainly use my laptop with an usb mouse connected anyway.

Would like to have the touchpad disabled if an usb mouse is present.
 
Old 07-23-2011, 08:15 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
This is on my TODO list for a Synaptics touchpad. What sort of touchpad do you have?

Preparatory research found this on the ArchLinux BBS:

To automatically disable Touchpad on plugging in USB mouse and vice versa:
Code:
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/home/venator/Desktop/touchpad off" 
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/home/venator/Desktop/touchpad on"
/home/venator/Desktop/touchpad:
Code:
#!/bin/bash 
[ "$1" = "off" ] && cmd='TouchpadOff=1' || cmd='TouchpadOff=0' 
/usr/bin/synclient -s $cmd >/home/venator/log_$1 2>&1
 
Old 07-23-2011, 08:18 AM   #3
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by catkin View Post
This is on my TODO list for a Synaptics touchpad. What sort of touchpad do you have?

Preparatory research found this on the ArchLinux BBS:

To automatically disable Touchpad on plugging in USB mouse and vice versa:
Code:
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/home/venator/Desktop/touchpad off" 
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/home/venator/Desktop/touchpad on"
/home/venator/Desktop/touchpad:
Code:
#!/bin/bash 
[ "$1" = "off" ] && cmd='TouchpadOff=1' || cmd='TouchpadOff=0' 
/usr/bin/synclient -s $cmd >/home/venator/log_$1 2>&1
Hi thanks, I also use a synaptic touchpad.
 
Old 07-23-2011, 09:00 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Are you OK with following a procedure similar to the one suggested on the ArchLinux BBS?
 
Old 07-23-2011, 10:40 AM   #5
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Rep: Reputation: 56
Wow, I was actually thinking about doing the same thing too last night and stumbled upon a similar thread here http://www.linuxquestions.org/questi...inkpad-864828/. I figured since I was on the same path until I found out that there's a way to disable the Touchpad momentarily while I'm typing through the use of syndaemon I might as well post it here. The parameters I use for syndaemon are:

# -i 2 - sets idle time to 1 seconds - specifies how many seconds to
# wait after the last key-press before enabling the touchpad again.
#
# -t - don't disable mouse movement when typing and only disable
# tapping and scrolling
#
# -k - ignore modifier keys when monitoring keyboard activity (ie:
# allows ctrl+left click)
#
# -d - starts as a daemon in the background

/usr/X11R6/bin/syndaemon -t -k -i 2 -d
 
Old 07-23-2011, 11:03 AM   #6
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by dimm0k View Post
Wow, I was actually thinking about doing the same thing too last night and stumbled upon a similar thread here http://www.linuxquestions.org/questi...inkpad-864828/. I figured since I was on the same path until I found out that there's a way to disable the Touchpad momentarily while I'm typing through the use of syndaemon I might as well post it here. The parameters I use for syndaemon are:

# -i 2 - sets idle time to 1 seconds - specifies how many seconds to
# wait after the last key-press before enabling the touchpad again.
#
# -t - don't disable mouse movement when typing and only disable
# tapping and scrolling
#
# -k - ignore modifier keys when monitoring keyboard activity (ie:
# allows ctrl+left click)
#
# -d - starts as a daemon in the background

/usr/X11R6/bin/syndaemon -t -k -i 2 -d
Hi, it gives me:

Code:
No protocol specified
Can't open display.
 
Old 07-24-2011, 02:23 AM   #7
Totoro-kun
Member
 
Registered: Nov 2010
Location: Kaunas, Lithuania
Distribution: Slackware
Posts: 234

Rep: Reputation: 125Reputation: 125
Hello,
I had similar problem too some time ago. Here is my thread, that may be of use to you. My touchpad was Alps, but the method used should fit any touchpads.

Best regards.
 
Old 07-31-2011, 12:31 PM   #8
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Rep: Reputation: 56
Quote:
Originally Posted by george-lappies View Post
Hi, it gives me:

Code:
No protocol specified
Can't open display.
When are you running syndaemon? I use KDE so I have the above mentioned in a script that's located in ~/.kde/Autostart.
 
Old 08-01-2011, 02:26 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by george-lappies View Post
Code:
No protocol specified
Can't open display.
That happened when you ran the command as root? If so you may (I am not very sure abut this) need your GUI user to allow access by running [[ $DISPLAY ]] && /usr/bin/xhost +localhost during logon and root to export DISPLAY=':0.0' before running the command (change :0.0 to the GUI user's $DISPLAY value).
 
Old 08-01-2011, 04:18 AM   #10
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Howdy:

I forgot where I got this, but I've been using it a while:

Code:
#! /bin/sh
if ! grep -wq psmouse /proc/modules ; then
    /sbin/modprobe -q psmouse; else 
    /sbin/modprobe -r psmouse; 
fi%
I saved it with the name ~/.scripts/tptoggle, made it executable, and then execute it when I plug in the usb mouse, and it disables trackpad...

I ended up using xfce keyboard shortcut to bind F9 key to
Code:
xterm -e sudo ~/.scripts/tptoggle
which disables or enables the trackpad, after prompting for my password.

It doesn't automatically disable or enable it according to presence of usb mouse, but at least it tames the trackpadness.
 
  


Reply



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
[SOLVED] How to disable Alps touchpad when USB mouse is present? Totoro-kun Slackware 14 05-27-2011 01:21 AM
LXer: How To Auto-Disable The Touchpad When The Mouse Is Plugged In (Fedora 13) LXer Syndicated Linux News 0 11-01-2010 11:40 AM
Disable Touchpad If Mouse Present Pauli Linux - General 2 11-20-2007 12:56 AM
synaptic(alps) touchpad coworking with usb mouse. lvgandhi Debian 1 10-06-2005 11:46 AM
how do i disable the touchpad and use only usb mouse oDin420 Ubuntu 4 08-27-2005 01:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:20 AM.

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