summaryrefslogtreecommitdiff
path: root/scripts/touchpad.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-05-27 21:13:17 -0400
committerCraig Jennings <c@cjennings.net>2024-05-27 21:13:17 -0400
commitb8d544dd5ff7b2d769c23723c24a2b33ad4e550f (patch)
treee0996a6ada4ca5e2bd5986970de7505cff902c0d /scripts/touchpad.sh
parent0fc45ebe243d66236018417ba1890289a3eee7ed (diff)
updating tasks, better comments, minor fix, wip: touchpad script
fix: - google-chrome-stable package is now google-chrome script: - looking at writing a script that identifies when the Logitech device is attached/detatched so I could turn the touchpad off/on
Diffstat (limited to 'scripts/touchpad.sh')
-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