Ubuntu and Unity – quick hints

As those of you who work with me on daily basis know, I moved all my machines to Linux, more specifically to Ubuntu a couple of years ago. And I am a happy camper – most of the days.

Last week I had one of these things where a colleague walked up and reported that he had lost the Unity desktop and had to work through Gnome – which is not a problem. 
I went through this myself a few times on earlier versions. Ubuntu just dropped Unity at some point which makes it fairly hard to do anything if you don’t get a menue or anything else on the Graphical shell.
The problem though is relatively simple by it’s nature. After some research I found out that Compiz had simply disabled the Unity plugin – renabling solves the problem.
Now, with a useless graphical environment, that’s hard. Sure, one can go through gnome, but it should go easier than that.
As usually you get at least the desktop and it’s Icons, my first solution was a simple exacutable bash script on my desktop to at least get to a terminal – from where I can launch ccsm (compiz config settings manager) and reenable the Unity plugin.
Last week, when I was helping the colleague, I had to drill deeper into this. It would be relatively easy to solve the problem if it was just a text based file where the entry need to be made – reality is that compiz now stores it’s settings as gconf settings – so no way to easily edit a text file from a command line.
After some research and some tries – also through the graphical GConf Editor – I found the solution (I guess) 🙂
The following command reads what we need from GConf:

gsettings get org.compiz.core:/org/compiz/profiles/Default/plugins/core/ active-plugins

if you have a problem with Unity, unityshell should not be listed there – so when you turn this around and do a set instead, copy and paste what you have and add unityshell as active plugin, this should do the trick for you. For me the commandline looks like this:

gsettings set org.compiz.core:/org/compiz/profiles/Default/plugins/core/ active-plugins “[‘core’, ‘composite’, ‘opengl’, ‘move’, ‘resize’, ‘place’, ‘wall’, ‘imgpng’, ‘regex’, ‘vpswitch’, ‘mousepoll’, ‘grid’, ‘compiztoolbox’, ‘session’, ‘wobbly’, ‘animation’, ‘expo’, ‘fade’, ‘workarounds’, ‘ezoom’, ‘scale’, ‘unityshell’, ‘switcher’]”


Now you can just take this and customize it – as a simple script (that I have now stored in my home directory), this is doing the magic to fix the problem now – even from a simple terminal….

#!/bin/sh
gsettings get org.compiz.core:/org/compiz/profiles/Default/plugins/core/ active-plugins
read -p “Resetting to my default [YeS/No] ” response
if [ $response = “YeS” ];
  then 
    gsettings set org.compiz.core:/org/compiz/profiles/Default/plugins/core/ active-plugins “[‘core’, ‘composite’, ‘opengl’, ‘move’, ‘resize’, ‘place’, ‘wall’, ‘imgpng’, ‘regex’, ‘vpswitch’, ‘mousepoll’, ‘grid’, ‘compiztoolbox’, ‘session’, ‘wobbly’, ‘animation’, ‘expo’, ‘fade’, ‘workarounds’, ‘ezoom’, ‘scale’, ‘unityshell’, ‘switcher’]”
  else
    echo “No harm done ! Exiting”;
  fi


I have build in some extra security as I know how carefully I read prompts – it makes it a little harder to overwrite something I don’t want to be overwritten…
Would be happy if this helps somebody on the next Unity failure – at a bare minimum this is now my own documentation 😉
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s