creating desktop icon for Arduino 1.6.7 in 14.04

Solution 1:

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.

Solution 2:

Did it work? Just as a tip - after you create a desktop entry, while you're still in the desktop folder, execute:

desktop-file-validate foo.desktop

"foo, of course" is the name of your desktop file. What this will do is check your file against the specifications of freedesktop.org for semantic and stylistic errors. Some of the aforementioned lines aren't actually necessary, just optional - such as comment (aka tooltip), categories (refer to freedesktop site for compliance and usage), and terminal (only useful if the program must be executed in a terminal). I've been having a lot of fun with this one. You can use it to create "launchers" for webpages and all sorts of things using custom icons.