Created
April 11, 2015 16:43
-
-
Save synther/eeeb7e5b4596f6ed3774 to your computer and use it in GitHub Desktop.
enable right click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "$0 <device id|device name>" | |
exit 1 | |
fi | |
i=0 | |
while read label min delim max; do | |
if [ $i -eq 0 ]; then | |
minx=$min | |
maxx=$max | |
elif [ $i -eq 1 ]; then | |
miny=$min | |
maxy=$max | |
break | |
fi | |
(( i++ )) | |
done < <(xinput list "$1" | grep Range) | |
left=`echo \($maxx - $minx\) / 2 + $minx | bc -l` | |
right=$maxx | |
top=`echo \($maxy - $miny\) \* 0.8 + $miny | bc -l` | |
bottom=$maxy | |
#Changed per https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-synaptics/+bug/944961 | |
#xinput set-prop "$1" "Synaptics Right Button Area" $left $right $top $bottom | |
xinput set-prop "$1" "Synaptics Soft Button Areas" $left $right $top $bottom 0 0 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment