This guide is written for Dapper Drake 6.06
Note 1: This tutorial assumes that you've enabled the universe & multiverse repositories. If you haven't, the HOWTO for that is here.
Note 2: With the exception of the follow-along examples, all menu entry files are accessed read-only. This is completely safe as the commands given for this do not use sudo, su, etc. The only other commands that use administrative privilege are the installation of the Debian menu & the Circus Linux game as part of the HOWTO.
- Install the Debian menu so all installed applications are accessible via Applications->Debian.
- Adding missing entries and/or icons to Ubuntu's Applications menu.
- Help with applications that won't launch from the menu icon.
Blue text is informational and not required to “just get it done”. You will gain a better understanding of the what, where, & why if you read the blue text.
I have spent a good bit of time customizing my Applications menu, mostly adding entries and icons for the Debian packages that only show in the Debian menu. I like the terminal just fine, it's saved my bacon more than a few times, but I also like a nice, clean uniform Applications menu to peruse. I think Ubuntu has done a great job with the menus for Ubuntu packages, but things can get a bit messy when you start adding Debian packages. Oh yeah, I like a LOT of the Debian packages, especially the games.
A. Install the Debian menu to make all installed applications accessible via the Applications->Debian menu.
I have the Debian menu installed, it will give us the info necessary to build the menu entries for our Ubuntu menu.
Let's make sure you do too:
Edit: Added suggestion by ryu kun from this post further down the thread.
Verify this after installation finishes by going to: Applications->DebianCode:sudo apt-get update sudo apt-get install menu menu-xdg update-menus
If you haven't installed any Debian packages, the Debian menu will still install properly, but may not be enabled. You can verify this in Alacarte by going to: Applications->Accessories->Alacarte and clicking Applications on the left, and it should be listed on the right. The Debian menu will become visible in the Applications menu when you install a Debian package from the repositories. Don't worry if you can't enable it yet, it'll be there when it's supposed to.
B. Adding missing entries & icons to Ubuntu's Applications menu.
I'm going to show you how to do this manually (without Alacarte), but if you know the path to the icon & executable binary (the application) as well as the command to run the application, then you can just as easily use the Alacarte Menu Editor. The reason I have given manual instructions first is that I will also show you how to find the above information if you don't know it.
1. Let's start by identifying the directories that contain the menu entries we'll be working with. As background for noobs, the menu is constructed of a bunch of simple text files stored in the following designated directories.
Ubuntu Applications menu entries are here:
Debian Menu entries are here:
Icons are found in these locations:
Most of these text files are less than 10 lines long and are easy to understand, although many of the menu entries that come pre-installed with Ubuntu have a large number of translations for the text in the Name & Comment fields which adds a significant number to the line count.
The naming convention for .desktop files in the Ubuntu menu is: application-name.desktop so the menu entry for gaim would be a text file named gaim.desktop and would be found in: /usr/share/applications. Simple. Once you get the hang of it, you'll be able to guess the filename easily in most cases.
The naming convention for .desktop files in the Debian menu is: X-Debian-Maincategory-Subcategory-app_name.desktop so the menu entry for gaim would be a text file named X-Debian-Apps-Net-gaim.desktop and would be found in: /var/lib/menu-xdg/applications/menu-xdg. This makes guessing the filename a good bit more difficult, so we'll need to enlist the aid of gedit to browse the Debian menu entry directory, more on this later.
2. Let's take a look at the contents of the Ubuntu menu entry file. I've bolded the lines that are actually necessary for the English menu. For other languages, adjust as necessary.
Open a terminal by going to: Applications->Accessories->Terminal, then do:
Since this is a pre-installed package, we'll see lots of translations:Code:gedit /usr/share/applications/gaim.desktop
Name=Gaim Internet Messenger
Name[ca]=Missatger d'Internet Gaim
Name[cs]=Gaim Internet Messenger
Name[da]=Gaim - internet beskeder
Name[de]=Gaim Internet Messenger
Name[es]=Gaim - cliente de mensajería de Internet
Name[fr]=Gaim Messagerie Internet
Name[hu]=Gaim azonnali üzenetküldő
Name[it]=Gaim Internet Messenger
Name[ja]=GaimIf we strip the extra languages off the file, we get this (closer to what you'll see on Debian menu entries):インターネット・メッセンジャー
Name[nl]=Gaim - Expresberichten
Name[pl]=Komunikator Internetowy Gaim
Name[pt_BR]=Mensageiro via Internet Gaim
Name[pt]=Mensageiro Internet Gaim
Name[ru]=Gaim - клиент обмена мгновенными сообщениями
Name[sl]=Gaim - spletni sel
Name[sq]=Lajmësjellësi Internet Gaim
Name[sv]=Gaim Internet Messenger
GenericName[es]=Cliente de mensajería de Internet
GenericName[pt_BR]=Mensageiro via Internet
GenericName[ro]=Client de mesagerie
GenericName[ru]=Клиент обмена мгновенными сообщениями
Comment=Send instant messages over multiple protocols
Comment[ca]=Envieu missatges instantanis en múltiples protocols
Comment[cs]=Posílat instant message různými protokoly
Comment[da]=Send beskeder over flere protokoller
Comment[de]=Multi-Protokoll Instant Messenger Client
Comment[es]=Cliente de mensajería instantánea multiprotocolo
Comment[fr]=Envoie des messages instantanés en utilisant divers protocoles
Comment[hu]=Azonnali üzenetküldés többféle protokoll használatával
Comment[it]=Client multiprotocollo per messaggi immediati
Comment[ja]=複数のプロトコルを介してインスタント・メッセージを送信しますComment[ko]=다중 프로토콜 메신저
Comment[nb]=Send lynmeldinger over flere protokoller
Comment[nl]=Multi-protocol programma voor expresberichten
Comment[pl]=Komunikator internetowy obsługujący kilka protokołów
Comment[pt_BR]=Mande mensagens instantâneas por múltiplos protocolos
Comment[pt]=Envie mensagens instantâneas sobre vários protocolos
Comment[ro]=Trimiteţi mesaje instant în orice reţea
Comment[ru]=Обмен мгновенными сообщениями с использованием множества протоколов
Comment[sl]=Pošiljajte neposredna sporočila prek različnih protokolovs
Comment[sq]=Dërgoni mesazhe të atypëratyshëm protokollesh të ndryshëm
Comment[sv]=Sänder snabbmeddelande över mĺnga protokoll
3. Next, let's look at the contents of the Debian menu entry file.Code:[Desktop Entry] Encoding=UTF-8 Categories=Application;Network; Exec=gaim Icon=gaim.png StartupNotify=true Terminal=false Type=Application Name=Gaim Internet Messenger GenericName=Internet Messenger Comment=Send instant messages over multiple protocols X-Ubuntu-Gettext-Domain=gaim
Open a terminal and do:
As you can see, the Debian menu entry has a hideous filename, but the contents are very simple & straightforward.Code:gedit /var/lib/menu-xdg/applications/menu-xdg/X-Debian-Apps-Net-gaim.desktop
4. Now, let's install the game Circus Linux. This will provide us with an opportunity to create a menu entry for the Ubuntu menu.Code:[Desktop Entry] Type=Application Encoding=UTF-8 Name=Gaim GenericName= Comment=Multi-protocol Instant Messaging Client Icon=/usr/share/pixmaps/gaim-menu.xpm Exec=/usr/bin/gaim Terminal=false Categories=X-Debian-Apps-Net
To install Circus Linux open a terminal & do:
Verify that it installed correctly by going to Applications->Debian->Games->Arcade->Circus Linux. Also note that it does not appear in Applications->Games.Code:sudo apt-get install circuslinux
5. Open gedit (without sudo) from the Applications->Accessories menu or do:
and browse to: /var/lib/menu-xdg/applications/menu-xdg. In this folder you'll see the .desktop files, but they will show with whatever name is in the "NAME=Application Name Here" section of the file, not the actual filename.Code:gedit
Here is a screenshot of what you will see in both of the folders with the .desktop files.
This is not very intuitive at first, but when you create & then save a new menu entry file, you must name it like: app-name.desktop even though that isn't the name you'll see if you open the parent directory (/usr/share/applications) after creating the entry.
Here is a screenshot of the gedit save dialog as it comes up. You MUST change the filename here or the entry will not appear in the Applications menu.
Here is a screenshot of the gedit save dialog as it should look after you change the filename appropriately.
If you forget to name the file appropriately such as: (app-name.desktop or application.desktop), it won't appear in Ubuntu's Applications menu. Dashes & underscores are ok but NO spaces in the filename.
6. The Debian menu entry for Circus Linux is an example of a menu entry with just the minimal information. To look at it, do:
It's contents look like this:Code:gedit /var/lib/menu-xdg/applications/menu-xdg/X-Debian-Games-Arcade-circus_linux.desktop
7. We can simply create a new file called circuslinux.desktop in /usr/share/applications:Code:[Desktop Entry] Type=Application Encoding=UTF-8 Name=Circus Linux GenericName= Comment=Circus Linux! Icon=/usr/share/pixmaps/circuslinux-icon.xpm Exec=/usr/games/circuslinux --fullscreen Terminal=false Categories=X-Debian-Games-Arcadeand then copy & paste the contents of the above file into the empty file we just created.Code:sudo gedit /usr/share/applications/circuslinux.desktop
8. Then we have to alter the Categories line to match the Ubuntu Applications menu. To find out what should go there, we look at an existing Ubuntu Applications menu entry from the category we want our new entry to go in. A good choice would be Same GNOME. To see the contents of this file do:and scroll down until you see the Categories line. You can just copy the Categories line and paste it onto the end of your new circuslinux.desktop file and delete the old Categories line. It should now look like this:Code:gedit /usr/share/applications/same-gnome.desktopCode:[Desktop Entry] Type=Application Encoding=UTF-8 Name=Circus Linux GenericName= Comment=Circus Linux! Icon=/usr/share/pixmaps/circuslinux-icon.xpm Exec=/usr/games/circuslinux --fullscreen Terminal=false Categories=GNOME;GTK;Game;LogicGame;9. Save the file and then you should have a Circus Linux entry complete with icon in Applications->Games.This segment is from my post in this thread.
C. If you have a menu entry that just doesn't have an icon:
1. Open Application->Accesories->Alacarte Menu Editor
2. Click on the category you want the icons in.
3. File->New Entry
4. Fill in the lines appropriately.
Hint: look in /usr/share/pixmaps, /usr/share/icons & /usr/bin/name-of-app for the icon that goes with the app in question.
If you don't find it there, you can google for a suitable icon image.
To find an icon for Rosegarden:
1. Go to google images, enter "rose" or whatever you need. Then choose the image that best suits your needs. I would use the blue rose image here because it has a simple, clear picture with a solid white background. Note that personal, non-commercial use of images grabbed off the net is probably OK, but distribution of these images could be a violation of copyright law. You're on your own with this.
2. I would then right click on the image and select "Save Image As..." then I'd clean up the filename from "rose_blueLt1_small.jpg" to something simpler like "rose.jpg" and save to the Desktop.
3. Next, I open the image in GIMP.
4. Once in GIMP, I click Image->Scale Image then I enter 64 in the dimension (Width or Height) that is the largest and hit enter. This should automatically scale the smaller dimension to the new size which is proportionally smaller than the new size of the larger dimension. Then click "Scale".
5. Next click File->Save as... click "Select File Type (By Extension)" and choose "X PixMap image" from the list and click save, then close GIMP.
6. Open a terminal Applications->Accesories->Terminal and enter:
7.Then open up Alacarte Menu Editor again, and select the category on the left you put Rosegarden into, then double click the rosegarden entry on the right when the list appears.Code:sudo cp ~/Desktop/rose.xpm /usr/share/pixmaps
8. Click the Icon box and when the dialog box opens, be sure you're in /usr/share/pixmaps, if not, browse there with the Browse button on the top right. once in /usr/share/pixmaps Click on the rose.png icon, then click "OK", the icon should now be visible on the rosegarden entry. Click close on the rosegarden entry.
9. You should now see the icon with the rosegarden entry in Alacarte. Then click close on Alacarte. Check your menu, if you see the entry, but no icon, then do the following in Terminal:
to refresh the menu.Code:killall gnome-panel
D. If you have an application which has an icon in the Ubuntu Applications menu, but only opens from the command line:
1. Open up Alacarte and verify that the menu entry has the appropriate command to run the application. Verify by opening a Terminal and entering the command listed.
2. Try setting the program to “Run in Terminal”. Some apps need to be opened this way. You can do this by going to Applications->Accesories->Alacarte, select any Category on the left and double-click any entry on the right. In the config dialog that appears, the checkbox just to the right of the icon is what we're after here. You can also do this by entering:in the terminal, and changing the lineCode:sudo gedit /usr/share/applications/name-of-app.desktoptoCode:Terminal=falseor vice-versa. This is from my post in this thread.Code:Terminal=true
3. Verify that the binary has the proper permissions. This was suggested by ardchoille here. The full thread can be found here.
For even more menu customization, use the link below to see kassetra's guide, which works hand-in-hand with this guide.
HOWTO: Create & populate Sub-Menus in the Applications Menu
Sorry for the extra-long post.
Feedback, suggestions and constructive comments are welcome. As usual, this is probably a work in progress.
This is my first HOWTO, so go easy on me.