Skip to content

Instantly share code, notes, and snippets.

@gdjohn4s
Last active January 5, 2023 22:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gdjohn4s/fc9b29b066cd1b9a0846e1406a490bdc to your computer and use it in GitHub Desktop.
Save gdjohn4s/fc9b29b066cd1b9a0846e1406a490bdc to your computer and use it in GitHub Desktop.
Create Ubuntu Desktop shortcut

How to create Desktop shortcut on ubuntu 18.04

To create a desktop shortcut on your ubuntu, just open gedit on desktop and paste those strings:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/snap/bin/skype
Name=Skype
Comment=Skype
Icon=/snap/skype/23/usr/share/icons/hicolor/256x256/apps/skypeforlinux.png

Then save this file like this "APPNAME.desktop" Ex: Skype.desktop

If you are on terminal, type:

$ cd /home/$USER/Desktop/

and then:

gedit APPNAME.desktop

It will appear text editor.

Parameters

So, parameters will modify some options for your shortcut. Most importants are:

  • Type (define the application type)
  • Exec (define the main program absolute path)

For example, let's assume you need a shortcut for your android-studio under '/home/$USER/programs/android-studio', we want a desktop icon shortcut, so first we open gedit and paste those strings i wrote up here like this. Now open your android-studio folder and copy the absolute path.

Ex:

/home/$USER/programs/android-studio/bin/studio.sh

I forgot to tell you that you need the EXECUTABLE PROGRAM absolute path and not dir path. Put the icon path if you want then save this file on the desktop, trhust it as executable, open it and you will see the magic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment