From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bakshi" Date: Fri, 05 Nov 2010 04:45:41 +0000 Subject: Re: udev rules behaves opposite when executing startx Message-Id: <201011050433.oA54Xgu8018769@dcnode-01.unlimitedmail.net> List-Id: References: <201011040436.oA44amxS002870@dcnode-01.unlimitedmail.net> In-Reply-To: <201011040436.oA44amxS002870@dcnode-01.unlimitedmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Any clue please ?? On Thu, 4 Nov 2010 14:15:01 +0530 "J. Bakshi" wrote: > On Thu, 4 Nov 2010 10:07:41 +0530 > "J. Bakshi" wrote: > > > > > Hello list, > > > > Here is my udev rules which disable touchpad when I plug my usb external mouse, and enable it again, when removing the mouse > > > > ``````````````````` > > ACTION="add", SUBSYSTEM="input", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority" RUN+="/usr/bin/synclient TouchpadOff=1", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' " > > > > ACTION="remove", SUBSYSTEM="input", ENV{ID_CLASS}="mouse" RUN+="/usr/bin/synclient TouchpadOff=0", RUN+="/bin/su user1 -c 'DISPLAY=:0.0 notify-send %k ' " > > `````````````````````````````` > > > > The rules is running well within X. But only when I start my WM with startx , then the rules behaves opposite. With no mouse attached , the touchpad is still inactive. Though by pluging/unpluging the mouse, the rules start working normally. I don't understand why startx makes the rules behave so. Could anyone give me any clue please ? > > > > Thanks > > -- > > I wonder, if there is any alternative to disable/enable the touchpad, irrespective of DISPLAY ( i.e. ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/user1/.Xauthority" ). Hence the rules will work well whenever it detects the mouse, in X and in console. > >