Disable the auto-hide functionality of Ubuntu Unity 2D

The current version of Unity 2D that comes with Ubuntu 11.04 Beta 2 does not feature any sort of configuration panel and unfortunately there is no easy way to disable the auto-hide feature of the Unity 2D panel. Here is a short script that will give you an icon on your Unity panel to toggle (enable or disable) the auto-hide functionality:

Copy the following script to
/usr/local/bin/unity-2d-toggle-autohide.sh :

#!/bin/sh

if [ $(gconftool-2 --get /desktop/unity-2d/launcher/hide_mode) -eq 0 ]; then
        autoHide=1
        useStrut=false
else
        autoHide=0
        useStrut=true
fi

gconftool-2 --type=int --set /desktop/unity-2d/launcher/hide_mode $autoHide
gconftool-2 --type=bool --set /desktop/unity-2d/launcher/use_strut $useStrut

Now create a menu entry for this helper script and save it as
/usr/share/applications/unity-2d-toggle-autohide.desktop :

[Desktop Entry]
Name=Toggle Unity 2D Panel Auto-Hide
Comment=Enabled or disables Unity 2D's panel auto-hide functionality
Icon=gnome-fs-desktop
Exec=unity-2d-toggle-autohide.sh
Terminal=false
Type=Application
Categories=Utility

Finally from the Terminal start nautilus /usr/share/applications and add the new entry “Toggle Unity 2D Panel Auto-Hide” to your Unity 2D panel via dragging and dropping.

Clicking on it will toggle auto-hide.