<

[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x

Adding Programs to Unity in Ubuntu 11+

Published on
9,325 Points
3,225 Views
1 Endorsement
Last Modified:
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a regular release. I like the 5-year long LTS cycle of the even numbers of Ubuntu.

But this upcoming version of Ubuntu LTS (12.04) has gotten rid of the traditional menu system and replaced it with Unity. Like it or hate it, it requires a change, and I could not very well just "upgrade" my workstations. So, in preparation for the move, I installed Ubuntu 11 on a spare laptop to figure out what this "Unity" deal was all about.

I immediately found a problem: How do you add things to the Unity menu system?

A quick Google search answered that question. Run the program, right click it on the Unity task bar, and click Keep in Launcher

But very quickly I found another problem that was not so easily solved: how do you add programs to the Unity Launcher that require a bash command and command line options?

I use KeePass as a password manager religiously. I use DropBox to synchronize the password database between multiple machines so I always have the latest copy. Further, I use Keepass version 2.x because of my need for plugins. Linux has KeepassX, which uses the traditional database format, but because i have a special need, I need Keepass v2.0, which requires the mono framework to run on Linux.

So, my task became clear: how do I put this command on the Unity Launcher:
mono /opt/KeePass/KeePass.exe

Open in new window


It wasn't as simple as you would think. In the older menu system, I could just edit the menu in the Main Menu applet, and poof! it would appear.

Under Unity, however, the steps are more complicated.

1.

Create a .desktop fileUnity uses .desktop files to hold application startup information including command line arguments, what icon you want to use, etc... So, the first step is to create a .desktop file that is appropriate for your application. In my case, it was this file:
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Keepass
Comment=Keepass over Mono
Exec=mono /opt/KeePass/KeePass.exe
Icon=/opt/KeePass/Keepass.png

Open in new window

*It should be noted that I downloaded the Keepass.png file from a Google Image search. It did not come with the package.

2.

Put The .desktop File Where Unity Can Find It.Unity only looks in two places to find .desktop files: /usr/share/applications and ~/.local/applications. If you want the application to be available to all users, copy your newly created .desktop file to the former. If it is just for you, copy it to the latter.

3.

Search for Your Newly Created ApplicationOpen up the Unity Launcher, and search for the item you just created. In my case, it was a search for "Keepass". Click on the result so the program launches.

4.

Pin to the Unity LauncherNow that the program has launched, you can right click the application in the Unity Launcher, and click Keep in Launcher

It's not complicated, but it was poorly documented. And now you know how to do it!
1
Comment
Author:DrDamnit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
0 Comments

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Join & Write a Comment

How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month