Ubuntu: Adding Items To The Main Menu
Adding things to the Main Menu is rather easy and straightforward, but can be a bit confusing to a recent Windows convert. With a few clicks of the mouse, you can practically redesign the entire menu. Here, I’ll get you started by showing how easy it is to add a new item.
If you’re like me, I like to get my game on… on occasion. It’s been slowing going, but we’re finally getting some decent games to play beyond simple card games. Unfortunately, some of these games aren’t available through Ubuntu’s repositories, meaning we end up installing them on our own. Luckily, they’re easy enough to install, but a few don’t get added to the main menu. This doesn’t keep us from playing them, but it would be nice to give the menu a click or two rather than trying to remember where they’re at from the command line or what it was called in the Run Application window.
I’m going to use Urban Terror for my example. Urban Terror was originally a total conversion mod of Quake 3 Arena. Since the release of the free ioquake3 engine, it’s become a standalone game that’s free to use and fun to play.
To install the game, one only needs to download it from one of the mirrors (or with the torrent file), unzip it, chmod +x either the ioUrbanTerror.i386 or the ioUrbanTerror.x86_64 file, and run it. But now I have the directory sitting on my desktop, and I’d like to move it some place else but still find it and run it easily when I feel like playing later on.
First I move it to the /opt directory where it’ll stay safe and sound.
sudo mv ~/Desktop/UrbanTerror /opt
I have to use sudo as /opt is restricted to superusers. The move will retain the original ownership so I can still access Urban Terror without having to become a superuser or putz around with more file permissions.
adam@nyx:/opt$ ls -alh
total 24K
drwxr-xr-x 4 root root 16 2008-12-30 18:00 .
drwxr-xr-x 20 root root 4.0K 2008-12-20 19:09 ..
drwxr-sr-x 7 games games 4.0K 2008-12-30 17:06 Savage2
drwxr-xr-x 4 adam adam 4.0K 2007-12-22 17:53 UrbanTerror
adam@nyx:/opt$
Now, I’ll right-click on the main menu icon and choose Edit Menus. I’ll select Games from the Menus list and click on the New Item button on the right. A Create Launcher window will appear.

I’ll keep the Type as Application and I’ll use Urban Terror for the Name. Since I already know the path to the file, I’ll just type it in at Command (/opt/UrbanTerror/ioUrbanTerror.x86_64). If I didn’t, I would click on Browse and navigate to it. I’ll leave Comment empty. At this point, you could click the OK button and you would now have a menu item under Games for Urban Terror.
However, the icon looks rather bland as a non-descript window and out of place considering the rest of the list. It would be nice to have one there for pretty’s sake. Fortunately, Urban Terror ships with one icon.
If you closed the Create Launcher window, you can get back to it by following the above steps again, except you select Urban Terror from the Games‘ Items list and click on the Properties button. We could have done this the first time we added the menu item, but I wanted to show the possible What If?
Once you have the Launcher Properties window, you can click on the icon button, that spring-loaded application on the left, and Browse to where the icon(s) are located. You may be presented with Ubuntu’s collection of icons. You can choose any icon you want, either from Ubuntu’s or some other third-party, but I want to use the one that came with Urban Terror. Clicking on the Browse button, I navigate to /opt/UrbanTerror/q3ut4 and click the Open button. I’m presented with Urban Terror’s single q3ut.ico icon. I double-click on it, see it now in place of the default icon, and click Close. Now I can see it clearly in the Games menu.
You can use this same process to add any menu item for any application you want. The Edit Menus option lets you pick and choose what you see in the main menu as well. You can show or hide items by either adding or removing the checkmarks from the Show column. This works with Gnome’s Main Menu panel applet and Gnome’s Menu Bar panel applet, whichever one you’re using. You might be surprised to find something you already have installed and didn’t realize there was a menu item for it. I usually make sure Configuration Editor under System Tools can be seen as I like to tweak Gnome a bit.
Comments Off


