Skip to content

Instantly share code, notes, and snippets.

@dimaqq
Created August 10, 2023 00:00
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/356146216427dc77110d70c4766f0328 to your computer and use it in GitHub Desktop.
Save dimaqq/356146216427dc77110d70c4766f0328 to your computer and use it in GitHub Desktop.
# Set up ThinkPad X1 Carbon trackpad on Ubuntu to behave kindof like Mac
#
# dima@kuro ~> functions fix_middle_button
# Defined in /home/dima/.config/fish/conf.d/no-middle-button.fish @ line 6
function fix_middle_button --description '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 1 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