19

I'd like to change the behaviour of the launcher, so that if I click on the firefox icon, it runs the command

$ optirun firefox

Does anyone know how to change it?

Thank you

Dox
  • 348

2 Answers2

17

If you change it in the dash, you'll automatically change it in the launcher. So start "main menu" (that's alacarte) from the dash, navigate to Internet and then Firefox. There you can set a new Run-entry (replace firefox %u with optirun firefox %u - whatever optirun is). You could also edit the launcher manually with sudo vim /usr/share/applications/firefox.desktop and change the Exec line.

onse
  • 1,109
  • optirun is the command that lets you use your Nvidia driver. Bumblebee should be installed. –  Dec 02 '13 at 08:39
  • This helped me, but the other part of the answer for me was there: https://superuser.com/questions/1332765/how-do-i-increase-the-font-size-of-menus-tabs-and-other-user-interface-element – asoundmove Sep 09 '19 at 15:04
12

--First copy the firefox.desktop to home by,

cp /usr/share/applications/firefox.desktop ~/.local/share/applications

if not present then create a new one in the above last location.

--Then open it for editing

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

--Third , add the following code.

X-Ayatana-Desktop-Shortcuts=Optirun;NewWindow;
[Optirun Shortcut Group]
Name=Optirun Firefox
Exec=optirun firefox
TargetEnvironment=Unity

[NewWindow Shortcut Group]
Name=Open a New Window
Exec=firefox -new-window about:blank
TargetEnvironment=Unity

Now save the File, browse through ~/.local/share/applications. From there drag the firefox.desktop to the launcher.

Source: https://askubuntu.com/a/42853/63025

atenz
  • 12,772
  • Why copy the shortcut to the desktop when you can edit the one in /usr/share/applications/? – Dan Dascalescu Jun 09 '16 at 03:54
  • 1
    I wonder if a software update could overwrite the modified shortcut. Maybe it is safer to make a new one with your custom options. – Mike Dec 21 '16 at 21:08
  • Changing the one in /usr/share/applications will change it for all users. It may also not be possible if you don't have root access (sudo). – Luciano Mar 28 '20 at 19:02