Initial commit
authorAndrew Sichevoi <k@thekondor.net>
Sun, 24 Jan 2021 08:24:01 +0000 (09:24 +0100)
committerAndrew Sichevoi <k@thekondor.net>
Sun, 24 Jan 2021 08:24:01 +0000 (09:24 +0100)
reset-trackpoint-fix.conf [new file with mode: 0644]
reset-trackpoint-fix.service [new file with mode: 0644]
reset-trackpoint-fix.sh [new file with mode: 0755]

diff --git a/reset-trackpoint-fix.conf b/reset-trackpoint-fix.conf
new file mode 100644 (file)
index 0000000..abdec09
--- /dev/null
@@ -0,0 +1,2 @@
+### Uncomment this line and set it to SerIO device which corresponds to a Trackpoint input
+#DEVICE=serio1
diff --git a/reset-trackpoint-fix.service b/reset-trackpoint-fix.service
new file mode 100644 (file)
index 0000000..8a77520
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Trackpoint's state reactivation
+After=suspend.target
+
+[Service]
+User=root
+Type=oneshot
+ExecStart=/usr/bin/reset-trackpoint-fix.sh
+TimeoutSec=0
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target sleep.target
diff --git a/reset-trackpoint-fix.sh b/reset-trackpoint-fix.sh
new file mode 100755 (executable)
index 0000000..290e852
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. /etc/reset-trackpoint-fix.conf
+
+if [ -z "${DEVICE}" ]; then
+  echo "*** No Trackpoint SerIO device specifed. Do nothing."
+  exit 1
+fi
+
+for mode in none reconnect; do
+  echo "- Put ${DEVICE} to '${mode}' state"
+  echo -n ${mode} > /sys/bus/serio/devices/${DEVICE}/drvctl
+done