I don't grasp why your rule is so complex? Especially this section
ENV{ID_MODEL}=="USB_Mouse",\
ENV{DISPLAY}=":0",\
ENV{XAUTHORITY}="/home/nikitautiu/.Xauthority",\
ENV{REMOVE_CMD}="/usr/bin/synclient TouchpadOff=0"
In the first line you match the environment variable ID_MODEL
which is only seen by udev
against USB_Mouse
. In the following three lines you assign values to environment variables. Again only seen by udev
and the executed command synclient
if the rule is applied.
I'm pretty sure that this rule is never applied (You can check this by parsing udev
's log file.) since it is likely that there is no variable ID_MODEL
with content USB_Mouse
accessible unless you set ID_MODEL
in the udev
environment previously.
I suggest that you match against the Action, the vendor-ID and the product-ID of your mouse, which will suffice in most cases. Then your rule looks like
ACTION=="add", ATTRS{idVendor}=="<idVendor>", ATTRS{idProduct}=="<idProduct>", RUN+="/usr/bin/synclient TouchpadOff=1"
You can get <idVendor>
and the <idProduct>
by parsing the output of
lsusb -v
I don't remember if the given hex-values are allowed in the classical form 0xffff
. I always take only the part behind 0x
in my rules.