Was trying to get simple desktop entry to work without creating duplicated after app run.

That's for st3 under GNOME3 (Fedora 19), and .desktop file looks like this:

[Desktop Entry]
Version=3.047
Type=Application
Name=Sublime Text 3
Icon=path-to-logo.png
Exec="path-to-exec" %f
Comment=some comment
Categories=Editor;Text;
Terminal=false
StartupWMClass=Sublime_text

Thought that "StartupWMClass" key will do the job of grouping windows in a dock, but it does not. Looks like I've missed something.

I got wmclass with xprop WMCLASS:

[me@pc ~]$ xprop WM_CLASS
WM_CLASS(STRING) = "sublime_text", "Sublime_text"

Example:

enter image description here

Desktop entry is at the top (ye, another logo file), but app is not get grouped in it and is shown separately. Any way to fix it?

Thanx for help!

UPDATE: I've changed .desktop entry to:

[Desktop Entry]
Type=Application
Terminal=false
Name=Sublime Text 3
StartupNotify=true
GenericName=Text Editor
Comment=Edit text files
Exec="/usr/local/bin/sublime_text_3/sublime_text" %U
MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;x-directory/normal;inode/directory;
Categories=GNOME;GTK;Utility;TextEditor;Application;Development;
Icon=/usr/local/bin/sublime_text_3/st3_custom_logo.png
Name[en_US]=Sublime Text 3

(found on the st forum)

Everything is fine now. Don't understand how it works though, thought that WMClass is how windows are grouped.

  • So, I'm guessing the addition of the MimeType resolved the issue on your system with the "Sublime" text editor? Do you follow the same procedure for other applications on your system with same issues? I noticed the "WMClass" entry is missing altogether. This freedesktop classification stuff is confusing as hell! :( – ILMostro_7 Jun 5 '14 at 7:44
  • Running into the same exact problem. Using your updated .desktop entry hasn't resolved it at all. The odd thing is, I got it working before, but now it has stopped working, without a change to the .desktop file. The only thing i can think of is that I recently started working in a sublime project, but closing that project hasn't made a difference. – Suchipi Oct 27 '15 at 3:38
  • Is this a bug in GNOME 3.8? ask.fedoraproject.org/en/question/32982/… – Cool Charac Feb 18 '17 at 11:04

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.