Ubuntu and Logitech M705 buttons

(This is less about the M705 and more about how to configure mouse buttons in Ubuntu 14.04.)

Goal

Figure 1: Unity Spread

I typically have a cluttered display with many windows open and therefore many windows hidden behind others. Ubuntu 14.04 has a neat feature called 'Unity Spread' that scales all the windows to fit on the display and lets you click on the window you want to be on top. But, I prefer to access the function with a mouse button rather than the keyboard shortcut, <SUPER>+W.

This seemed like it would be easy and in the end it was. However it took much longer to figure out the process than I expected due to terminology confusion. This exercise shows how I finally got the configuration I wanted.

Preparation

The tool you need, compizconfig-settings-manager, is probably not installed, but that is easily handled:

$ sudo apt-get install compizconfig-settings-manage

Next we need to know how the physical buttons map to button numbers. I used xev to empirically figure out the map:

Procedure

The procedure is simple: open the compizconfig-settings-manager tool and set the mouse binding for Unity Spread to the button of your choice.

The complication is that there is no setting, or group of settings, labeled Unity Spread. And if you think the control would be associated with the Ubuntu Plugin, then you would be wrong.

Instead the function that you need to find is the Window Picker settings. And they are part of the Scale Plugin!

Once you figure out the right terminology, the setup is actually easy:

1. Start the compizconfig-settings-manager (from the command line it is ccsm) and select the Window Management plugins:

2. Open the Scale plugin and choose the Bindings tab:

3. Click on the Default button across from the mouse icon with the label Initiate Window Picker next to it. Click Enabled box and the dialog will look like this:

4. Use the drop down selector to choose a mouse button. I like to use Button 9, the front button on the side of the Logitech M705 mouse.

I also assigned Button 8 to the Initiate Window Picker for All Windows action. I could not find a difference between the Initiate Window Picker action and the Initiate Window Picker for All Windows action, so it doesn't matter which button I press, my cluttered desktop:

turns into this:

as long as I hold the button. Which ever window my pointer is over when I release the button comes to the front of the window pile.

Options

Button Bindings Toggle Scale Mode

If you check this box at the top of the Scale plugin/Bindings tab then clicking the mouse button spreads the windows and then you can click on a window to select it. If it is not checked, then the windows stay spread as long as you hold the button. When you release the button the window that the pointer is located over becomes the selected window.

Roller tilt buttons

You might prefer to use these buttons, particularly if you already make use of the side buttons actions in your browser (see the Side Effects below).

Side Effects

Loss of browser forward/back action

The side buttons seem to be assigned as Foward/Back actions in both the Firefox and Chrome browsers. Configuring them as described here over-rides their browser functionality.

Questions

    1. What is the difference between Initiate Window Picker, Initiate Window Picker For All Windows, Initiate Window Picker For Window Group, and Initiate Window Picker For Windows On Current Output?

  1. Where are the browser forward/back actions assigned? It might be nice to re-assign those to the scroll wheel tilt buttons.

Feedback

You can contact me about this exercise by commenting on my Google+ post.