You are not logged in.
Hi, I've been running Arch on this laptop, but I can't get this udev rule to work properly.
What I want to happen is: when I plug in my usb mouse, the laptop touchpad is disabled, and the left and right buttons are reversed (I'm left handed)
After following several tutorials, both from the arch wiki and other sites, I've come up with this udev rule:
ACTION=="add", SUBSYSTEM=="input", RUN+="/usr/local/bin/USBMouse.sh"
ACTION=="remove", SUBSYSTEM=="input", RUN+="/usr/local/bin/USBMouse.sh"
And here's the script it links to (USBMouse.sh):
#!/bin/bash
export DISPLAY=:0.0
synclient TouchPadOff=$(/usr/bin/lsusb | grep "Microsoft Corp.\
Nano Transceiver v1.0 for Bluetooth" | wc -l)
if [[ $(/usr/bin/lsusb | grep "Microsoft Corp.\
Nano Transceiver v1.0 for Bluetooth" | wc -l) == 1 ]]
then
xmodmap -e 'pointer = 3 2 1'
fi
if [[ $(/usr/bin/lsusb | grep "Microsoft Corp.\
Nano Transceiver v1.0 for Bluetooth" | wc -l) == 0 ]]
then
xmodmap -e 'pointer = 1 2 3'
fi
Running the script from a terminal returns no errors and works as expected. The problem is when I plug/unplug the mouse from the usb port, nothing happens.
I appreciate any insight you might have about how to fix this, and thank you in advance
Offline
This has already been done. And another relevant thread.
Offline