Web Devout tidings

How to: Enable edge mouse wheel rotate in Gutsy

Update: It seems this solution only works until you log out, and it has to be applied again. At the bottom I’ve written a script to do this automatically.

When I upgraded to Ubuntu Gutsy (7.10), there was one thing that annoyed me about its version of Compiz Fusion: I’m used to rotating my desktop cube (well, octagonal prism for me) by moving my mouse cursor near the screen edge and rotating the mouse wheel, but that no longer seems to work.

In the past, you’d enable this through the CompizConfig Settings Manager by going to Rotate Cube → Actions → General → Rotate Left / Rotate Right, enabling all edges, and setting button 4 for left and button 5 for right. But that doesn’t work in this version, because the Rotate Left and Rotate Right settings are bound to the general Gnome keyboard shortcuts (that’s what the blue text in the Name column means). So you can change the settings, and it doesn’t give you any errors, but it just doesn’t do anything.

But fear not! The problem is that the settings manager just isn’t bothering to change the Compiz Fusion gconf entry when you change it. So the solution is to just go in and change it yourself. Here are the steps:

(First of all, keep in mind that this issue and solution are only for people using the Rotate Cube plugin, which isn’t enabled in Ubuntu Gutsy’s default profiles. If you aren’t using the Rotate Cube plugin, this probably won’t interest you.)

  1. You’ll need the Configuration Editor. Although this application doesn’t appear in your menus, it should be installed on your system by default. In case it isn’t, you can install it by going to Applications → Add/Remove… → System Tools → gconf-editor; or if you prefer a command line, typing “sudo apt-get install gconf-editor” in a terminal.

  2. Press Alt+F2 to bring up the Run dialog, and type “gconf-editor” to bring up the Configuration Editor.

  3. In the Configuration Editor, navigate to / → apps → compiz → plugins → rotate → allscreens → options.

  4. Double-click on rotate_left_edge (not rotate_flip_left_edge). Add the following values: Top, TopRight, Right, BottomRight, Bottom, BottomLeft, Left, and TopLeft. Press OK.

  5. Double-click on rotate_left_edgebutton, change the value to 4, and press OK.

  6. Double-click on rotate_right_edge and add the same values as in step 4. Press OK.

  7. Double-click on rotate_right_edgebutton, change the value to 5, and press OK.

  8. Close the Configuration Editor.

That should be it. Now when you rotate your mouse wheel near the edge of the screen, it will rotate your desktop.

Update: As it turns out, the above solution is only a temporary fix. Once you log out, Compiz seems to forget the setting. Below is a workaround script that you can set to automatically run at the start of each session:

sleep 5
gconftool --type=list --list-type=string --set \\
	/apps/compiz/plugins/rotate/allscreens/options/rotate_left_edge \\
gconftool --type=left --list-type=string --set \\
	/apps/compiz/plugins/rotate/allscreens/options/rotate_right_edge \\
gconftool --type=int --set \\
	/apps/compiz/plugins/rotate/allscreens/options/rotate_left_edgebutton 4
gconftool --type=int --set \\
	/apps/compiz/plugins/rotate/allscreens/options/rotate_right_edgebutton 5
  1. Paste the above into a text editor and save the file as /home/<username>/bin/enable-edge-mousewheel.sh (substituting <username> for your account username).

  2. Open your home directory, then the bin directory. Right-click on the newly created file and click Properties. Click on the Permissions tab and check the box next to Execute. Close the dialog.

  3. Click on your System panel menu, then go to Preferences and Sessions.

  4. Click the Add button. For Name, put “Enable Edge Mouse Wheel“. For Command, put “/home/<username>/bin/enable-edge-mousewheel.sh“. Click OK.

  5. Close the windows.

5 Responses to “How to: Enable edge mouse wheel rotate in Gutsy”

  1. Paulus Says:

    Thanks a million! I’ve been looking for a work-around for this strange misbehavior for a long time.

    Posted using Opera 9.50 on Linux.

  2. Paulus Says:

    Incidently, I think you need to enable the execute permission by running “chmod +x ~/bin/enable-edge-mousewheel.sh” in a terminal for this to work.

    Posted using Opera 9.50 on Linux.

  3. Kyu / Dragon Wolf Says:

    I only defined Right and Left for each of those fields, and haven’t noticed any ill effects. Also, instead of using a whole script, why not simple use “sudo gconf-editor” and the right click each of the fields, and use set as default. Wouldn’t that be an easier fix, or will those values vanish upon reboot as well? (haven’t had the need to reboot since making the changes).

    - Kyu / Dragon Wolf

    Posted using Mozilla Firefox on Linux.

  4. David Hammond Says:

    For me, it would reset every time I rebooted, which is why I used a script instead.

    Posted using Mozilla Firefox 3.0b on Linux.

  5. muriloq Says:

    Thanks for this. With me the problem started after an update (I believe it was to Gnome 2.4).

    Posted using Mozilla Firefox 3.0b5 on Linux.