udev (How To Auto-Disable The Touchpad When The Mouse Is Plugged In (Fedora 13))
I have a Synaptics touchpad device on Ubuntu 11.04 unity
After adjusting the scripts appropriately (available upon request), if I do a
udevadm test --action=add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input12/mouse0
I get (at the end of a big dump)
udevadm_test: run: '/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop SynPS/2\ Synaptics\ TouchPad Device\ Enabled 0''
(terminated with two 's)
if I type the stuff within the outer 's (/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop SynPS/2\ Synaptics\ TouchPad Device\ Enabled 0')
I get my touchpad to turn off. And if I do the same with the remove command, I get it to give a command that if I run manually, it'll turn my touchpad back on.
but...here's the kicker: it's not being triggered as appropriate
if I try to run this with the mouse not plugged in, it doesn't work presumably because the test program needs the mouse to be plugged in to actually activate the script? I get a response like "unable to open device '/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input14/mouse0'"
when I run a test to see how many mice I have plugged in and I have one external and one int, I get a response of 2. no externals and only an internal, I get a response of 1. So everything seems to be kosher there.
Any ideas? udev seems to be running because if I try to start the service, it won't let me. but it will let me restart.
Odd thing is, if I disable it with the external mouse inserted, then unplug it, my internal tracker thing doesn't turn on. But if I plug the external mouse back in, then the trackpad is usable again. Reversing the add/remove in the script doesn't help. Enable 1/0 seems to work correctly manually
As some synaptics rules were in the 60s higher than 61, I renamed to 99. Another interesting thing from the test command is as follows
$ udevadm test --action=add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input24/mouse0 2>&1 | grep "udev_rules_apply_to_event"
udev_rules_apply_to_event: MODE 0640 /lib/udev/rules.d/50-udev-default.rules:23
udev_rules_apply_to_event: IMPORT 'input_id /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input24/mouse0' /lib/udev/rules.d/60-persistent-input.rules:7
udev_rules_apply_to_event: IMPORT 'usb_id --export /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input24/mouse0' /lib/udev/rules.d/60-persistent-input.rules:8
udev_rules_apply_to_event: LINK 'input/by-id/usb-Logitech_USB-PS_2_Optical_Mouse-mouse' /lib/udev/rules.d/60-persistent-input.rules:23
udev_rules_apply_to_event: IMPORT 'path_id /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input24/mouse0' /lib/udev/rules.d/60-persistent-input.rules:32
udev_rules_apply_to_event: LINK 'input/by-path/pci-0000:00:1a.0-usb-0:1.2:1.0-mouse' /lib/udev/rules.d/60-persistent-input.rules:33
udev_rules_apply_to_event: RUN '/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop SynPS/2\ Synaptics\ TouchPad Device\ Enabled 0'' /etc/udev/rules.d/99-touchpad.rules:17
that have anything to do with anything?