For 11.04 and earlier:
Unity does support custom launchers from .desktop files. To create custom launcher from a
.desktop file you need to create a
*.desktop file for your program.
.desktop file should look something like this:
Name=the name you want shown
Exec=command to run
In your file manager open your home folder and navigate to:
(You may need to press ctrl+h to show hidden files to see the
.gconf-> desktop-> unity-> launcher -> favourites
you'll see a bunch of folders starting with "
you need to create a folder for your program. Use the same name.desktop you used in
/usr/share/applications. Go into 1 of the folders for something that is already on the dock & copy the xml file and paste that into your new folder. Open it with your text editor and change the name of the
*.desktop to your name
Open gconf-editor (you can open gconf by running the command
gconf-editor in the Terminal) & go to:
desktop-> unity-> launcher -> favorites
Double click the list on the right & add your
Log out & back in and you should see your launcher.
(thank you kerry_s on the Ubuntu Forums for helping with this answer)
Unity also has a feature called Lenses. By default, you have two in Unity: Applications and Files. In the future, you will be able to install and create a lot more. There is some info about that on the Ubuntu wiki: https://wiki.ubuntu.com/Unity/Lenses
You only get the one launcher in Unity, but you can simulate a second one if you use a combination of AWN and DockbarX with the appropriate theming. This is how I got a Unity-like interface on my 10.04 LTS desktop before 11.04 came out. The advantage of this is that the second panel that you created is then fully customizable, so you can create the setup you have just described.
DockbarX is not available to install from the default Ubuntu repositories, so I'll show you a way to simulate a second launcher using only AWN, which is available right from the Ubuntu Software Center. I did the steps below on my Precise Pangolin install, but you should be able to follow them on 11.10 as well and most likely older releases.
Simulating a second launcher with AWN
Our goal is to get a second launcher on the right, as pictured below:
First, we need AWN (Avant Window Navigator) installed. Click here to install it, or run in a terminal:
sudo apt-get install avant-window-navigator
This should also install
awn-settings, which will let you manage the settings for AWN.
Now start AWN Settings by searching for it in the dash, and let's start setting up the second launcher.
You'll get a window like that below:
Change all settings to those shown above.
Next, go to the Applets screen. We'll be using the below configuration (but feel free to modify as you please):
The applets, from left to right (the ordering matters), are:
- Cairo Main Menu
- Related applet
- Shiny Switcher
- Expander (Needed to keep the previous applets near the top and the trash at the bottom)
Next, go to Themes and select the Dark Theme. We'll use this as a base for the exact look we want.
Click the Customize button near the bottom of the window to enter this view:
There's a lot of tweaking to do in here. Here are the following changes you need to make (note: I listed colors as a hexadecimal value, or "Color name", and Opacity):
- First Gradient Color: #000000, 170
- Second Gradient Color: #000000, 170
- First Highlight Color: #000000, 0
- Second Highlight Color: #000000, 0
- Outer Border Color: #808080, 100
- Inner Border Color: #000000, 0
- Font: Ubuntu 11
- Fill Color: #000000, 170
- Outline Color: #FFFFFF, 100
In case you're wondering: nope, still not quite done yet! There's some extra settings we need to take care of to position the launcher correctly; otherwise, it'll run over the menu bar at the top of the screen.
Now go into the Advanced screen:
Make sure Force monitor mode? is checked.
Now, make sure you set the following settings to what I've described below. If you don't know what your display resolution is, you can easily look it up by searching for "Displays" in the dash or System Settings.
- Monitor width: Your actual monitor width in pixels
- Monitor height: Your actual monitor height in pixels, minus 24
- Monitor X-offset: 0
- Monitor Y-offset: 24
For good measure, we should also set Reflection alpha multiplier to 0 while we're in here.
Almost done! We have a couple applet tweaks to make, if you decided to keep the Shiny Switcher and Garbage applets I suggested above so they're more like regular Unity. To enter the preferences for either applet, right-click it and select Applet Preferences from the pop-up menu.
Shiny Switcher Preferences
Check that the settings are the same as those pictured (the colors selected are #000000, 255):
Keep Confirm when emptying the trash checked, but uncheck Show the item count on the icon.
One more note! To test out your settings and make sure everything looks right, or if you did not set AWN to start automatically, search
for "Avant Window Navigator" in the dash. I personally found that
certain settings changes may require quitting AWN (via right-click on
the dock itself) and restarting it in order for them to display
Problems like this relate to Unity's application matching framework. To simplify the technical details, program windows and applications are two separate things to Ubuntu. Ubuntu needs to 'guess' which application owns a particular window. And sometimes that guess fails, and a question mark appears in the launcher.
The failure may be due to:
The application shown in the question (KeePass2) suffers from a type 1 problem that has been reported to the appropriate bug tracker.
Examples of problems
The below examples are technical, aimed at programmers who want their own application displaying properly in the Ubuntu launcher.
Problem 3 – No application description
In order for an application to integrate with Unity—that is to say, be searchable in the Dash and placed in the launcher—it needs to have a desktop entry. Such entries are placed in the
$HOME/.local/share/applications/(the latter two being for third party software, system-wide and user-only respectively). They end with a
.desktopextension and follow this basic format:
This entry starts a program by calling the
Execexecutable. Whenever that program displays a window or dialog, Unity will notice that its executable "belongs" to this application description, and use the given
Iconin the launcher.
This is a barebones example. The formal specification covers many advanced features.
Problem 2 – Faulty application description
Let us assume that
my_app.desktopexists in a valid application directory, but:
/file/path/of/my/icondoes not exist in the filesystem.
/file/path/of/my/iconis not an image.
In any of the above case, Ubuntu will be unable to properly list the application window in the launcher.
Problem 1 – A bug in BAMF
As of Ubuntu 11.10, BAMF has a number of bugs that prevents correct application matching. Common (temporary) pitfalls include:
Execpath being a symbolic link rather than a regular file
In these cases, programmers have no option but to use a workaround, such as removing the symbolic link abstraction, or linking to the executable directly. Neither of these are required by the desktop entry specification itself.