Community Q&A

0 People Have This Question.
About: Other Status: Solved

how do i add an icon to a .desktop file?

I compiled and installed DeSmuME and added a .desktop file so it appears in slingshot.
Now i want to add the DeSmuME icon to the file so it looks nice. How do i do this? Where does the “Ic tag in a .desktop file point to?
Here is the file I created:

[Desktop Entry]
Comment=A Nintendo DS emulator
Exec=desmume Ic

Asked by Bisasam 2 years ago

2 years ago

You have some options, depending on what you want to do. If you want to edit the .desktop file itself, add the “Icon” key and follow it with the name of an icon in your icon theme -or- give an absolute path to a specific image. So in your .desktop file you have “Name=DeSmuMe” so under that insert “Icalacarte”. It may show up as “Main Menu”. That’s going to provide you with a GUI where you can add, edit, hide and remove application shortcuts in Slingshot. And that includes changing icons.

Only thing is, alacarte by default edits the Gnome menu, not the Slingshot menu. So if you go this route and install alacarte, you’ll want to do this after. Open a terminal and type the following.

sudo scratch-text-editor /usr/share/alacarte/Alacarte/

Search for the text “”. It’ll show up twice in the file. Replace it with “”. That’s it. Just close Scratch. Now you can open up alacarte (aka Main Menu) and edit to your heart’s content.

For the record I shoved “Main Menu” into my System Tools menu and renamed it “Slingshot Menu Editor”.

Hope this helps.

Toggle Comments

cakradonya 12 months ago

As my Scratch is broken, I’ve been replaced it with gedit. But, I didn’t see any text on the s I don’t know what to do. How is it?

Load More Comments

Login to place a comment.

Click here to view all the solutions to this question
1 votes
2 years ago

Here is a template which I use when I create a new .desktop file.
I usually delete things I don’t need like the TryExec.
The lc is parameter which will be given to the executable when it launches.

[Desktop Entry]
GenericName=Generic Application
Comment=Comment on Application
Exec=Path/to/Application with parameter
TryExec=Failsafe that will be executed when the normal start fails

Cheers eppixx

Toggle Comments

This answer has no comments yet.

Load More Comments

Login to place a comment.

Just one second… Login in to comment, ask questions and more.