37

I started by searching guides. I found this guide but neither of the main methods works anymore in 11.10.

  1. The first solution, I have created the desktop file, however the file location given as .gconf-> desktop-> unity-> launcher -> favourites no longer exists. I can get to /home/sayth/.gconf/desktop but there is no longer a unity folder.

  2. The second solution described right-clicking the desktop and creating a launcher. Right-clicking the desktop no longer produces a "create a launcher" option.

I manually installed geany 0.21 as the one in the repo's is outdated. It's installed and working correctly, and is executing from /usr/local/bin/geany.

How can I add it to the launcher?

6

12 Answers 12

27

First thing I'd do is navigate to /usr/local/share/applications & see if there is a geany.desktop

If so then just drag onto the launcher.

If not then would just a minute or so to set up. Your source has a 'geany.desktop.in', remove the .in & it's a perfectly good geany.desktop

Edit: the geany.desktop.in is a good template for your .desktop but needs some minor editing before copying or after. Lines 4,5,6 start with a _ that should be removed.

Ex. of edited geany.desktop (or edited geany.desktop.in

[Desktop Entry]
Type=Application
Version=1.0
Name=Geany
GenericName=Integrated Development Environment
Comment=A fast and lightweight IDE using GTK2
Exec=geany %F
Icon=geany
Terminal=false
Categories=GTK;Development;IDE;
MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;
StartupNotify=true

The source also has some geany icons in it, take the geany.png from geany-0.21/icons/48x48 & put somewhere like Pictures or Documents Then copy the geany.desktop.in file sitting in the source folder to ~/.local/share/applications/geany.desktop

Ex. - if it was in Downloads/geany-0.21

cp Downloads/geany-0.21/geany.desktop.in  ~/.local/share/applications/geany.desktop

Then just go there,

nautilus ~/.local/share/applications

right click on geany .desktop > properties > click on the icon area & browse to your geany.png > open

Finally drag geany.desktop onto your launcher

Edit: one advantage you'll see with a more 'proper' .desktop is it has a MimeTypes= line. Open up the .desktop in a text editor & take a look.

You can, if you want, now drag & drop any of those mimetypes on to the geany icon in your launcher & they'll open up in geany

1
  • I've put a bounty on the original question for 11.10 if you want to make a generic version of this over there so we have them all in one place. Nov 13, 2011 at 17:33
27

You can add a custom launcher in Ubuntu 11.10 by typing this in a Terminal

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

Once you have customized the item on your Desktop, drag it to the Launcher.

7
  • 6
    And because this command is complicated to remember, you can record it in an alias. Edit your ~/.bashrc gedit ~/.bashrc and add this line alias cla='gnome-desktop-item-edit --create-new ~/Desktop' . I choose cla for Create Launcher App, I find it easy to remember.
    – Boris
    Nov 13, 2011 at 6:50
  • 2
    It requires installing the gnome panel sayth@sayth-TravelMate-5740G:~$ gnome-desktop-item-edit ~/Desktop/ --create-new The program 'gnome-desktop-item-edit' is currently not installed. You can install it by typing: sudo apt-get install gnome-panel
    – sayth
    Nov 13, 2011 at 7:08
  • @sayth: so after installation of gnome-panel, it works now right ?
    – Boris
    Nov 13, 2011 at 7:29
  • 1
    I was debating whether to install it. Seems odd to need to install gnome-panel so the unity launcher works
    – sayth
    Nov 13, 2011 at 8:58
  • Awesome !!! Too easy :) Just needed to install the gnome-panel package !!!
    – loloof64
    Dec 20, 2013 at 9:55
11

In Ubuntu 12.04 none of the above options worked for me when needing to create a launcher for a locally compiled app. This might be an app you created yourself or something you downloaded from source and then had to locally run make install. I ended up needing a hybrid of tips found in this thread. Using Angry Birds as a hypothetical example, I did the following:

  1. Create an angry-birds-launcher.desktop file and save it to the /usr/share/applications directory. You can do this in a single command with sudo gedit /usr/share/applications/xyz.desktop. The actual file name is not important so long as it ends in .desktop
  2. Gedit will open with a blank page. In gedit, input the following text:

    [Desktop Entry]
    Type=Application
    Name=[Name of your app, for example Angry Birds. This can be free text.]
    Exec=[full path to your executable and executable name, for example /usr/local/bin/angry-birds]
    Icon=[full path to your executable's icon and icon name, for example /usr/local/share/icons/apps/angry-birds.png]
    Terminal=false
    StartupNotify=true
  3. Double check for typos and save the file.

  4. Open Nautilus and browse to /usr/share/applications and you should see in the list of apps your app with the correct icon.
  5. Double click to launch the app. A temporary icon will appear in the panel. Because you launched an app from the 'official' directory (usr/share/applications), Ubuntu will finally display the menu option to lock the launcher into the panel.
  6. Mouse over the launcher in the panel, right click and select Lock into Launcher. You should be all set at that point.
2
  • 1
    This solution worked perfectly for Ubuntu 16.10 Nov 18, 2016 at 14:08
  • great. it works on Ubuntu 22.04
    – Jake
    Aug 19, 2022 at 5:54
5

I must have read this question dozen times, everytime I install Ubuntu on another computer :)

