[xubuntu-users] Touchpad
Shaun Marolf
shaun.marolf at gmail.com
Thu Jan 12 14:15:09 UTC 2012
What I want is simple, getting it to happen -- not so much. I want to
get my laptop to use a hot-plug event to turn off the touchpad when it
sees my mouse plugged in. I have added the hot plug rules but they were
written for Gnome not Xfce4.
Here are the rules:
/etc/udev/61-touchpad.rules
# 61-touchpad.rules
#
# this rules file must be named 61* or later because it won't work
# unless it runs after '/lib/udev/rules.d/60-persistent-input.rules'
#
# NOTE: will only affect DISPLAY :0
#
# run:
# udevadm test --action=add
/sys/devices/platform/i8042/serio1/input/input6/mouse1
# or similar to test the following rules
#
# disable PS/2 touchpad on DISPLAY :0 if a mouse is added to the system
ACTION=="add", SUBSYSTEM=="input", ENV{ID_INPUT_MOUSE}=="1",
RUN+="/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop PS/2\ Generic\
Mouse Device\ Enabled 0'"
# enable PS/2 touchpad on DISPLAY :0 if a mouse is removed from the system
ACTION=="remove", SUBSYSTEM=="input", ENV{ID_INPUT_MOUSE}=="1",
RUN+="/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop PS/2\ Generic\
Mouse Device\ Enabled 1'"
/etc/pm/sleep.d/99touchpad (also located at /etc/pm/power.d)
#!/bin/sh
#
# disable touchpad if more than one mouse is available
#
# NOTE: will only affect DISPLAY :0
#
disable_touchpad()
{
/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop PS/2\ Generic\
Mouse Device\ Enabled 0'
}
case "$1" in
thaw|resume)
if [ `ls -d /sys/class/input/mouse* | wc -l` -gt 1 ]; then
disable_touchpad
fi
;;
*) exit $NA
;;
esac
The following was supposed to be added to gdm config but Xubuntu uses
another Desktop Manager and that is probably the issue:
# disable touchpad if more than one mouse is available
if [ `ls -d /sys/class/input/mouse* | wc -l` -gt 1 ]; then
/usr/bin/xinput --set-prop PS/2\ Generic\ Mouse Device\ Enabled 0
fi
I would really like to get this to work so any hep would be greatly
appreciated.
--
It isn't about it being free. Rather, its about the freedom it brings.
More information about the xubuntu-users
mailing list