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?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityIn 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?
Note:
gnome-desktop-item-edit
was removed fromgnome-panel
in 19.10 (see gnome-desktop-item-edit: command not found on Ubuntu 19.10 and later even with the 'gnome-panel' package installed). So, this answer is unlikely to work for 19.10 and later.
The old GUI dialog is still available if you still want to use this:
Using ALT+F2 type
gnome-desktop-item-edit --create-new ~/Desktop
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 installed gnome-tweak-tool
.
Alternatively, you can install the old gnome-panel without much of the bulk:
sudo apt-get install --no-install-recommends gnome-panel
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
gnome-desktop-item-edit --create-new ~/Desktop
into the command section work to do this, then you would have a desktop icon to create launchers.
~/.local/share/applications/
- then they turn up in the dash.
Sep 19, 2014 at 10:25
You can do it manually. Make a new text-file named something.desktop
and write this in there:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=command to run here
Name=visible name here
Comment=comment here
Icon=icon path here
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).
#!/usr/bin/env xdg-open
shebang really necessary? I don't see it used in other answers.
Jun 6, 2019 at 2:05
gdbus.error: ...unknown xorg.xfce.panel was not provided by any .service files
There is cooler way:
Original picture taken from iloveubuntu.net which currently inaccessible
To install, type open a terminal with Ctrl+Alt+T and write:
sudo add-apt-repository ppa:diesch/testing sudo apt-get update sudo apt-get install arronax nautilus -q
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-
sudo apt-get install gnome-tweak-tool
2- Then type the following to launch it
gnome-tweak-tool
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 code
gnome-desktop-item-edit ~/Desktop/ --create-new
put 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/
gksudo gedit /usr/share/applications/give-any-name.desktop
Paste the following text
[Desktop Entry]
Type=Application
Terminal=false
Icon=/path/to/icon/icon.png
Name=give-name-here
Exec=/path/to/file/executable
Categories=Utility;
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.
xdg-desktop-icon install /usr/share/applications/google-chrome.desktop
Jul 25, 2014 at 16:48
Make a file called something.desktop
, open it in gedit and type:
[Desktop Entry]
Name=Launcher Name
Comment=Launcher Comment
Exec=Command to Execute
Terminal=false
Type=Application
Icon=Path to Icon
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
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.
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.
Here are the commands, with me using the "leafpad" GUI text editor:
mkdir ~/Desktop_launchers
sudo apt update && apt install leafpad
cd ~/Desktop_launchers
leafpad Arduino_1_8_5.desktop
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:
[Desktop Entry]
Name=Arduino 1.8.5
Comment=
Exec=/home/gabriels/Downloads/Install_Files/Arduino/arduino-1.8.5/arduino
Icon=/home/gabriels/Downloads/Install_Files/Arduino/arduino-1.8.5/lib/arduino.png
Terminal=false
Type=Application
StartupNotify=true
Save and exit.
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.
chmod +x Arduino_1_8_5.desktop
Command Format: ln -s /path/to/file /path/to/symlink_to_make
ln -s ~/Desktop_launchers/Arduino_1_8_5.desktop ~/Desktop/Arduino_1_8_5.desktop
Note that ending your symlink with ".desktop" is mandatory or else it won't display or work properly as a Desktop shortcut.
sudo ln -s ~/Desktop_launchers/Arduino_1_8_5.desktop /usr/share/applications/Arduino_1_8_5.desktop
Notes:
rm ~/Desktop/Arduino_1_8_5.desktop
sudo rm /usr/share/applications/Arduino_1_8_5.desktop
My Desktop with the newly-created shortcut:
The Unity Launcher menu with the newly-created shortcut:
For additional knowledge and alternate techniques, see the Official Ubuntu Documentation on "UnityLaunchersAndDesktopFiles" here: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
desktop_file_install.sh
and desktop_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.
#!/bin/bash
FORM=$(zenity --forms \ --title="Simple shortcut maker" --text="Create new .desktop file" \
--add-entry="Program Name" \
--add-entry="Command or path to file" \
--add-entry="Terminal app(true/false)" \
--add-entry="Icon (path)")
[ $? == 0 ] || exit 1
awk -F'|' -v home="$HOME" '{
FILE = home"/Desktop/"$1".desktop"
print "[Desktop Entry]" >> FILE
print "Type=Application" >> FILE
print "Name="$1 >> FILE
print "Exec="$2 >> FILE
print "Terminal="$3 >> FILE
if ($4 !~ /^[ ]*$/)
print "Icon="$4 >> FILE ;
system("chmod 755 " FILE);
}' <<< "$FORM"
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.
FILE = home"/Desktop/"$1".desktop"
, where home
is defined as variable to the awk
command in -v home="$HOME"
part. What you can do, is remove all references to FILE
from the awk
command, and redirect the command itself to a specific filename you want to create via > somefile.desktop
. It's not too difficult , just need to rewrite that specific part. Please remind me in couple of days. I will try to update this answer tomorrow, but i might forget.
Mar 25, 2017 at 11:23
gnome-desktop-item-edit
)) but I think yours might be nicer.
I have developed a little command line program for launchers creation. Example:
iconize -n "Sublime Text" -p /home/marco/Desktop/sublime/sublime -i /home/marco/Desktop/sublime/Icon/256x256/sublime_text.png
It will create a corresponding desktop entry inside ~/.local/share/applications
:
[Desktop Entry]
Type=Application
Name=Sublime Text
Exec=/home/marco/Scrivania/sublime/sublime %U
Icon=/home/marco/Scrivania/sublime/Icon/256x256/sublime_text.png
You can then move it to your desktop like this:
mv ~/.local/share/applications/sublime-text.desktop ~/Desktop
More powerful alternatives are Alacarte and MenuLibre (they have more functions and a graphical user interface).
please be aware of this wiki page I've made, because I've noticed that questions on desktop and unity launchers are very often :) https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
This can be easily be achieved using nautilus-action
& gnome-desktop-item-edit
.
Install nautilus-action by running following command in terminal:
sudo apt-get install nautilus-action
Launch Nautilus-Actions and create a new action.
Under the Action tab, check on "Display item in location context menu", then in Context label, enter this: Create Launcher.
Open now the Command tab and enter the following details:
Label: Create Launcher
Path: gnome-desktop-item-edit
Parameters: --create-new %f
Working directory: Click Browse and select your Desktop folder.
Leave rest of the tabs as it is.Save now your command and exit:
Restart Nautilus:
nautilus -q
You can add shortcuts from the context menu by selecting Create Launcher
The shortcut is added in your current directory you right-click on
$ sudo apt-get install nautilus-actions Reading package lists... Done Building dependency tree Reading state information... Done Package nautilus-actions is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'nautilus-actions' has no installation candidate
nautilus-action
has been replaced with filemanger-actions
. But it isn't in the repo, use ppa from the bug report: bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1768597
Jan 14, 2019 at 6:04
I found the Add to Desktop GNOME Shell extension that gives a far easier and quicker way to create shortcuts, it works perfectly for me.
NOTE: Tested on Ubuntu 18.04 and 20.04
This extension adds a new line in the app context menu of the 'Show Applications' section, this new line ('Add to Desktop') if clicked automatically creates the shortcut on the desktop.
Using Show Applications is very handy because all the apps are already listed there, you can stop searching for your app in multiple directories.
Install "Create Launcher" from the Ubuntu Software Center. You can search this name to find it there. See also: Link - Ubuntu apps directory
I've noticed that both gnome-panel and gnome-tweak-tool need a load of dependencies, even with --no-recommends
.
The method I've used so far is to choose an arbitrary icon from the Dash, such as Firefox, and drag it to the desktop. You can't drag a icon from the Launcher, it doesn't let you. So it has to be the Dash, so press the Super (or Windows) key on your keyboard to launch the Dash, make sure it's not fullscreen (toggle it with the button at the top-left), then drag any icon at all onto your desktop.
Then right-click on the new desktop icon and change the path, description, icon (and comment if you like). Then drag this new launcher to somewhere like /home/yourname/Misc/Apps
and finally, from there, drag it to the Launcher.
Note : If you drag the file from the Desktop to the Launcher directly, then delete the Desktop file, the Launcher entry will stop working, even though it looks fine. I assume it makes some kind of shortcut to the original which you've just deleted.
On Ubuntu 20.04, this can be done without installing any (third-party) extension, although you need some manual work.
Go to /usr/share/applications
, copy the desktop file of the application which you want to add, to your home's Desktop
folder (~/Desktop
).
You will find the file added to the desktop. Then, right-click on the file and click on Allow launching. After that, you can double-click on the icon to launch the application.
Go to : /usr/share/applications
And do : sudo gedit
In the notepad paste :
#!/usr/share/applications your-application
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true/false*based on the appearance you want to make*
Exec=*the command*
Name=name-of-your-application
Comment=some-comment
Icon=some-icon
Save it as your-application
, for example codium.desktop
or any style that is normal as in /usr/share/applications
.
Save it, and you're good to go. Tested
These launchers have one problem: you can't use them from the web browser, for example to attach archives to email messages or to upload files to sites like http://2shared.com/
There is an easy solution:
ln -s /destination/directory ~/Desktop/nameofshortcut
for example: ln -s /data/music ~/Desktop/good_music
This way an icon appears at the desktop, with the image of a folder with an arrow below it, that represents a shortcut, instead of the spring or rocket of the launchers.
In 14.04, you can right-click on the executable and choose Make Link
, then you can drag and drop that link onto your desktop.
To attach this program to your launcher, simply start the program and then while it's running, right-click the icon on your launcher bar and choose Lock to Launcher
.
Note: adding programs to your launcher bar in this way does not work with WINE applications, however you can still add WINE apps to your desktop this way.
For Ubuntu 19.10 and later :
You can add a desktop file into your <home_directory>/.local/share/applications
folder.
Just add a file like below -
[Desktop Entry]
Type=Application
Terminal=false
Icon=/path/to/icon/icon.png
Name=Name of the application
Exec=/path/to/file/executable
(*) You will get an error if you just try to drag/drop with Nautilus as a normal level user. That error was what made me figure out the six steps listed here. It's another example of "failure" being a step on the path to success.