I have a nice multi-button Logitech Performance MX and like to map my two thumb buttons to the scale and expo compiz plugins.
[please note that this has changed in Ubuntu 12.10]
For a slightly more user-friendly option than cprofitt's gconf-editor solution, try compizconfig-settings-manager . It has a searchable interface, is specialized for customizing compiz, and restricts your input to valid options (to reduce mistakes).
Install it and run it with
You can search for plugins by name. "expo" and "scale" will work for you.
The button next to each option in the Bindings tab shows the current binding. Most of them probably say Disabled.
Click the "Disabled" text next to "Expo Button", check enabled, and select your button. It may take experimentation to figure out what number your desired buttons are.
Follow a similar process for Scale. There are three options:
Compizconfig-settings-manager is really great for setting keyboard commands, because there's a grab button that lets you type the key combo.
The first step is to hit
You then need to find the expo and scale plugin entries as shown below.
If you want to use corners you would use the 'expo-edge' for expo and 'initiate-all-edge' for scale. The edges are case sensitive.
BottomRight, TopRight, etc.