50

Can somebody please explain to me how to create a desktop shortcut to an application like Chrome or Blender as if I'm an idiot? I really don't get it. I have the gnome panel program thing and can run it (see image) but after that I'm lost.

PIC RELATED

68

You have to install gnome-panel package which comes up with ability to create a application launcher on the desktop or wherever you like. Add --no-install-recommends suffix to prevent other package that aren't necessary.

sudo apt-get install --no-install-recommends gnome-panel

After installing gnome-panel, use following command to create a launcher.

gnome-desktop-item-edit --create-new ~/Desktop

Once you execute the above command, create launcher application will be opened.

enter image description here

  • In Type field "Application" will be a default value. If you're creating launcher for application which has no gui, that runs in terminal like VIM editor then you need to select "Application in Terminal".
  • In Name field type application name.
  • In Command field type the executable command which open your application.
  • Comment field is optional.

To set icon, click on the small box on the top left side near name field and choose a image for it. Click "OK" if you are done.

| improve this answer | |
  • 2
    Note the language localization: on spanish Ubuntu v16.04 you must use gnome-desktop-item-edit --create-new ~/Escritorio or the command will fail. – Sopalajo de Arrierez Jan 10 '19 at 0:23
  • 2
    This will no longer work for Ubuntu 20.04. When I try this I get the following error: gnome-desktop-item-edit: command not found – Sajeeb May 26 at 5:01
  • 1
    now working in Ubuntu 20.* gnome-desktop-item-edit: command not found – dipenparmar12 Sep 24 at 9:46
  • It appears that gnome-desktop-item-edit was removed from gnome-panel in 19.10: askubuntu.com/a/1184737/457041 – Michael Hays Oct 1 at 22:02
15

Complete instructions can be found in the answers to this question. Here's the really simple version:

  1. Launch Nautilus (the file manager).
  2. In Nautilus, click on Computer.
  3. From there, navigate to /usr/share/applications.
  4. Find the icon of the program you want a shortcut for, click on it, and type Ctrl+C to copy.
  5. In Nautilus, click on Desktop in the left pane.
  6. Type Ctrl+V to copy the shortcut to the desktop.
  7. Right-click your new shortcut, click Properties, click on the Permissions tab, and make sure that the Allow executing file as program box is ticked.
  8. X out of the Properties dialog and also out of Nautilus. Enjoy your new desktop shortcut!

Edit: @DanDascalescu is right, this method just copies the executable rather than creating a shortcut. Please don't use this method. Sorry folks!

| improve this answer | |
  • 2
    If you find my answer helpful, please consider upvoting or accepting it. – rclocher3 Nov 28 '16 at 1:12
  • 4
    This just copy the program completely to desktop AFAIU – Samitha Chathuranga Dec 19 '17 at 9:36
  • 10
    This doesn't create a shortcut, this copies the executable to ~/Desktop. How does this answer have so many upvotes? – Dan Dascalescu Jan 24 '18 at 8:27
  • 1
    didn't work, gives an error "The executable launcher was unable to locate it's companion library" – dezzer10 Nov 19 '18 at 9:25
  • @DanDascalescu, NO, this does not copy an executable. If you look at the file properties, you will see it says - "Desktop configuration file". If you open it with a text editor, you will see that it is a typical shortcut. – Eugene Kartoyev Jan 27 '19 at 1:06
11

To create a launcher on the Desktop:

1) You need gksu so if you don't have it yet, run in terminal:

sudo apt-get install gksu

2) Run gedit (or any other text editor) and then enter the info below:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/opt/lampp/htdocs/favicon.ico
Name[en_US]=XAMPP
Exec=gksu /opt/lampp/manager-linux-x64.run
Comment[en_US]=Start XAMPP Control Panel
Name=XAMPP
Comment=Start XAMPP Control Panel
Icon=/opt/lampp/htdocs/favicon.ico
Save the file on your Desktop as Xampp.desktop

3) Once the shortcut is on the Desktop, right-click on it, go to Properties, Permissions tab, and check 'Allow executing file as program'

The above creates a shortcut for XAMPP control panel.

| improve this answer | |
  • 6
    Why is gksu required? – Code-Guru Jan 15 '18 at 17:41
  • 2
    What's that icon path? How do I get the icon from an executable? – Dan Dascalescu Jan 24 '18 at 8:28
  • gksu is not required – Eugene Kartoyev Jan 27 '19 at 1:08
  • gksu is required to run/execute the file Exec=gksu /opt/lampp/manager-linux-x64.run check 8th line! – Rajath Jan 9 at 5:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.