theYinYeti Posted March 10, 2009 Report Share Posted March 10, 2009 I am aware of the Gnome settings for when I plug a mouse. But this is not what I want. Is there a way to execute something when I plug a mouse, AND when I unplug a mouse. I want to respectively disable, and enable again the touchpad in such case. My touchpad comes in the way when I type text, but sometimes I need it (when no other mouse). For now, I tried a compromise with syndaemon -i 2 -K but that's not satisfactory because the touchpad is unresponsive when I need it, and it keeps clicking randomly when I type text. Yves. Quote Link to comment Share on other sites More sharing options...
scarecrow Posted March 10, 2009 Report Share Posted March 10, 2009 Are you using xorg 1.5.X and evdev input hardware, or an older xorg version without evdev? Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted March 10, 2009 Author Report Share Posted March 10, 2009 Older it seems… [yves@localhost ~]$ rpm -qa | grep -i xorg libxorg-x11-devel-7.3-4mdv2009.0 x11-server-xorg-[b]1.4.2[/b]-10.1mdv2009.0 I don't know much about evdev, but maybe it is used: [yves@localhost ~]$ sed -n '/mouse/,/Section/p' /etc/X11/xorg.conf Driver "mouse" Option "Protocol" "ExplorerPS/2" Option "Device" "[b]/dev/mouse[/b]" EndSection [yves@localhost ~]$ ls -l /dev/mouse lrwxrwxrwx 1 root root 10 2009-03-10 08:58 /dev/mouse -> input/mice [yves@localhost ~]$ ls -l /dev/input/mice crw-r----- 1 root root 13, 63 2009-03-10 09:58 /dev/input/mice [yves@localhost ~]$ ls -l /dev/input/event* crw-r----- 1 root root 13, 64 2009-03-10 09:58 /dev/input/event0 crw------- 1 yves root 13, 65 2009-03-10 09:58 /dev/input/event1 The major number from these event* devices is the same as that of mice, and the minor is very close. Yves. Quote Link to comment Share on other sites More sharing options...
scarecrow Posted March 10, 2009 Report Share Posted March 10, 2009 (edited) Yep... mmm, I guess with evdev disabled/not used any of these suggestions should work: http://llbb.wordpress.com/2007/07/09/auto-...chpad-on-linux/ However, with the evdev driver loaded instead they will probably not work. You will need an appropriate HAL rule instead to be put in /etc/hal/fdi/policy folder, but I can't be sure about its syntax (I'm an xml goofy). Maybe the last suggestion above will work if put in, say, /etc/rc.local or any other multiuser startup script. Edited March 10, 2009 by scarecrow Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted March 11, 2009 Author Report Share Posted March 11, 2009 (edited) Thank you scarecrow :) That worked: I created a “/etc/udev/rules.d/85-synaptics.rules†file with this content: ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=1" ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient TouchpadOff=0" I also added the following new line at the end of both “/etc/X11/gdm/Init/Default†and “/etc/X11/gdm/PreSession/Defaultâ€, just before the “exit 0†last line: /usr/bin/synclient TouchpadOff=`grep -ic mouse /proc/bus/usb/devices` I have yet to see if this works, as I haven't disconnected so far. Yves. Edited March 11, 2009 by theYinYeti Quote Link to comment Share on other sites More sharing options...
scarecrow Posted March 11, 2009 Report Share Posted March 11, 2009 On my Archlinux it's actually /proc/bus/input/devices rather than /proc/bus/usb/devices. The rest are the same. I will test it too. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.