1

If I create a Java-desktop-file in ~/.local/share/applications I do not have the option "Add to Favorites".

I tried it with JabRef:

[Desktop Entry]
Type=Application
Terminal=false
Icon=org-jabref-jabrefmain.png
Path=/home/jkalliau/prgm/JabRef
Exec=java -jar JabRef--master--latest.jar %U
Name=JabRef
GenericName=BibTeX Editor
Comment=JabRef is an open source bibliography reference manager.
Keywords=bibtex;biblatex;latex;bibliography
Categories=Office;
StartupWMClass=org-jabref-JabRefMain
MimeType=text/x-bibtex;

and with Maple:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Maple 2018
Type=Application
Comment=Maple 2018
Exec=/home/jkalliau/maple2018/bin/xmaple %f
Terminal=false
Icon=/home/jkalliau/maple2018/bin/Maple2018.png
GenericName=Maple
Categories=Applications;Education;Mathematics;
MimeType=application/x-maple-worksheet;

NoFavoriteIcon

If I do the same as in How to add Eclipse to Favorites? I have the icon twice, once added to favorites and once the opened file.

Icon twice

1

2 Answers 2

1

Create a .desktop-file with the identical WM_CLASS of the opened program:

  • for JabRef: org.jabref.gui.JabRefMain.desktop
  • for Maple: java-lang-Thread.desktop
  • for Eclipse: eclipse.desktop (according to https://unix.stackexchange.com/a/59654/241592 )
  • for nemo nemo.desktop (not Files.desktop)
  • for academic MatlabR2022a: MATLAB R2022a - academic use.desktop
  • for Inkscape: org.inkscape.Inkscape.desktop

The WM_CLASS can be found with the command

xprop

for more details check https://unix.stackexchange.com/a/225409/241592 . Use Copy&Paste to avoid spellingmistakes.


Or you can also see name in the left upper corner

enter image description here

or in the Pop-up of the icon in the favourite-list

enter image description here

As suggest on https://askubuntu.com/a/1120331/676490 after creation of the .desktop-file:

  • go to activities

enter image description here

  • search the application

enter image description here

  • Click "Add to Favorites"
2
  • Could yo be more specific about the contents of the .desktop file? I mean how should I set the WM_CLASS parameter? Mar 8 at 0:51
  • Examples of desktop-files are in the question, the imporant thing is to name the file according to $WM_CLASS.desktop . Mar 12 at 16:28
0

For JabRef it is now: StartupWMClass=org.jabref.gui.MainApplication

2
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
    – zx485
    Mar 7 at 17:21
  • This does not work for me. I am on Ubunut 20.04 LTS with the latest version of JabRef 5.12. Mar 8 at 0:39

You must log in to answer this question.

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