You are not logged in.
Niiiice. I'll repost some kind of final version of that script here. Just in case
#!/bin/bash
# Script to toggle on/off touchpad on all local running X-servers at the same time
# Not tested for network usage
echo "Checking for running X servers..."
if [ `pidof X | tr " " "\n" | wc -l` != "0" ]
then
echo "Have running X servers."
save=$DISPLAY
totalX=`pidof X | tr " " "\n" | wc -l`
Xwithnum=`pidof X | xargs ps p | grep X | awk '{print $6}' | grep [0-9] | wc -l`
dispNums=`pidof X | xargs ps p | grep X | awk '{print $7}' | grep [0-9]`
diff=`expr $totalX - $Xwithnum`
if [ "$diff" = "1" ]
then
echo "Toggling on :0"
#export DISPLAY=":0"
#/usr/bin/synclient touchpadoff=$1
fi
Xwithnum=`expr $Xwithnum + 1`
while [ $Xwithnum -gt 1 ]
do
disp=`echo $dispNums | cut -d':' -f$Xwithnum`
echo "Toggling on :$disp"
#export DISPLAY=":$disp"
#/usr/bin/synclient touchpadoff=$1
Xwithnum=`expr $Xwithnum - 1`
done
export DISPLAY="$save"
else
echo "No running X servers. Repeating"
/bin/sh /usr/bin/touchpadtoggle $1 &
exit
fi
Hmm did I understand you correctly that with this version of touchpadtoggle I don't need the addition in .xinitrc anymore?
Because without it it isn't working.
EDIT:
The script at all seems not to work on my system.
Last edited by orschiro (2010-03-19 00:19:04)
Offline
no. you stiil need xinitrc addition in any case.
use that version that works with your config.
Hi there,
Checking this thread for the same problem, I fixed mine with these rules :
ACTION=="add", SUBSYSTEM=="input", ENV{ID_MODEL}=="Optical_USB_Mouse", ENV{DISPLAY}=":0", RUN+="/usr/bin/synclient TouchpadOff=1"
ACTION=="remove", SUBSYSTEM=="input", ENV{ID_MODEL}=="Optical_USB_Mouse", ENV{DISPLAY}=":0", RUN+="/usr/bin/synclient TouchpadOff=0"
It seems to me that the code on the wiki page has an error. With Udev rules one can read an environment parameter with "==" and set one with "=".
In wiki code we see ENV{ID_CLASS}="mouse" and this means setting this parameter to "mouse" not checking for it's value. Anyway, I used the command :
udevadm monitor --property > ./log.txt
and plugged my mouse. I noticed this :
KERNEL[1275735778.322259] add /devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0/input/input15/event8 (input)
UDEV_LOG=3
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0/input/input15/event8
SUBSYSTEM=input
DEVNAME=input/event8
SEQNUM=1597
MAJOR=13
MINOR=72
UDEV [1275735778.325319] add /devices/pci0000:00/0000:00:1d.0/usb1/1-1 (usb)
UDEV_LOG=3
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb1/1-1
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/009
DEVTYPE=usb_device
PRODUCT=46d/c016/340
TYPE=0/0/0
BUSNUM=001
DEVNUM=009
SEQNUM=1592
ID_VENDOR=Logitech
ID_VENDOR_ENC=Logitech
ID_VENDOR_ID=046d
ID_MODEL=Optical_USB_Mouse
ID_MODEL_ENC=Optical\x20USB\x20Mouse
ID_MODEL_ID=c016
ID_REVISION=0340
ID_SERIAL=Logitech_Optical_USB_Mouse
ID_BUS=usb
ID_USB_INTERFACES=:030102:
MAJOR=189
MINOR=8
DEVLINKS=/dev/char/189:8
As I did not found any ID_CLASS in the results, I used the ID_MODEL.
Reading this thread also I learned we need to export the DISPLAY parameter for the synclient to work.
I tried to set it in the Udev rule too and it worked! Thanks for your great information.
Now if I could find a way to disable tapping without xorg.conf or hal .fdi files before logging in, that would be good.
Offline
add this to rc.local?
I _know_ its not what you are looking for - but here's another way ...
"rmmod psmouse" in /etc/rc.local (seeing that I almost always use a usb-mouse)
If I dont have a mouse, "modprobe psmouse" on the command line (I always boot up to the cli - then startx) - thus I always have some kind of pointing device available by the time X comes upI must admit I don't like playing around with 'rules' - rmmod/modprobe works fine for me.
It was what I was looking for however. Thank you. I went the 'rules' approach a few months ago when I first bought this laptop and found out it was useless if the touchpad was active. Google, the ArchWiki, and several hours of frustration somehow shut it off but apparently a recent update undid my work.
Hopefully your KISS method will be included in the ArchWiki.
Offline