You are not logged in.
I have this udev rule:
# Disable Touchpad while USB mouse is present and Enable it when USB mouse is not
ACTION=="add", ATTRS{idVendor}=="1532", ATTRS{idProduct}=="006e", \
ENV{XAUTHORITY}="/home/kritiqual/.lyxauth", ENV{DISPLAY}=":0", \
ENV{REMOVE_CMD}="/usr/bin/xinput enable 'DELL097B:00 04F3:30C3 Touchpad'", \
RUN+="/usr/bin/xinput disable 'DELL097B:00 04F3:30C3 Touchpad'"This works fine if I test on a normal environment. But, if I restart my computer, and the usb mouse remain plugged in, then the mouse cannot be used and not being recognized by the system (not showing in
xinput listfor example)
Offline
There's no X11 server during the boot and the run command will fail.
https://wiki.archlinux.org/title/Udev#X … is_present
Test for the presence of an xorg process or even better: import the environment from there (as well)
https://gist.github.com/AladW/de1c5676d93d05a5a0e1 (this is for xinit)
Online
Alternatively, just get rid of the dependency on X (and XAUTHORITY and DISPLAY) all together. Identify the actual relevant device node (e.g., /sys/class/input/mouseN) then just have the udev rule write a 1 or 0 to /sys/class/input/mouseN/inhibited . Alternatively, use one of the by-path nodes which might be more stable (the numbered nodes *might* change order between boots).
(edit: that may actually be easier yet with a udev command to set the attribute without invoking any external command - but I don't know the syntax for this off the top of my head).
Last edited by Trilby (2023-06-15 21:06:21)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline