Score:0

Create icon (Not shortcut) for ubuntu

ru flag

Well I said (Not shortcut) but I accept that I might be wrong.

"How can I create a .png that works for .desktop files."

I can create or edit a .desktop file and point to a .png created by lutris, but .png files I create show a default icon.

Same for .png files I download.

And I have done my best for a few hours now, but trying to find information on creating .png icons is very frustrating because of the 12 billion results on how to create a shortcut. LOL Thanks,

P.s. since my question is not clear (Maybe this is why I'm having a hard time finding help) I want to know how to create the file itself. (.png file) I tried GIMP and I tried simply downloading existing png files, but Ubuntu does not seem to like them.

Perhaps a better way to explain my question is what are the specific formatting requirements (Indexed, RGB) and /or export requirements (save background color, save color values from transparent pixels, etc) that I should be using in GIMP. Or should I be using a different application all together?

The .desktop file is:

    [Desktop Entry]
    Type=Application
    Name=StarCraft II
    Icon=lutris_starcraft-ii.png
    Exec=lutris lutris:rungameid/1
    Categories=Game

With or without the '.png' at the end of the Icon= line works with the png created by Lutris, but does not work with any png file I create or download.

P.S.S I am placing these files in:

    ~/.local/share/icons/hicolor/128x128/apps 

which is where the original files are that seem to work.

Score:0
cn flag

Well, it's hard to discern the problem you are having without seeing your .desktop file. So let's try https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html. It's not the icon spec, but it seems close enough.

Oh, here's something:

Icons and themes are looked for in a set of directories. By default, apps should look in $HOME/.icons (for backwards compatibility), in $XDG_DATA_DIRS/icons and in /usr/share/pixmaps (in that order). Applications may further add their own icon directories to this list, and users may extend or change the list (in application/desktop specific ways).In each of these directories themes are stored as subdirectories.

Ah, and here's more:

Installing Application Icons

So, you're an application author, and want to install application icons so that they work in the KDE and Gnome menus. Minimally you should install a 48x48 icon in the hicolor theme. This means installing a PNG file in $prefix/share/icons/hicolor/48x48/apps. Optionally you can install icons in different sizes. For example, installing a svg icon in $prefix/share/icons/hicolor/scalable/apps means most desktops will have one icon that works for all sizes. You might even want to install icons with a look that matches other well known themes so your application will fit in with some specific desktop environment.

WayneA avatar
ru flag
Thank you for all your help. Perhaps I am just too impatient. for some reason now it just works. No idea what is different. I started happening when I created the 48x48 folder, but new icons don't have to be in there. Weird bug or crazy coincidence???
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.