Skip to content

Instantly share code, notes, and snippets.

@dimaqq
Created January 13, 2022 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimaqq/52ced8970a63d2278a9b77f30100773c to your computer and use it in GitHub Desktop.
Save dimaqq/52ced8970a63d2278a9b77f30100773c to your computer and use it in GitHub Desktop.
# Thinkpad X1 has two middle buttons:
# area at the bottom of the touchpad
# and physical buttons above touchpad that are part of trackpoint
function fix_middle_button -d "remap middle buttons to prmiary"
string match -r 'Touchpad.*id=(?<id>[0-9]+)' (xinput list)
if test -n "$id";
xinput set-button-map "$id" 1 1 3 4 5 6 7 8 9 10 11 12
end
string match -r 'TrackPoint.*id=(?<id>[0-9]+)' (xinput list)
if test -n "$id";
xinput set-button-map "$id" 1 1 3 4 5 6 7 8 9 10 11 12
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment