From 707cabaf5f495288ab1d29752177ca399a9369e9 Mon Sep 17 00:00:00 2001 From: Andrew Sichevoi Date: Sun, 24 Jan 2021 09:24:01 +0100 Subject: [PATCH 1/1] Initial commit --- reset-trackpoint-fix.conf | 2 ++ reset-trackpoint-fix.service | 13 +++++++++++++ reset-trackpoint-fix.sh | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 reset-trackpoint-fix.conf create mode 100644 reset-trackpoint-fix.service create mode 100755 reset-trackpoint-fix.sh diff --git a/reset-trackpoint-fix.conf b/reset-trackpoint-fix.conf new file mode 100644 index 0000000..abdec09 --- /dev/null +++ b/reset-trackpoint-fix.conf @@ -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 index 0000000..8a77520 --- /dev/null +++ b/reset-trackpoint-fix.service @@ -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 index 0000000..290e852 --- /dev/null +++ b/reset-trackpoint-fix.sh @@ -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 -- 2.20.1