The easiest way to add a custom launcher is using a GUI tool.

There are at least two I know of:

  • MenuLibre - my new favourite :)
  • Alacarte - the one I used for years, but now has bugs

Installation

MenuLibre can be installed by running following command in your terminal:

sudo apt install menulibre  

or simply search the Software Center for menulibre and install from there.

Likewise, to install alacarte run:

sudo apt install alacarte  

or search the Software Center for alacarte.

You only need one,so make a choice and you will be adding launchers in no time!

Last but not least, here is a picture ( worth at least a thousand words )

enter image description here

Alacarte looks simmilar but is simpler and less advanced.

Now about those bugs I mentioned: Alacarte now has isues with PNG icons, so even though it makes you believe it is adding the icon they don't save and you launchers will be icon-less.

1
3

Starting from Ubuntu 15.04, you can achieve this by starting your program and then right clicking on the icon in the dock and then selecting "Lock to Launcher".

2

You can follow this tutorial: " Howto create Application launcher and add icon to Unity in Ubuntu 13.04 / 12.10 / 12.04 "

1
  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – fossfreedom
    May 16, 2013 at 22:14
2

How to Add custom launcher without installing extra programs

I have verified this as working under Ubuntu 15.10. I do not know about earlier versions. The example below is for adding an Emacs desktop launcher to the desktop, and then changing the Command to execute my own script/program.

Open the Dash by pressing the Windows Key, which on my keyboard, is mapped to the Super_L key (reported by xev program). Once in the Dashboard, type the name of some program. In this example, I typed emacs because I want a launcher that launches Emacs, but instead runs a script I have that sets up some environment and then executes Emacs:

Dash with Emacs

Drag the icon to the desktop:

Drag Emacs icon to desktop

Right mouse click on the icon on the desktop, and then click on Properties (sorry, due to X windows grabbing, I cannot provide a screen-shot of that menu no matter what I tried!). This is what you might see before making modifications:

Emacs launcher Properties before changing

You can now change the Command to whatever you want. In my case I changed it to run-my-emacs.sh, which happens to be in my PATH, which I have previously set up in my startup scripts:

Emacs launcher Properties after changing

Click ESCape key to exit after making changes. Do note the bug in the screenshot above.

Double check that it works by double-clicking the icon on the desktop.

1

When creating a .desktop file for your launcher you may want to give a path to the application's icon there:

Icon=/full/path/to/icon

In case you just want to change an icon to other than default you can do so by opening the Preferences menu with a right click on the .desktop file. This will show the following dialog:

enter image description here

Click on the icon to open a file selector box to give a new icon path.

Local .desktop files can be found in ~/.local/share/applications/, custom icons may be stored in ~/.icons/.

Only icons from .desktop files having executable permission will be shown.

0

Using Ubuntu 16.10, I just dragged an existing icon from the luncher panel to the desktop, edited it with a plain text editor and added it back, as suggested by bgoodr. Worked like a charm.

0

An excellent answer (at least for uBuntu 18.04) is the one from J. Austin Rodriguez. From the bash terminal, type gnome-desktop-item-edit ~/Desktop/ --create-new and use the Create Launcher GUI to define the shortcut.

The distinction between Application and Location in generated .desktop files should allow you to create shortcuts manually (by copying a template and editing the contents).

Application:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=PATH-TO-APP-OR-COMMAND (eg. /usr/bin/atom)
Name=NAME (appears in Linux user interface eg. Files)
Comment=SOME-COMMENT (optional)
Icon=PATH-TO-ICON (eg. atom)

Location (or Link):

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Link
URL=PATH-TO-FILE
Name=NAME (appears in Linux user interface eg. Files)
Comment=SOME-COMMENT (optional)
Icon=PATH-TO-IMAGE (optional)
0

A google-chrome app example, tested on Ubuntu 22.04

  1. download a icon for the app, save at /home/xxx/note.png
  2. create file: ~/.local/share/applications/chrome-youdao-note.desktop
[Desktop Entry]
Type=Application
Name=youdao-note
Exec=google-chrome --app=http://note.youdao.com --new-window
Icon=/home/xxx/note.png
Terminal=false
StartupNotify=true
  1. search chrome in launcher enter image description here
0

In my case I resolved the issue by searching for my custom launcher in the action menu, and drag it to the launcher panel.

e.g. I wanted to create a custom launcher for Firefox, with direct choices for my different Firefox profiles.

  • Stopped all instances of Firefox
  • Removed existing Firefox launcher from launcher panel.
  • Copied /snap/firefox/current/firefox.desktop to ~/.local/share/applications/firefox.desktop
  • Did my edits of ~/.local/share/applications/firefox.desktop
  • Searched the Action menu for Firefox. Identified my custom launcher by the added menu items.
  • Dragged the correct launcher to the launcher panel.

Tested on 22.04 Jammy Jellyfish

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .