Tuesday, August 20, 2019

unity - Recovering the command used by a launcher icon


How do I trace back to the exact command run by the unity launcher for a given launcher icon? In 14.04 at least, hovering (or right-clicking) an icon on the launch bar provides no option to arrive at that information.



You have to look for the Desktop file in ~/.local/share/applications/ and/or /usr/share/applications/, open it and then look for the part Exec=.


For example if you want to know the command that launches gedit


$ cat /usr/share/applications/gedit.desktop
[Desktop Entry]
Name=gedit
GenericName=Text Editor
Comment=Edit text files
Exec=gedit %U
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain;
Icon=accessories-text-editor
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.10.4
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport
Actions=Window;Document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
[Desktop Action Window]
Name=Open a New Window
Exec=gedit --new-window
OnlyShowIn=Unity;
[Desktop Action Document]
Name=Open a New Document
Exec=gedit --new-document
OnlyShowIn=Unity;

You are interested in Exec=gedit %U


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...