Modern computers are getting more and more complex, and so do the tasks we can execute with them. On the other hand, we, the users should simply concentrate on the core of our tasks: so let the computer do most of our work. In the end, a computer should never lower our creativity and productivity. As a result, an efficient and effective user interface is crucial nowadays. But what makes a user interface good? Well, first of all, it should be simple to use, thus supporting a clear layout. In addition, a GUI should be in some sense intelligent in that it respects the current context of running/active programs, so that only the minimal required information is displayed.
One good thing about Linux is that one can customize its UI anyway you like it, as long as you have the expertise and time. In recent years, the user interface of Ubuntu Unity (now called Unity 3D sometimes) has greatly improved. However, Unity UI is not perfect yet: there are some aspects which should be improved as soon as possible – simple changes, but resulting in huge improvements.
First, icons for open and closed programs are currently hard to distinguish. Second, the task bar always shows a program’s title being rarely needed – at least it is much less needed as a program’s menu. As a simple rule, use the desktop space as best as you can, an only for the most important things. Just consider the following scenario: when browsing the net with firefox, do you really need a panel showing you that you are currently using firefox (maybe along with a website title which is rarely needed in practice)? Instead, it should show common commands/tasks (or at least the ordinary menu bar).
Getting and compiling source code
To start customizing Unity, you need the source code. I strongly recommend to use the source code for the currently installed version of Unity – this will make your life much easier.[1] The article Building Unity very well explains the basic steps to get you started. In case you are only interested in experimenting with alternative user interfaces and don’t want to spend a lot of hours reading posts and compiling libraries, don’t use the command bzr branch lp:unity trunk. Instead, manually download the source code for your Unity. Also, please check out the list of bug reports to save time as much as you can.
After downloading, simply follow the next steps on this webpage: Install build dependencies, compile NUX and then compile Unity. In general, you may need to install more libraries.[2]
The Launcher
After compiling and successfully running your compiled Unity, edit some icons/images in ~/staging/share/unity/X, where X is the major version of your Unity branch, e.g. 4, 5, 6, 7 etc. This directory contains images for the launcher, the panel and other components.[3] Now is the time for getting creative: study this directory and edit the images while using your favourite image editor (Gimp, Krita, Photoshop or whatever).
| launcher_bfb.png | Launcher Icon |
| launcher_icon_back_54.png | Background of icon (launcher) |
| launcher_icon_edge_54.png | Edge of icon (launcher) |
| launcher_icon_glow_62.png | Glow of icon (launcher) (when minimizing programs, program asks for user interaction) |
| launcher_icon_shadow_62.png | Shadow of icon (launcher) |
| launcher_icon_shine_54.png | Shine of icon (launcher) |
| launcher_icon{_selected}_back_150.png | Back of icon (switcher) |
| launcher_icon{_selected}_edge_150.png | Edge of icon (switcher) |
| launcher_icon_glow_200.png | Glow of icon (switcher) (used when active) |
| launcher_icon_shadow_200.png | Shadow of icon (switcher) |
| launcher_icon_shine_150.png | Shine of icon (switcher) |
As an alternative, download the launcher icon pack and extract the files to this directory. Use these images to get you started.
Now we have to edit the source code to improve the padding and margin of icons – it’s just a few lines. Locate the file Launcher.cpp (it’s in ~/code/unity/{YOUR_VERSION}/plugins/unityshell/src/).
1. Change the value of the constant ICON_PADDING to 0, somewhere around the line 96: const int ICON_PADDING = 0;. This makes your icons directly stick to the launcher edges.
const int ICON_PADDING = 0;
2. Locate the method Launcher::SetIconSize() and add the line tile_size += 25; immediately at the beginning of this method, before any other lines. I have done this because the should be a padding between the tile and the icon itself. Unfortunately, the source code author has not clearly distinguished between padding and margin.
void Launcher::SetIconSize(int tile_size, int icon_size) {
tile_size += 25;
_icon_size = tile_size;
_icon_image_size = icon_size;
_icon_image_size_delta = tile_size - icon_size;
_icon_glow_size = icon_size + 14;
icon_renderer->SetTargetSize(_icon_size, _icon_image_size, _space_between_icons);
Resize();
}
The Panel
When working with programs, the most important tasks should be displayed in the panel, instead of the title. By default, when moving the cursor over the panel reveals the menu bar. This behaviour should be changed so that the menu bar is always displayed when having a program active, but not when using the switcher or the dashboard.
To edit this behaviour, study the header file “PanelMenuView.h” and look for the private boolean state variable _is_inside, which is true when ever the mouse is over the panel. The principle is either to keep this variable always true, or to ignore this variable when rendering the panel. Since the first approach is a bit counter productive (more work; worse logic), I would just ignore _is_inside in the method bool PanelMenuView::DrawMenus() const (somewhere around line 336). That’s it – for now at least. Remake Unity and run the new build (by using unity-env and unity --replace &).
bool PanelMenuView::DrawMenus() const
{
auto wm = WindowManager::Default();
bool screen_grabbed = (wm->IsExpoActive() || wm->IsScaleActive());
if (_we_control_active && !_overlay_showing && !screen_grabbed &&
!_switcher_showing && !_launcher_keynav)
{
if (_last_active_view || _show_now_activated || _new_application)
{
return true;
}
}
return false;
}
Making Changes Permanent
Since the above changes should be used whenever using your Ubuntu account, edit or create the file ~/.bash_profile and add these lines to directly use your custom Unity environment when logging in to Ubuntu:
# ~/.bash_profile
# The personal initialization file, executed for login shells
# Unity-dev: use local development unity files and settings
export PATH=~/staging/bin:$PATH
export XDG_DATA_DIRS=~/.config/compiz-1/gsettings/schemas:~/staging/share:/usr/share:/usr/local/share
export LD_LIBRARY_PATH=~/staging/lib:${LD_LIBRARY_PATH}
export LD_RUN_PATH=~/staging/lib:${LD_RUN_PATH}
export PKG_CONFIG_PATH=~/staging/lib/pkgconfig:${PKG_CONFIG_PATH}
export PYTHONPATH=~/staging/lib/python2.7/site-packages:$PYTHONPATH
Now Get Creative
It’s time to customize your Unity the way you like it and need it for your daily work, and improve your productivity. Edit the image files, or experiment with the source code. If you want to get further, use the latest source code, but be aware of a lot of dependent libraries which you have to compiled as well, and many unknown/severe bugs in development version.
Further recommended improvements:
1. Change the launcher icon size to 33 (either via “All Settings” > “Appearance”, or via ubuntu-tweak)
2. Set the panel opacity to 0.3 with ubuntu-tweak
The improvements I presented here are far from perfect – they show what you can do with Ubuntu Unity and what would make a better user interface. You can download the launcher icon pack and the two source files to reflect the changes.
Below is a gallery of possible changes which would greatly improve Unity. And maybe see these changes in future releases.








- Only download the latest version if you definitely plan to contribute to Unity. But be prepared to manually compile a lot of additional dependent libraries and possibly unstable code.^
- To find out which additional libraries are needed, check out the output of the command “make” – it checks dependencies.^
- The system wide installed Unity uses a similar organisation:
/usr/share/unity/X. However, never manually edit these files as this is asking for trouble!^


















