Skip to content

Instantly share code, notes, and snippets.

@Gen2ly
Created May 31, 2012 17:44
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 Gen2ly/2844992 to your computer and use it in GitHub Desktop.
Save Gen2ly/2844992 to your computer and use it in GitHub Desktop.
Touchpad-button-fix - toggles left and right mouse/touchpad buttons and back
#!/bin/bash
# Touchpad-button-fix - toggles left and right mouse/touchpad buttons and back
# Again (fixes issue with missed touchpad buttons clicks)
# Detect mouse button position, switch mouse button position, then switch back
for l in {1..2}; do
state=$(xmodmap -pp | sed -n '5p' | awk '{ print $2 }') # detect button posit.
if [ "$state" == "1" ]; then
xmodmap -e "pointer = 3 2 1" &> /dev/null
sleep 2
else
xmodmap -e "pointer = 1 2 3" &> /dev/null
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment