@@ -206,7 +206,8 @@ public void syncDesktopIntegration(final boolean webLinks,
206206
207207 final DesktopFile df = new DesktopFile (path );
208208
209- // Exec is always written — it identifies which binary handles opens/links.
209+ // TryExec and Exec are always written — they identify which binary handles opens/links.
210+ df .setTryExec (appExec );
210211 df .setExec (appExec + " %U" );
211212
212213 if (desktopIcon ) {
@@ -216,8 +217,13 @@ public void syncDesktopIntegration(final boolean webLinks,
216217 df .setVersion ("1.0" );
217218 df .setName (appName );
218219 df .setGenericName (appName );
219- df .setCategories ("Science;Education;" );
220+ final String appCategories =
221+ System .getProperty ("scijava.app.categories" , "Science;Education;" );
222+ df .setCategories (appCategories );
220223 df .setTerminal (false );
224+ df .setStartupNotify (true );
225+ final String appWMClass = System .getProperty ("sun.awt.wmclass" );
226+ if (appWMClass != null ) df .setStartupWMClass (appWMClass );
221227 final String appIcon = System .getProperty ("scijava.app.icon" );
222228 if (appIcon != null ) df .setIcon (appIcon );
223229 final String appDir = System .getProperty ("scijava.app.directory" );
@@ -303,9 +309,15 @@ private void installDesktopFile() throws IOException {
303309 df .setVersion ("1.0" );
304310 df .setName (appName );
305311 df .setGenericName (appName );
312+ df .setTryExec (appExec );
306313 df .setExec (appExec + " %U" );
307314 df .setTerminal (false );
308- df .setCategories ("Science;Education;" );
315+ final String appCategories = System .getProperty ("scijava.app.categories" ,
316+ "Science;Education;" );
317+ df .setCategories (appCategories );
318+ df .setStartupNotify (true );
319+ final String appWMClass = System .getProperty ("scijava.app.wmclass" );
320+ if (appWMClass != null ) df .setStartupWMClass (appWMClass );
309321
310322 if (appIcon != null ) {
311323 df .setIcon (appIcon );
0 commit comments