0

I can't seem to get the proper icon to display on 18.04 dock using this custom launcher. The icon does display correctly along with the application name using the "Files" application. If I double click on the icon in the "Files" folder the application loads up no problem. I can then add it to dock favorites but dock uses some generic icon.

Where did I mess up the contents of the .desktop file listed below?:

[Desktop Entry]
Encoding=UTF-8
Version=1.1
Type=Application
Name=Songsheet Generator
Icon=/home/hgh/BIN/songsheet.png
Path=/home/hgh/BIN
Exec=java -jar SG02.jar
StartupNotify=false
StartupWMClass=com-tenbyten-SG02-SG02App
OnlyShowIn=Unity;
X-UnityGenerated=true
Actions=My-Custom-Action;
GenericName[en_US.UTF-8]=Songsheet Generator
Comment[en_US.UTF-8]=Guitar tab editing software
[Desktop Action My-Custom-Action]
Name=Name of the Option
Icon=songsheet.png
Exec=java -jar /home/hgh/BIN/SG02.jar
3
  • Is the StartupWMClass= entry correct? If not, fix it. Also remove the lines OnlyShowIn=Unity; and Icon=songsheet.png (penultimate line).
    – pomsky
    Oct 10, 2018 at 20:09
  • your whole Desktop Action section is wrong & should be removed. It's done differently & a Desktop Action never defines an icon.
    – doug
    Oct 10, 2018 at 20:17
  • Although your programming language is different, you may find something relevant and useful in the related post Custom Icon and Application Name Not Populating Dock or Top Menu. Mar 27, 2021 at 6:07

1 Answer 1

1
[Desktop Action My-Custom-Action]
Name=Name of the Option
Icon=songsheet.png
Exec=java -jar /home/hgh/BIN/SG02.jar

"Icon" should specify a full path to the image

I've never seen this type of entry in a .desktop file and I've created and edited quite a few of them. I'm not saying that you're wrong. Also, there's no need for the "StartupWMClass" entry or even specifying locale as in your "GenericName[en_US.UTF-8]" entry and your "Comment[en_US.UTF-8]" entry ( just remove [en_US.UTF-8] ), unless you're planning on packaging your application for installation on another user's computer.

I see the "Categories" entry is missing, although I'm not entirely sure it's needed. It's used by the system when generating entries for the Open With... dialog and possibly when generating menu items for the Applications button on the desktop.

Other than that, everything else looks OK to me.

1
  • I just looked into a few of the .desktop files in my /usr/share/applications folder and found a couple with custom action entries. None of them specify an icon for their custom actions...
    – BillWeckel
    Oct 6, 2018 at 18:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .