Skip to content

Instantly share code, notes, and snippets.

@yvon
Last active August 23, 2018 07:56
Show Gist options
  • Save yvon/d52a6a832eea9ade0ac3827b2a98757b to your computer and use it in GitHub Desktop.
Save yvon/d52a6a832eea9ade0ac3827b2a98757b to your computer and use it in GitHub Desktop.
Automatically configure trackpoint speed of Lenovo ThinkPad Compact USB Keyboard when plugged in

Automatically configure trackpoint speed of Lenovo ThinkPad Compact USB Keyboard when plugged in.

  1. Install and enable atd service

  2. Add an udev rule. /ect/udev/rules.d/10-trackpoint.rules:

ACTION=="add", ATTR{idVendor}=="17ef", ATTR{idProduct}=="6047", RUN+="/home/yvon/configure-lenovo-thinkpad-usb-keyboard-trackpoint/udev-receiver.sh"
  1. Edit setup-keyboard.sh and
  • edit HOME variable path
  • update xinput configuration to your preferences
#!/bin/sh
HOME="/home/yvon"
LOGFILE="$(dirname "$0")/log"
DISPLAY=':0.0'
XAUTHORITY="$HOME/.Xauthority"
DEVICE='pointer:Lenovo ThinkPad Compact USB Keyboard with TrackPoint'
MAX_TRIES=4
COUNT=0
while [ $COUNT -lt $MAX_TRIES ]; do
(
xinput set-prop "$DEVICE" "Device Accel Constant Deceleration" 0.30 &&
xinput set-prop "$DEVICE" "Device Accel Profile" 6
) > $LOGFILE 2>&1
if [ $? -eq 0 ];then
exit 0
fi
sleep 1
let COUNT=COUNT+1
done
exit 1
#!/bin/sh
echo "$(dirname "$0")/setup-keyboard.sh" | at now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment