Ubuntu: How to open a desktop shortcut from commandline



Question:

I created a eclipse.desktop and locked it to unity launcherd , when I double click on it on desktop, the eclipse was launched just like launching from unity launcher. But if I start it from command line by "path/to/eclipse", the unity launcher will create a new icon in the launcher bar.

How can I avoid this? Is there a command to open the desktop launcher just like double click on it?


Solution:1

You can do the following to make the association between the launcher and its command stronger:

1.) Launch eclipse from the command line

2.) Execute xprop WM_CLASS from a terminal and note down one of the quoted strings

3.) Edit your launcher with the following line:

StartupWMClass=$WM_CLASS  

where $WM_CLASS is one of the quoted strings.

For this to work please make sure your .desktop launcher is located somewhere, where it's recognized by the system, e.g. $HOME/.local/share/applications or /usr/share/applications.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »