cscs
9 January 2022 01:27
41
Please revise to:
KERNEL=="mouse*", SUBSYSTEM=="bluetooth*", ATTR{type}=="bluetooth", ACTION=="add", \
RUN+="/usr/bin/xinput disable 'ALP001A:00 044E:121B Touchpad'"
KERNEL=="mouse*", SUBSYSTEM=="bluetooth*", ATTR{type}=="bluetooth", ACTION=="remove", \
RUN+="/usr/bin/xinput enable 'ALP001A:00 044E:121B Touchpad'"
KERNEL=="mouse*", ATTRS{phys}=="usb*", ACTION=="add", \
RUN+="/usr/bin/xinput disable 'ALP001A:00 044E:121B Touchpad'"
KERNEL=="mouse*", ATTRS{phys}=="usb*", ACTION=="remove", \
RUN+="/usr/bin/xinput enable 'ALP001A:00 044E:121B Touchpad'"
Then ā¦ lets also move it up the chain:
sudo mv /etc/udev/rules.d/66-touchpadoff.rules /etc/udev/rules.d/99-touchpadoff.rules
cscs
9 January 2022 01:59
43
And you said it worked before, briefly?
cscs
9 January 2022 02:05
45
I guess, the main difference might be the second entry? Try again without it just to check.
Also we did perform a reload, so maybe check if that somehow kicks it in:
sudo udevadm control --reload
EDIT:
And maybe we could go about it another way. Try with this content:
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/ranaground/.Xauthority", RUN+="/usr/bin/xinput enable 'ALP001A:00 044E:121B Touchpad'"
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/ranaground/.Xauthority", RUN+="/usr/bin/xinput disable 'ALP001A:00 044E:121B Touchpad'"
Note that I used ranaground
as the username, please replace with username on desktop system.
1 Like
in command 'hwdb --subsystem=hid'
0018:044E:121B.0001: hwdb modalias key: "hid:b0018g0004v0000044Ep0000121B"
Does this have anything to do with it? āHidā.
cscs
9 January 2022 02:39
48
Thats for your touchpad, when we are trying to recognize the bt.
ā¦honestly I am not sure why its not working.
Maybe I have overlooked something. Hopefully someone else stops by with a better suggestion.
what is it?
Touch padļ¼
Is it feasible to disable āhidā directly?
hid
standing for H uman I nput D evice, AFAIK, not likelyā¦
ranaground means , he has bluetooth device .
snich
21 September 2022 05:24
52
This worked for me, but instead the touch pad works only when there is an external mouse attached. I flipped the code and now it works perfectly. (Remember to change {username}
with your username, and {touch pad name}
with the device name of your touchpad listed on xinput
).
code:
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/{username}/.Xauthority", RUN+="/usr/bin/xinput disable '{touch pad name}'"
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/{username}/.Xauthority", RUN+="/usr/bin/xinput enable '{touch pad name}"
example:
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/snich/.Xauthority", RUN+="/usr/bin/xinput disable 'DLL07BD:00 06CB:75BF Touchpad'"
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/snich/.Xauthority", RUN+="/usr/bin/xinput enable 'DLL07BD:00 06CB:75BF Touchpad'"
snich
21 September 2022 06:23
53
The only problem now is that the rule will only be triggered when a mouse is unplugged/plugged-in. So, when there is a mouse already plugged-in on startup, the rule will not work as it didnāt detected the mouse got plugged-in. Just correct me if Iām wrong. Iām no Linux expert. @cscs maybe you know a hack for this.
dmt
22 September 2022 11:51
54
You could try removing ACTION=="add",
, or rewrite the rule for disabling the touchpad.
You could trigger an add action in a startup script.
https://wiki.archlinux.org/title/Udev#Triggering_events
1 Like
snich
27 September 2022 01:15
55
I donāt know much about udevadm
, bash
other things about Linux yet, but I know programming.
I created this script instead and it runs when I log-in.
#!/usr/bin/zsh
udevadm info /dev/input/by-id/*-mouse || check=0
if [[ $check == 0 ]]
then
/usr/bin/xinput enable 'DLL07BD:00 06CB:75BF Touchpad'
echo 'Touchpad enabled. No external mouse detected.'
else
/usr/bin/xinput disable 'DLL07BD:00 06CB:75BF Touchpad'
echo 'Touchpad disabled. External mouse detected.'
fi