Ubuntu – Creating desktop icon for Arduino 1.6.7 in 14.04

14.04icons

Being a newbee with Ubuntu, I still struggle quite a lot with setting up desktop icons to my apps. I am currently trying to setup a desktop icon to Arduino IDE and I don't know enough to properly set it up. Here's the current setup.

I have installed Arduino-1.6.7 in a folder by that name in my home folder. At present, the only way I can run it is to go to the terminal, CD to the
Arduino-1.6.7 folder and then run it with $ ./arduino. This works but obviously, I would rather run it with a simple icon.

I have tried to use this method, but when I browse to /usr/share/applications, there is no icon for Arduino.

Thank you for being part of the village that raises this idiot.

Best Answer

Ubuntu has something called a .desktop file, which acts as a shortcut to whichever app you want. You can specify an icon you want, the name of the shortcut, the description that appears when you hover over the shortcut, and a lot of other stuff. It's not the easiest setup, but it's not hard, either. Here's how to do it.

  1. Open a terminal (Ctrl+Alt+T), and run gedit ~/Desktop/Arduino.desktop.
  2. In the text editor window that opens, paste this:

     [Desktop Entry]
     Name=Arduino
     Comment=Arduino IDE
     Exec=/path/to/the/arduino/executable
     Path=/path/to/the/arduino_folder/
     Icon=/path/to/arduino/icon.png
     Terminal=false
     Type=Application
     Categories=Utility;Application;Development;
    
  3. Edit the Exec,Path, and Icon fields to point to the appropriate locations.

  4. Save the file and close Gedit.

  5. Now, go to your Desktop folder and test the shortcut bu double-clicking it. If it works, you can drag the icon to your launcher to have it there, as well.

NOTES:

  1. You may get a warning when you try to use the .desktop file, telling you it is not trusted, or something similar. If you see this, right click on the file, go to Properties >> Permissions and check the box that says something like Allow executing file as program. The warning will be gone.

  2. Remember to use absolute paths in the desktop file. Don't use relative paths. An example of an absolute path is /home/username/arduino-1.6.7/. A relative path is something like ~/arduino-1.6.7 (the ~/ points to your user folder) or ./arduino-1.6.7 (./ means whatever folder you're currently in, which would be the Desktop in this case).

If you need any help, comment.

Related Question