3

I followed all the steps in this answer: https://askubuntu.com/a/975230/719469

However when I run xprop WM_CLASS in Terminal and click on my application's window, it gives me: WM_CLASS: not found. What should I do to get a single icon of the app on the Ubuntu Dock?

duplicate icons on Recoll on Launcher

The application I am talking about is Recoll, installed using apt-get install recoll. I am using Ubuntu 18.04 (Xorg).

The contents of .desktop file in /usr/share/applications:

[Desktop Entry]
Categories=Utility;Filesystem;Database;
Comment=Find documents by specifying search terms
Exec=recoll
GenericName=Local Text Search
Icon=recoll
Name=Recoll
Terminal=false
Type=Application
Keywords=Search;Full Text;

Edit:

I tried changing the .desktop file lines by making these changes

Exec=recoll --class CustomClassName

and then adding the line

StartupWMClass=CustomClassName

After doing this, the app fails to launch from its icon and I still get WM_CLASS: not found. in the terminal

Kewal Shah
  • 1,044

1 Answers1

2

For a similar situation I have to do the following:

  1. Determine the class as in the new answer in related question

    Briefly:

    • open the app
    • AltF2, write lgEnter, go to Windows menu (up-right).
    • find the app in the list and take note of its wmclass
    • close lg ESC and app
  2. Add Class to .desktop file found commonly in: /usr/share/applications or .local/share/applications:

    StartupWMClass=classSeenInPreviousStep
    
  3. keep icon in favorites (add to menu)

    • open app, right button in icon, 'Pin to Dash' (Add to favorites).

    • or: open dconf-editor, search favorite-apps, add .desktop file to list.

    • or: Paste this to create a script for that purpose

      cat >addToMenu.sh <<'EOL'
      #!/usr/bin/env bash
      STATE=`gsettings get org.gnome.shell favorite-apps`
      STATE=$(sed 's/]/,'\ \'YOURAPP.desktop\'']/g' <<< $STATE)
      gsettings set org.gnome.shell favorite-apps "${STATE}"
      EOL
      

      Run it:

      sudo apt install gnome-shell-extensions bash addToMenu.sh

    • Favorites Troubleshooting:

      • Look in the .desktop file for a line with OnlyShowIn=... or NotShowIn=..., and remove the line
      • check that in .desktop file Terminal=false
      • .desktop files present in /var/lib/snapd/desktop/applications might need to be copied to ~/.local/share/applications
Ferroao
  • 959