Ubuntu: how to create shortcut icon for *.sh

Little tutorial about how to create a shortcut icon for *.sh files on Ubuntu.
For this example, I’ll create a shortcut for Android Studio

  1. Open Gedit.

  2. Paste the following into the file, editing the relevant parts:


[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=someicon
Exec=sh /path/to/studio.sh
Name=Android Studio
  1. Save the file as somename.desktop, into desktop.

  2. Next, you need to make this file executable by typing the command:


$ cd ~/Desktop && chmod a+x somename.desktop

Now, double-clicking the application should launch your application.