Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change Logitech Mouse Button Keys in Ubuntu Vivid

Change Logitech Mouse Buttons in Ubuntu

Dependencies

We'll need to install xbindtools and xev prior to configuring our mouse buttons:

sudo apt-get install xev xbindtools

Explore Button Numbers

First, find out what button number you are trying to set using 'xev'

This can be run from the command line simply by typing 'xev' - the tool will popup in a separate window. Mouse over this window in order to test the keys and watch the command line output to find the button number.

Make an Xbindtools Config File

Then write a config file to handle the key you want to change. For example, on my Performance MX, I wanted to set the "zoom" button to "back":

cat << EOF >> ~/.xbindkeysrc
"xdotool key Alt_L+Left"
m:0x0 + b:13
EOF

Test the Custom Button Mapping

Next, reload xbindkeys in order to activate your changes:

xbindkeys -p

Shell Script

If you have a wireless mouse you can run this configuration elsewhere with the following file:

#!/bin/bash
sudo apt-get install xbindkeys
cat << EOF >> ~/.xbindkeysrc
"xdotool key Alt_L+Left"
m:0x0 + b:13
EOF
xbindkeys -p

Source

Much of this was cribbed from the following answer on AskUbuntu: http://askubuntu.com/a/101126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment