11.8.11

Howto: Get the Compiz Desktop Cube in Ubuntu 11.04 Natty and Unity

NOTE: Post updated with corrected Compiz desktop settings. Although the previous setting worked for the cube, it caused issues with AWN’s Shiny Switcher and other desktop switchers. The 4/1/1 arrangement works for everything that I’ve tried.

I’ve posted on my not-so-great experience with Ubuntu 11.04 Natty and Unity here, here, and here. In the latter, I achieved a useful level of function when I augmented Unity with Avant Window Navigator (AWN). AWN gave me back my hardware temperature monitors and an application menu system. However, I still didn’t have a good workplace switcher but did have a good number of crash bugs to which I added a few newly discovered ones today.

The Compiz Cube may seem like eye candy, but I have weaved it tightly into my daily productivity. The Unity Workplace Switcher is basically the Compiz Viewport Switcher, which requires some rounds of the screen with your mouse pointer to change workspaces. The cube requires very little hand movement and no keyboard use when set up optimally.

I thought, because Unity told me, that Unity depended on Compiz’ Desktop Wall. That is, until I stumbled on this launchpad bug report where others like myself pushed hard to get the cube back. It turns out that Unity doesn’t really depend on the Desktop Wall, but on “largedesktop” which both the Cube and Wall provide. In a wonderful response to user requests, the Unity developers changed the explicit dependence in Unity from the Wall to largedesktop. Although they still don’t officially support the Desktop Cube in Unity, power users now have the flexibility.

After discovering this, I immediately opened the Compiz Configuration Settings Manager (ccsm) and enabled the Desktop Cube. As I expected, Compiz protested that the Desktop Wall conflicted with the Cube and asked if I wanted to disable it. I said yes. Compiz then protested that Unity depended on largedesktop in the Wall and asked if I really wanted to disable the Wall. Again I said yes.

Holy screen tsunami, Batman! Unity and Natty crashed in a huge way, rendering the desktop useless! If I didn’t have AWN running in the corner, I have a feeling that would have been all she wrote. Providentially, I was able to work through the system menu in AWN to get the desktop back and proceed on to a fully operational cube.

After thinking about the firestorm, I came up with a sequence of Compiz setting changes that will provide you the cube with very little pain. So, here’s how I recommend proceeding based on my experience.

First, use Update Manager to bring your Natty system totally up to date. Then change the desktop settings in ccsm -> General Settings as shown (NOTE: This has changed from the original post!):

Note that I changed the settings from the Unity default of 2/2/1 to 4/1/1. If you don’t change the settings, you’ll get a plane instead of a cube. This change shouldn’t crash Natty.

Next download any dock program that has menu and logout/shutdown widgets. I like AWN, but you could use Docky, Cairo, whatever, as long as you have a menu widget and logout/shutdown either as part of the menu widget or separate. Place it at the bottom of the screen so that none of the Unity panels lay over it. This is your life line. I have AWN with only the sensor, places, and main menu applets. Actually, places and main menu are the same applet, and main menu provides access to logout/shutdown.

Now, go into ccsm and deselect Unity and Desktop Wall. Your Unity panels will disappear, but don’t worry because you have your other dock with the main menu applet if anything goes wrong. More than likely, this will also clear all of your Compiz settings. So first, under General at the top of ccsm, select Composite, Gnome Capability, and OpenGL. Next select Desktop Cube and Viewport Switcher (if it isn’t already selected), and I also selected Rotate Cube, 3D Windows, and Cube Reflection and Deformation. Ensure that Composite, Gnome Compatibility, OpenGL, and Window Decoration remain selected. That should to it.

I recommend doing the following in the order presented. Select the Ubuntu Unity Plugin and then Unity MT Grab Handles all the way at the bottom and and Regex Matching under Utility. When you select Unity, you will be asked about Reveal Mode which conflicts with Rotate Cube. Enable Reveal Mode anyway. I was also asked about the key to put keyboard-focus on launcher. Again I chose to set it anyway. Same for setting the key to execute a command.

Also select JPEG, Png, and Svg under Image Loading, Compiz Library Toolbox, Bailer, and Workarounds under Utility. Select Move Window, Resize Window, and Static Application Switcher as a minimum under Window Management. Here are all the screens showing the settings that I use, starting at the top of ccsm:

Now logout and log back in – and you’ll do so repeatedly if you want to customize Compiz and the cube from here. Lots of Compiz changes cause Unity to crash, losing the top panel and leaving screen relics behind.

This should work for you without any problems other than what I listed. However, if you get total garbage on the screen and can’t find your way back, open a terminal window from the main menu applet on your safety dock. Type the following line:

unity –replace

That will restart Unity. You won’t have a clean screen, but you should get the core functions back, including the top panel and most of the launcher. Technically you can also reload Unity the same way using Alt-F2, but when Unity crashes it takes that function with it. If that fails, simply log out and log back in.

When you’re all done, you can uninstall the “safety” dock if you so desire.

I tried this process on my test system and it worked exactly as I just described it. I now have perfectly working Desktop Cubes on both Ubuntu 11.04 Natty systems with Unity. Cool (AWN is hiding):

If anyone knows how to get a decent screenshot of a cube in Natty, let me know. I tried both Gnome Screenshot and Shutter, but both produced relics like you see above time after time.

No comments: