NOTE: This answer works for the okular snap in Xubuntu 20.04, and in Ubuntu 20.04
okular as a snap package, I see two icons in the Whisker Menu launcher: one seems to represent
okular and the other is generic but both show the same tooltip (Universal document viewer).
locate -i okular | grep -i desktop to identify the corresponding .desktop files. (Ubuntu users may need to install the
mlocate package to access the
locate command.) There were several hits but
I copied these two .desktop files over to
applications subfolder may not exist originally in which case it should be created.
I edited both files to remove extra names, generic names, and comments and then compared the two files.
dkb@dkb-xubuFF:~/.local/share/applications$ diff *.desktop
< Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/okular_okular.desktop /snap/bin/okular %U
> Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/okular_org.kde.okular.desktop /snap/bin/okular %U
As you can see from the output,
Exec= lines of both .desktop files launch
- one .desktop file, okular_org.kde.okular.desktop, is missing the line beginning with
Icon and that explains the "generic" icon in the application menu.
- since both .desktop files seem to be equivalent, we can just "hide" the one which shows the generic icon by adding
NoDisplay=true as the last line to that .desktop file.
Now, there's just the one "okular" when one types
oku in a launcher's search bar:
- none of the operations above need the user to be
root or to invoke
- modifications made to .desktop files in
~/.local/share/applications will survive updates of the parent packages.
A bug has been filed.