summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/touchpad.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/touchpad.sh b/scripts/touchpad.sh
new file mode 100644
index 0000000..9726abd
--- /dev/null
+++ b/scripts/touchpad.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Craig Jennings <c@cjennings.net>
+
+# https://wiki.archlinux.org/title/udev#Waking_from_suspend_with_USB_device
+
+# lsusb | grep Logitech
+# Bus 007 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
+
+# grep c52b /sys/bus/usb/devices/*/idProduct
+# /sys/bus/usb/devices/1-1.1.1.4/idProduct:c52b
+
+# udevadm monitor
+# (plug / unplug device)
+# pick highest path, as
+# sudo udevadm info --attribute-walk --path=/devices/pci...
+# will show all attributes for the parents
+
+# https://www.reactivated.net/writing_udev_rules.html#basic
+# udevinfo -a -p /sys/bus/usb/devices/1-1.1.1.4/idProduct:c52b
+
+echo "THIS SCRIPT ISN'T MEANT TO BE RUN YET."
+exit 1
+
+
+echo -e 'SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{manufacturer}=="Logitech", ATTRS{product}=="USB Receiver", ACTION=="add", RUN+="/usr/bin/xinput set-prop \"PIXA3854:00 093A:0274 Touchpad\" \"Device Enabled\" 0"' > /etc/udev/rules.d/01-touchpad.rules
+
+echo -e 'SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{manufacturer}=="Logitech", ATTRS{product}=="USB Receiver", ACTION=="remove", RUN+="/usr/bin/xinput set-prop \"PIXA3854:00 093A:0274 Touchpad\" \"Device Enabled\" 1"' >> /etc/udev/rules.d/01-touchpad.rules
+
+
+# ---------------------------------- Testing ----------------------------------
+
+echo -e 'SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{manufacturer}=="Logitech", ATTRS{product}=="USB Receiver", ACTION=="add", RUN+="/usr/bin/notify-send "Logitech Receiver Added to USB."' > /etc/udev/rules.d/01-touchpad.rules
+
+
+echo -e 'SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{manufacturer}=="Logitech", ATTRS{product}=="USB Receiver", ACTION=="remove", RUN+="/usr/bin/notify-send "Logitech Receiver Removed From USB."' >> /etc/udev/rules.d/01-touchpad.rules