How can I customize an icon on the dash/launcher?

all. I have a question that has been bugging me recently.. Say I install Blender.. I am using the Bumblebee project thing, so in order to properly use it, I have to go to the terminal and type "optirun blender". If I just click on the icon on the dash, it will run without the proper parameter being passed. Is there a way I could customize the Blender launcher on the dash so it would always launch it with the optirun parameter?

Thanks.


Solution 1:

You can copy the blender.desktop out of /usr/share/applications, and into your ~/.local/share/applications directory, and edit it there to have a different command line. Don't edit the one in /usr/share/applications, as package updates will revert your changes.

Solution 2:

You could edit its launcher. The launcher configurations sit in /usr/share/applications so you can run sudoedit /usr/share/applications/blender.desktop and change its Exec statement so you end up with something like this:

[Desktop Entry]
Name=Blender
GenericName=3D modeller
GenericName[es]=modelador 3D
GenericName[de]=3D Modellierer
GenericName[fr]=modeleur 3D
GenericName[ru]=Редактор 3D-моделей
Comment=3D modeling, animation, rendering and post-production
Comment[es]=modelado 3D, animación, renderizado y post-producción
Exec=optirun blender
Icon=blender
Terminal=false
Type=Application
Categories=Graphics;3DGraphics;
MimeType=application/x-blender;

As dobey suggests, you can also make changes in the user ~/.local/share/applications directory. This will make the change for only this user, instead of globally (if you have a multi-user system). Keeping a copy of your changes locally is a good idea if you'd like to make them more upgrade-proof. Be aware that changes in the local directory won't automatically reflect changes made by upgrades to the main configuration file (for example, arguments to Exec).