How to Keep the Compiz Cube Zoomed Out and in 3D

Don’t worry. This blog isn’t turning into a tech tips blog. I’ve just been dreaming about 3D desktops for years and then it all comes at once along with everything else that Ubuntu has to offer. A working copy of Compiz is installed from the distro CD. It is setup to provide a change desktop animation which will probably be enough for most people. Here it is with a few other things turned on.

Your basic “cube” showing all available desktops.

NASA TV in 3D. Could it be called “virtualised TV” ? That’s full frame video running there, not a thumbnail. It’s a live window.

At a watchable size.

I didn’t know it could do this until I had to resize a maximised window. Peek at what’s underneath :P

The 3D windows from another perspective.

Your classic desktop view with the 3D tastefully visible in the background. You can just see the menu that is open, visible on one of the other desktops on the right.

So no more “Living in a box…. I’ve been living in a cardboard box !” as that 80’s song goes.

3D movement is almost completely free as long as the middle mouse button is held down over the desktop. But it won’t stay in that position once the mouse button is released (grrrr!), and will snap back to whatever desk is nearest. This just seems such a shame as I can’t admire this work of beauty with it’s virtualised video and everything. So after looking into accessibility options I found a way of locking the middle mouse button down.

It’s a bit of a hack, but it does use a legitimate way of altering X server mouse behaviour. I wonder if there’s a way of doing this already built into Compiz ? If there is, no one would tell me. Google would not find it.

In Ubuntu … (Note: “\\” shows where I had to split the line. It should all be on one line.)

Make sure you have a backup of your X server config file.

sudo cp /etc/X11/xorg.conf \\
/etc/X11/xorg.conf.bak

Edit it …

sudo vim /etc/X11/xorg.conf

If you don’t like the command line you can use this …

gksudo gedit /etc/X11/xorg.conf

Find this section …

Section "InputDevice"
        Identifier "Configured Mouse"
        Driver "mouse"
        Option "CorePointer"
EndSection

Add this line …

Option "DragLockButtons" "3 2"

The section will now look like this …

Section "InputDevice"
        Identifier "Configured Mouse"
        Driver "mouse"
        Option "CorePointer"
        Option "DragLockButtons" "3 2"
EndSection

The first number after “DragLockButtons” is the button to be toggled. In this case button 3, the middle mouse button on my three button mouse. The second number is the mouse button to use to activate the toggle.

Save the xorg.conf file. Type “:”, then “wq”.

Logout of Ubuntu and then back in again. That will restart the x server without having to restart the entire system.

Now you can click the right mouse button over a clear area of desktop and the middle mouse button will lock allowing free rotation of the compiz cube. You can walk away and leave it in mid rotation. Hit the right mouse button again to let Compiz focus back to the active desktop.

There’s only one drawback here if you only have three mouse buttons. The defined lock button can no longer be used as a normal mouse button ! I just use the right click key on my keyboard.

Users with more than three buttons can set the lock toggle button to an unused mouse key and won’t have this problem. Just set the second number to whatever mouse button you want to use.

DJ Barney

Addendum: If you do use a multi button mouse then make sure you use one number in the “lock” field (see above). Click that button and then the next button you press will lock. It’s a toggle lock, so the next time you click that button the lock will be cancelled.

8 thoughts on “How to Keep the Compiz Cube Zoomed Out and in 3D

  1. This last Christmas, my son showed me Ubuntu and the Compiz cube and I enjoy the eye candy but like you, I want the cube to maintain 3D and rotate slowly thru the sides. I even would like it to be my screen saver if possible. I can see there is even a practical use for this as you can have a chat window open and an email window open and be able to see when activity happens. However, as I am very new to Ubuntu and not sure which server? I am running, when I plug in your values to my terminal window I get:
    sudo cp /etc/X11/xorg.conf \\
    /etc/X11/xorg.conf.bak
    cp: cannot stst ‘/etc/X11/xord.conf’: No such file or directory

    I am using the latest Ubuntu 8.10

  2. Pingback: Solution to Keeping Compiz Rotate Cube Active « DJ’ing, Music, Humour, Life

  3. Pingback: Happy 2011 !!! Plus 2010 in review « DJ'ing, Music, Humour, Life

Leave a reply to BobbyS Cancel reply