Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-19 12:16:59

#! CrunchBanger
Registered: 2012-03-07
Posts: 114

HowTo - Toggle touchpad when (dis)connecting a USB mouse

There already exists a how-to for disabling the touchpad when a USB mouse is plugged in during boot by rhowaldt.

This doesn't work, though, when the mouse is plugged in after starting X, and the touchpad stays off after unplugging the mouse.
For toggling to work, you have to create a file /etc/udev/rules.d/01-touchpad.rules with following content:

ACTION=="add", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="02", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", ENV{REMOVE_CMD}="/usr/bin/synclient TouchpadOff=0", RUN+="/usr/bin/synclient TouchpadOff=1"
  • The three values "ATTR{bInterface*}" should catch every USB mouse.

  • Replace USERNAME with your username.

  • without ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/USERNAME/.Xauthority" synclient  gives an error about being unable to connect to the X and a missing protocol.

I tested this in #! Waldorf and Arch, maybe someone wants to give it a try in Statler?

See also: … mouse-rule … _detection

I forgot to mention, you still need rhowaldt's bash file and entry in autostart for the mouse to be disabled on login - the udev rules only work when the mouse is connected after booting up.

Last edited by sano (2012-10-19 12:22:42)


Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo