OS: Ubuntu 18.04 (minimal installation option):
dkb@dkb-ubu1804:~$ cat /etc/X11/default-display-manager
/usr/sbin/gdm3
dkb@dkb-ubu1804:~$ echo $XDG_SESSION_TYPE
x11
dkb@dkb-ubu1804:~$
I installed the following qt-based applications using apt install
: dolphin, featherpad, gwenview, kate and qterminal.
Out of these, dolphin, gwenview and kate did not show the "Add to Favorites" option when I right-clicked on their icons in the launcher. But featherpad and qterminal had the "Add to Favorites" option. Why is that?
(The situation persists even after a reboot.)
Their .desktop files didn't offer any clues.
• Dolphin
[Desktop Entry]
Name=Dolphin
Exec=dolphin %u
Icon=system-file-manager
Type=Application
X-DocPath=dolphin/index.html
Categories=Qt;KDE;System;FileTools;FileManager;
GenericName=File Manager
Terminal=false
MimeType=inode/directory;
InitialPreference=10
X-DBUS-ServiceName=org.kde.dolphin
• FeatherPad
[Desktop Entry]
Name=FeatherPad
GenericName=Text Editor
Comment=Lightweight Qt5 text editor
Exec=featherpad %F
Icon=featherpad
Terminal=false
Type=Application
MimeType=text/plain;
Categories=Qt;Utility;TextEditor;
X-KDE-StartupNotify=false
• Gwenview
[Desktop Entry]
Name=Gwenview
GenericName=KDE Image Viewer
Comment=A simple image viewer
Exec=gwenview %U
Terminal=false
Icon=gwenview
Type=Application
Categories=Qt;KDE;Graphics;Viewer;Photography;
MimeType=inode/directory;image/gif;image/jpeg;image/png;image/bmp;image/x-eps;image/x-icns;image/x-ico;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xbitmap;image/x-xpixmap;image/tiff;image/x-psd;image/x-webp;image/webp;image/x-tga;
X-DocPath=gwenview/index.html
# InitialPreference should be greater than Okular so that Gwenview is the
# primary application associated with images, but less than Konqueror or Dolphin
# so that Gwenview is not the primary applications for folders.
InitialPreference=8
X-DBUS-ServiceName=org.kde.gwenview
• Kate
[Desktop Entry]
GenericName=Advanced Text Editor
Name=Kate
Comment=KDE Advanced Text Editor
MimeType=text/plain;
Exec=kate -b %U
StartupNotify=true
X-KDE-HasTempFileOption=true
Icon=kate
X-DocPath=kate/index.html
Type=Application
Terminal=false
InitialPreference=9
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.kde.kate
Categories=Qt;KDE;Utility;TextEditor;
• QTerminal
[Desktop Entry]
Name=QTerminal
Type=Application
GenericName=Terminal emulator
Comment=Terminal emulator
Icon=utilities-terminal
Exec=qterminal
Terminal=false
Categories=Qt;System;TerminalEmulator;
Actions=Dropdown;
[Desktop Action Dropdown]
Name=Drop-down terminal
Exec=qterminal --drop
Icon=utilities-terminal
Name[en_GB]=Drop-down Terminal
Dolphin (shown below), gwenview and kate don't show an "Add to Favorites" option
Featherpad (shown below) and qterminal have the expected "Add to Favorites" option
A convenient workaround for me was adding it to my favorites from the omnibar.
It is completely weird, unpredictable and unexpected UX.
I confirm your results on Ubuntu session (GNOME Shell) in Ubuntu 18.04 LTS and even with 19.10 (development version).
My first thought was that
Exec
field pointed to some symbolic link, but all files declared in it are simple ELF executables. What is also bad that these desktop-files do not haveOnlyShowIn
directives...I do not have this issue on Unity, MATE (using Mutiny panel layout) and Lubuntu sessions in 18.04 LTS and even with 19.10 (development version).
Also I'm able to dock these applications into Cairo-Dock, Docky and Plank.
So it is a bug in GNOME Shell.
I reported it as bug 1840474 to LaunchPad (really it is a duplicate of bug 1768609 from 2018-05-02).
The .desktop-file must have the identical
WM_CLASS
as the opened program:dolphin.desktop
org.jabref.gui.JabRefMain.desktop
java-lang-Thread.desktop
eclipse.desktop
(according to https://unix.stackexchange.com/a/59654/241592 )nemo.desktop
(not Files.desktop)MATLAB R2020a - academic use
The
WM_CLASS
can be found with the commandfor more details check https://askubuntu.com/a/1155956/676490 and https://unix.stackexchange.com/a/225409/241592
Jokalliauer has the correct answer:
rename the .desktop file to the WM_CLASS of the application. Open the application you want to change. Type the following followed by the ENTER key to find the WM_CLASS.
You will see nothing in the CLI until you click on the open window for the application. Rename the .desktop file for the application as
close the app in question, restart it and the option to add to favorites will appear when you right click the icon in the toolbar.