From: Andrew Sichevoi Date: Sun, 24 Jan 2021 08:24:01 +0000 (+0100) Subject: Initial commit X-Git-Tag: v0.0.1~2 X-Git-Url: http://git.thekondor.net/?a=commitdiff_plain;h=707cabaf5f495288ab1d29752177ca399a9369e9;p=reset-trackpoint-fix.git Initial commit --- 707cabaf5f495288ab1d29752177ca399a9369e9 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