You are not logged in.

#1 2009-05-29 20:23:52

Venator85
Member
From: Italy
Registered: 2007-10-18
Posts: 62

[SOLVED] Can't disable synaptics touchpad by udev rule

Hi, I have a Dell notebook with a synaptics touchpad, and I'd like to disable it when I plug a mouse in, and reactivate when I disconnect the mouse. I found that the following udev rule will do the job:

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"

but it doesn't work. Note that I can successfully activate/deactivate the touchpad manually by issuing the above synclient commands, and that the path of synclient above is correct.
However, the udev rule does work: if I replace the commands to be executed with '/bin/touch /home/venator/touchpad_off' and '/bin/touch /home/venator/touchpad_on', these 2 files are actually touched in my home dir.
Can you help me?
Thanks big_smile

Last edited by Venator85 (2009-05-30 08:13:46)

Offline

#2 2009-05-30 06:41:20

ndowens04
Member
Registered: 2009-05-07
Posts: 25

Re: [SOLVED] Can't disable synaptics touchpad by udev rule

I currently have a usb mouse i bought today, it is working, i dont even use a Xorg.conf file, as it is not needed with the recent xorg and as long hal is running. even though my usb mouse is pluged in my touchpad will work still but i dont mind as long as my usb mouse works.


ArchLinux + ZFS

Offline

#3 2009-05-30 06:48:14

Venator85
Member
From: Italy
Registered: 2007-10-18
Posts: 62

Re: [SOLVED] Can't disable synaptics touchpad by udev rule

ndowens04 wrote:

I currently have a usb mouse i bought today, it is working, i dont even use a Xorg.conf file, as it is not needed with the recent xorg and as long hal is running. even though my usb mouse is pluged in my touchpad will work still but i dont mind as long as my usb mouse works.

Sounds a bit off-topic to me... big_smile

Offline

#4 2009-05-30 06:54:31

ndowens04
Member
Registered: 2009-05-07
Posts: 25

Re: [SOLVED] Can't disable synaptics touchpad by udev rule

Venator85 wrote:
ndowens04 wrote:

I currently have a usb mouse i bought today, it is working, i dont even use a Xorg.conf file, as it is not needed with the recent xorg and as long hal is running. even though my usb mouse is pluged in my touchpad will work still but i dont mind as long as my usb mouse works.

Sounds a bit off-topic to me... big_smile

not really, that's what i would do if i was you tongue ignore the touchpad and just use the mouse :-)


ArchLinux + ZFS

Offline

#5 2009-05-30 07:25:44

Venator85
Member
From: Italy
Registered: 2007-10-18
Posts: 62

Re: [SOLVED] Can't disable synaptics touchpad by udev rule

I normally would, but it so strange that synclient and udev work separately but not together... I'm intrigued smile
Besides, I'm constantly and accidentally touching the touchpad, clicking all over... My cat does that as well, loving to lay down on the palm rest of the notebook lol

Last edited by Venator85 (2009-05-30 07:26:05)

Offline

#6 2009-05-30 08:00:47

Venator85
Member
From: Italy
Registered: 2007-10-18
Posts: 62

Re: [SOLVED] Can't disable synaptics touchpad by udev rule

Update: replaced the synclient command in the udev rule with a script calling synclient and redirecting stdout/stderr to file:
new udev rules:

ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/home/venator/Desktop/touchpad off"
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/home/venator/Desktop/touchpad on"

/home/venator/Desktop/touchpad

#!/bin/bash
[ "$1" = "off" ] && cmd='TouchpadOff=1' || cmd='TouchpadOff=0'
/usr/bin/synclient $cmd >/home/venator/log_$1 2>&1

Here's what I have in the log files:

No protocol specified
Failed to connect to X Server.

I tried to add
export DISPLAY=':0.0'
to the script before calling synclient but nothing changes.

Any hints, other than let it go? smile

Offline

#7 2009-05-30 08:13:32

Venator85
Member
From: Italy
Registered: 2007-10-18
Posts: 62

Re: [SOLVED] Can't disable synaptics touchpad by udev rule

SOLVED!
It was enough to add the -s option (force shm mode) when calling synclient.

Offline

#8 2010-09-12 22:38:54

pirateofms
Member
Registered: 2010-05-10
Posts: 23

Re: [SOLVED] Can't disable synaptics touchpad by udev rule

I know I'm bringing up an old one, but what do I do now that the -s flag doesn't work anymore?  I can get the script to fire, but the log still complains about not having an X server.

Offline

#9 2010-09-13 17:17:41

barto
Member
From: Budapest, Hungary
Registered: 2009-10-22
Posts: 88

Re: [SOLVED] Can't disable synaptics touchpad by udev rule


“First principle, Clarice. Simplicity” – Dr. Hannibal Lecter

Offline

Board footer

Powered by FluxBB