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

JoKalliauer
  • 1,575
  • 2
  • 17
  • 26

2 Answers2

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"
JoKalliauer
  • 1,575
  • 2
  • 17
  • 26
0

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

Felix
  • 398