Answers

 Community Q&A

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

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]
Name=DeSmuME
Comment=A Nintendo DS emulator
Exec=desmume Ic
Type=Application
Categories=Game;

Asked by Bisasam 7 months ago
Locked

A:
7 months 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/MenuEditor.py

Search for the text “applications.menu”. It’ll show up twice in the file. Replace it with “pantheon-applications.menu”. 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 2 weeks ago

As my Scratch is broken, I’ve been replaced it with gedit. But, I didn’t see any text on the MenuEditor.py 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
7 months 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]
Type=Application
Name=ApplicationName
GenericName=Generic Application
Comment=Comment on Application
Categories=Development;Utility;TextEditor;AudioVideo;Audio;Player;GTK;Network;Game;Music;Player;GNOME;
Exec=Path/to/Application with parameter
TryExec=Failsafe that will be executed when the normal start fails
Terminal=false
MimeType=application/ogg;

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.
Cancel