11

I'm not sure what commands are issued when trying to launch a program from the dash. How can I determine this and modify the commands of these short cuts?

For example, I would like to change the command to launch skype from:

skype

to

LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype

I'm not sure which command is issued when I click on the icon in the dash and I'm not sure how I would change it. Changing it using gnome menu editor does not seem to have any effect.

Jorge Castro
  • 71,754
astjohn
  • 347

2 Answers2

16

While I couldn't find the shortcuts, we can use the .local/share/applications folder.

You can create a file this way:

gedit ~/.local/share/applications/myskype.desktop  

Then paste something like this into it:

[Desktop Entry]  
Version=1.0
Name=My Skype
Exec=env LD_PRELOAD="/usr/lib32/libv4l/v4l1compat.so" skype
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=skype
Categories=GNOME;GTK;Network;
StartupWMClass=Skype
StartupNotify=true
X-Ayatana-Desktop-Shortcuts=NewWindow;

[NewWindow Shortcut Group]
Name=Open a New Window
Exec=env LD_PRELOAD="/usr/lib32/libv4l/v4l1compat.so" skype
TargetEnvironment=Unity  

Save and exit.

astjohn
  • 347
desgua
  • 32,917
  • 1
    Sorry. Perhaps I didn't explain myself properly. I want to change the command for a particular program that I launch from the dash. I've adjusted my original question accordingly. – astjohn May 02 '11 at 16:28
  • @desgua, thanks for your quick replies! As I understand it, the dash is the interface that appears when you hit the super key... not the unity side bar thing. – astjohn May 02 '11 at 17:00
  • I'm very sorry for that. You are absolutely right. – desgua May 02 '11 at 17:13
  • No worries. I appreciate your help regardless! – astjohn May 02 '11 at 17:42
  • 1
    @desgua Copy the .desktop into .local/share/applications like we do on the other quicklist questions, otherwise an upgrade will overwrite his customizations. – Jorge Castro May 02 '11 at 20:15
  • @Jorge Castro thank you so much for this very important advice. – desgua May 02 '11 at 20:46
  • @desgua, thanks for your help! I changed the exec line to the following, and accepted your answer: exec=env LD_PRELOAD="/usr/lib32/libv4l/v4l1compat.so" skype. The env command is required to get it to launch properly. – astjohn May 03 '11 at 02:49
  • @astjohn thank you for fixing it. I'm glad we got it. ;-) – desgua May 03 '11 at 03:53
  • @desgua Thank you for StartupWMClass=Skype and StartupNotify=true!! These make Unity work like an unconfused charm :) – Cetin Sert Jul 14 '13 at 07:07
  • 1
    @CetinSert Welcome ;-) – desgua Jul 15 '13 at 11:56
  • Here's a supporting link: http://www.geekyboy.com/archives/384 – TheGrimmScientist Jul 06 '15 at 07:38
4

I suspect you can edit the file /usr/share/applications/skype.desktop Make a backup copy first. You probably need to edit the line that reads Exec=skype to include the changes you want.

[Edit] Just tried this for myself and the syntax for .desktop files doesn't allow the = sign in the Exec command so you may need to create a shell script with your command in and point the Exec line at that.

Here is some background about the .desktop files: http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html

Nigel
  • 156
  • Thanks for your help. It's because you need the env command. Please refer to my last comment directed to desgua. I'm going to give the answer to him because of his quick response and patience. Cheers. – astjohn May 03 '11 at 02:45
  • @astjohn: this is actually the correct answer, because it explains where to find the shortcuts for the items in the launcher. Desgua's answer creates a new shortcut on the desktop. – Dan Dascalescu Jun 09 '16 at 03:52
  • Copying a .desktop file and modifying details works, but with some caveats... for example, trying to launch wine foobar2000.exe results in two launcher icons, and none of them pick up the icon from foobar2000.exe. – Dan Dascalescu Jul 27 '16 at 01:23