While what I said before is generally correct and is so for older Unity versions, some things may have improved since the last time I gave up on Unity. That said, I think there may be a bug you found and it may be in both. Here's why: Non-Allegro5 programs (single icon) or allegro5 programs started through terminal (terminal gets a `?` icon and the allegro program gets the icon correctly) seems to appropriately associate the icon assuming they are configured in the script correctly. The presence of a .desktop icon parameter in the script should override that of the binary, especially if no proper icon is found. This may need to filed as such the Unity tracker - but check with the other allegro-ites as they know much more about this than I. The same problem occurs with EX_ICON packaged with Allegro5 itself, so A5 might have issues too as Thomas Fjellstrom suggested. I am not sure how to make the .desktop change the working directory so relative references ("./data/image.png" for example) will work.
First, just make sure you script is correct by ensure your permissions are correct and that the image is not referenced as an absolute location. ./my_image.jpg Will NOT work. So make sure you spell the image and location correctly.
Note this is only the freedesktop.org standard specification loading script, and that the icon is not pulled in this case from the program. In allegro5 I think you can use void al_set_display_icon(ALLEGRO_DISPLAY *display, ALLEGRO_BITMAP *icon) but I can't make it work even using the example program for it ex_icon.c.
I have installed a clean Ubuntu 12.04lts with Unity, and used the following script:
Comment=This might be my tooltip~!
Note I have mc installed and the PATH is configured (I can type "mc" to run the program from terminal no matter the directory I am in.).
I named "mysupamcscript.desktop" and set as executable. This can be done from GUI, by right clicking -> "Properties" -> goto tab "Permissions"-> Check "Allow executing file as a program".
This runs, loads the jpg icon I made by saving the Alex.gif as a single frame using gimp, and will only load one instance. Since the script is not really 'installed' (you can learn how in one of the links from earlier), right click it and click "lock to Launcher". It should say and work now, even after the program has terminated. Please note that This is specific to Unity.
To make a universal method of ensuring single instance, you will want to check using your own code.