There is more than one way to getting your extra mouse buttons to work in Linux. However the results vary from mouse to mouse, and there is no guarantee that any of these tricks will work.
First off if you like to use those extra side buttons to navigate in a browser( Example: back and forward). Then you might find that firefox already does this for you. This is because firefox has that feature hardcoded in. So it may work from the start for you. If not then here is something you can try.
You will have to make some edits to your xorg.conf file.
So open up a terminal and type: sudo gedit /etc/X11/xorg.conf
Find the section that looks like this:
Identifier "Configured Mouse"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
It should look something like that.
First thing you can change is to comment out the line that says Option "Emulate3Buttons" "true"
. Since your mouse probably has a scroll wheel.
So it would now look like this: B]#Option "Emulate3Buttons" "true"[/B]
Next, make sure the Driver Xorg is using is the “mouse” driver. This is already correct in the above example code.
You can leave the Option “CorePointer” there, and the same with the Option “Device”. You do NOT want to change this if your mouse is already working. However, if your mouse is not working then you would want to change the location path (Example of other location paths you might try: /dev/mouse, /dev/input/mouse)
The next thing you will want to change is the Option “Protocol”. You will want to replace “ImPS/2” (or what ever is there) with “ExplorerPS/2”.
So the line would look something like this: Option "Protocol” “ExplorerPS/2”
Now you want to add the follow option in with the others:
Option “Buttons” “7”
The number of buttons depends on the number of buttons on your mouse, but remember that the scroll wheel counts as 3.
Make sure the option “ZAxisMapping” is present and has the parameter “4 5”.
If your mouse has two scroll wheels or a mouse that has a scroll that tilts side to side then you can try the parameter “4 5 6 7”. So either:
Option “ZAxisMapping” “4 5”
Option “ZAxisMapping” “4 5 6 7”
(depending on your needs)
Also one other thing you can add is the resolution, that is if your mouse supports a high resolution, like most current gaming mice do.
Just add: Option “Resolution” “1800”
(the 1800 can be what ever the highest you mouse can support, for mine thats 1800).
That is all for the xorg.conf file so save it, but before you restart Xorg, you still should do a few more things to make your life easier.
Using you favorite simple text editor (Example: vi, vim, nano, gedit, kate) open a new text document and type: pointer = 1 2 3 4 5 6 7
Now save this text file as .xmodmap
and save it in your home directory (Example: /home/username).(Remember “username” needs to be replaced by your real username)
Now if your a KDE user, you can do the following:
Add the following into a new text file: xmodmap ~/.xmodmap
and save it as startup.sh
is the following directory: /home/username/.kde/Autostart
And in a terminal type: chmod +x /home/username/.kde/Autostart/startup.sh
Now the command: xmodmap ~/.xmodmap, is run everytime you log into KDE.
For Gnome users, you should be able to do the same instructions for the KDE users, but just change the location where you save the file startup.sh. However I am not that similar with Gnome, so I am not sure if there is an Autostart folder or not.
If you are not a KDE user and a confused Gnome user, then you can try the following.
See if the file .xinitrc exist in one of the two following locations: /root , or /home/username
To see if its there, try running the following two commands in the terminal:
sudo ls -a /root/ | sed -n /.xinitrc/p
<-need to be root, so thats why sudo is added.
ls -a ~/ | sed -n /.xinitrc/p
<-run as your normal user
If one of these locations has the .xinitrc file then open it in your favorite text editor: (NOTE: If the file .xinitrc is in both of these locations, then you can either edit both of them or the one that is in the users account home that you log into the most. Changing it in one location doesn't change it in the other).
Example (in a terminal): kate /path/.xinitrc
(add sudo to the front if .xinitrc is in the directory /root)
Now add the following line to .xinitrc: xmodmap /path/to/file/.xmodmap
Save .xinitrc. The file .xinitrc is ran everytime Xorg is started.
NOTE: If you are a KDE user and you have a .xinitrc file, then it does not matter which of the above methods you choose. Just don't add it to both.
Now that this is all done you can restart Xorg (either by login out and then back in or by pressing <ctrl>+<alt>+<backspace key>).
Now in a web browser you should hopefully be able to use the thumb buttons on your mouse as back and forward buttons.
If you wanted to use the extra mouse buttons to execute a program then look into a program called IMWheel.
Home Page: http://imwheel.sourceforge.net/
Some one else's Howto on it can be seen here: http://legroom.net/howto/mouse
I didn't feel like writing anything up on that since I have little experience with IMWheel.
Some thing that might help you if you want to use IMWheel: http://imwheel.sourceforge.net/imwheelrc
Again I just want to say that there is no guarantee that any of the above will work, but I am able to have my thumb buttons on my mouse work as back and forward. Mouse is a Logitech MX518.