In older versions it was easy to create a launcher on my desktop. All I had to do is right click on my desktop and select the "create launcher" option.
How can I create such launchers now?
In older versions it was easy to create a launcher on my desktop. All I had to do is right click on my desktop and select the "create launcher" option.
How can I create such launchers now?
The old GUI dialog is still available if you still want to use this:
Using ALT+F2 type
This will launch the old GUI Dialog and create a launcher on your Desktop:
Prerequisites
gnome-desktop-item-edit
is installed automatically if you have installed gnome-shell/gnome-fallback. It is also installed automatically if you have previously installedgnome-tweak-tool
.Alternatively, you can install the old gnome-panel without much of the bulk:
You can later move the
MyLauncher.Desktop
file from~/Desktop
to~/.local/share/applications/
to make it appear in all applications dashboards, or to/usr/local/share/applications
to make it available to all users (Thanks to @JonBently's comment).EDIT: ubuntu 22.04+ the app is called gnome-tweaks ..... 28-07-2022
You can do it manually. Make a new text-file named
something.desktop
and write this in there:Don't forget to make the file executable (
chmod +x something.desktop
)OR click right mouse button on that label and select 'Allow launching' (Tested in Ubuntu 19.04).
There is cooler way:
Arronax
Original picture taken from iloveubuntu.net which currently inaccessible
To install, type open a terminal with Ctrl+Alt+T and write:
This is cooler because it has drag&drop and more functions with a GUI.
More about Arronax on ubuntugeek.com.
No longer works in latest version, desktop icons were completely removed.
This Is a solution to get it back on the right click menu In Gnome and Unity,
1- Install gnome-tweak-tool , if you don't already have it, In terminal paste-
2- Then type the following to launch it
Or use the key shortcut Alt+F2 type
gnome-tweak-tool
then click "Run"3- Navigate to the "Desktop" tab on the left pictured - And turn ON
"Have file manager handle the desktop"
4-Source for this part: 1 Now we are going to create a Script to put on the right click menu -
Open
gedit
either by terminal or Alt+F2, Paste the codeput only this into the new text document and then save it as "Create New Launcher" no extension needed (you may need to use .sh as extension ex "Create New Launcher.sh", if you can't make it executable in the next step).
5- Now we need to make the file executable, Right click on the file go to > Properties > click Permissions tab > look for "Execute" and check "Allow executing file as program" then close out.
6- Open the file browser, go to > View > Show Hidden Files, now navigate to you home folder, and Place the file in
~/.gnome2/nautilus-scripts
. Shown below -7- Now we have Create new launcher on the right click menu! Right click on your desktop and go to > Scripts > Create New Launcher Then fill in the comand information for the application you want,
Shown below-
If you forget what the app's launch command is click "Browse" then navigate to File System > usr > bin which is /usr/bin , these are the applications on your system, most should automatacally find the icon after you click "Open" , although they won't show up before.
If It dosn't show the icon when you get back to the "Create Launcher" box you can drag a icon in by finding the icon in /usr/share/icons . There are default icons in the various theme folders or specific icons in the
/usr/share/icons/hicolor/scalable/apps
or/usr/share/icons/hicolor/48x48/apps
, or if later you want to put an icon in you can right click > properties to drag and drop the icon in.(This part only for gnome, alt+f2 is diffrent in unity) Another way to list known applications is to hit Alt+F2 and click on the app under "Show list of known applications", you can then copy the command text for that program to paste in to
Create New Launcher.
All this will make it extremely easier to make custom launchers, and once setup you can make them without the terminal.
Create the .desktop file in /usr/share/applications/
Paste the following text
Give to Name the name you want.
As for Icon and Exec, use either a full path or a "system" name. For example, the VLC video player icon is either /usr/share/icons/hicolor/48x48/apps/vlc.png or simply vlc (without the .png extension).
For Categories, consult the XDG Standards list.
An easier way to create a launcher for a program:
If you can find the program in your dash, just click and drag the icon for the program in your dash onto your desktop or wherever else you would like it. :)
In 14.04 / 15.10 / 16.04 /17.04 / 17.10 To create a shortcut on the desktop to an existing application: the simplest solution (not found in the other answers as far as I can see) is to copy the application's desktop file to the Desktop: go to
/usr/share/applications,
right click on the application's desktop file>copy
, go to your desktop, right click>paste
. Don't forget to make it executable, its correct icon will appear after you made it executable.Simply drag and drop the icon from Dash on to the Desktop does not work in 14.04.
Make a file called
something.desktop
, open it in gedit and type:Put this is
/usr/share/applications
and when you run it right click the app in the Unity Launcher and tick "Keep in launcher" (if you want it in the Unity Launcher), or just put it on your desktop if you want a Desktop launcher.Put this file in
~/.local/share/applications
if you want to apply this to your user.Jurriaan has made a graphical python app to do all this for you, it can be downloaded here: http://jurschreuder.nl/UnityLaunchCreator.tar.gz
How to create both a Desktop shortcut AND a Unity Dash / Gnome dock ("start menu") icon option using one .desktop file and two symlinks
(Tested in Ubuntu 14.04, 16.04, 18.04, and 20.04).
In this example we will make a launcher for Arduino v1.8.5. The executables were previously extracted into this folder: "~/Downloads/Install_Files/Arduino/arduino-1.8.5". The main executable file to launch the application is stored at "~/Downloads/Install_Files/Arduino/arduino-1.8.5/arduino".
Follow my example below, updating all steps as necessary for your application, including modifying the .desktop file contents as required.
My strategy will be to create a single .desktop file to act as the "master" launcher for the program, then we will create two symbolic links (symlinks) to this file to allow us to launch the program (1) via an icon on your Desktop, and (2) using the Unity or Gnome Application launcher search menu.
Q: Why do it this way?
A: Well, it allows you to only have to edit a single .desktop file to make changes to the shortcuts in both places at once.
Q: Why not just do the .desktop file directly on the Desktop and then make a single symlink for the Unity/Gnome application launcher?
A: because this way the .desktop file sits safely in a different folder where you and your kids won't accidentally delete it from the Desktop, so you know it won't get accidentally modified or deleted.
STEPS:
1. Make a launcher (.desktop file), using a text editor of your choice, editing it as required. Store it in "~/Desktop_launchers/Arduino_1_8_5.desktop".
Here are the commands, with me using the "leafpad" GUI text editor:
Copy and paste the following into the "Arduino_1_8_5.desktop" file you just created.
Exec
paths with spaces, you must use the single quotes ('
) around the path name below, or else you will get an "error launching the application" when you click on the run link.Icon
path, however, even if it has spaces in the path, you must not use the single quotes around the path or else the icon won't properly show up on the link.Arduino_1_8_5.desktop
file contents:Save and exit.
2. Make it executable.
Note: this step is important! You must do this BEFORE creating the symbolic link in the next step below or else the symbolic link you're about to create won't work properly as a shortcut to launch the program from your Desktop.
3. Make a symbolic link to your above .desktop launcher on the Desktop so you can launch it from there:
Command Format:
ln -s /path/to/file /path/to/symlink_to_make
Note that ending your symlink with ".desktop" is mandatory or else it won't display or work properly as a Desktop shortcut.
4. Make a symbolic link to it on the Unity/Gnome Applications menu so you can launch it from there too:
Notes:
5. Done!
rm ~/Desktop/Arduino_1_8_5.desktop
sudo rm /usr/share/applications/Arduino_1_8_5.desktop
Screenshots:
My Desktop with the newly-created shortcut:
The Unity Launcher menu with the newly-created shortcut:
Additional Reading:
For additional knowledge and alternate techniques, see the Official Ubuntu Documentation on "UnityLaunchersAndDesktopFiles" here: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
See Also:
desktop_file_install.sh
anddesktop_file_uninstall.sh
scripts.Considering previous answer by Scaine , the
gnome-panel
way installs dependencies, but at the very bottom of things - we don't really need those, we just need to have.desktop
files created. Thus , I've put a small script that does exactly that, the graphical way, creating a named.desktop
file in the~/Desktop
folder, readily available for use and pinning to the Unity launcher. Not the best scripting here, but does the job.This can be saved as file named
makeLauncher.sh
, change permissions from Right Click -> Properties -> Permissions -> Allow executing file as program, and it's ready to go.And here's how it looks
Side note: sadly, zenity's form field doesn't have checkbox for a forms widget, so the true/false for Terminal app option has to be typed. I am considering rewriting this script in PyQt.