#!/bin/sh # Set the mouse buttons appropriately for mouse on left or right side. # Invoke this under the name 'lmouse' or 'rmouse' (via symlink). NAME=`basename "${0}"` UNUSED_BUTTONS="4 5 6 7 8 9 10" if [ "${NAME}" = "lmouse" ]; then xmodmap -e "pointer = 1 2 3 ${UNUSED_BUTTONS}" elif [ "${NAME}" = "rmouse" ]; then xmodmap -e "pointer = 3 2 1 ${UNUSED_BUTTONS}" else echo "WARNING: Unrecognized invocation name: '${NAME}'" >&2 fi # xmodmap might print a warning; if that warning is confusing, see # https://gitlab.freedesktop.org/xorg/app/xmodmap/issues/2 # https://gitlab.freedesktop.org/xorg/app/xmodmap/merge_requests/1 # One could also use 'xinput --list' followed by something like # 'xinput --set-button-map ID_OR_NAME 1 2 3'.