Will Unity allow making custom launcher icons from .desktop
files or via menu editing system? (Right now the launcher doesn't give the option to "keep in launcher" on all programs.
For some programs I use, I have to make custom launchers or .desktop
files.
For instance, daily blender builds are generally just folders with an executable.
In basic Gnome or KDE, I can make a new menu entry with the menu editing system. Then, I can also add it to Docky either from the menu or by dragging a .desktop
file to it. Unity launcher doesn't support drag and drop, so thats not a bug or anything, but when I open a .desktop
file, it has unpredictable results. Most time it will not have "keep in launcher". Sometime it will have a pinnable item without the .desktop
's icon, and if I pin the item to the launcher, it will not call upon the program again after closing it. I've also gotten it to just work with a .desktop
file for celtx
.
Updated: 2015-Dec
For Ubuntu 15.10 or 14.04 LTS (11.10 or later, with Unity (3D))
NOTE: This can replace the function of an existing icon, or (once created) can be searched for (from Dash icon) to add to current button-bar.
First make your OWN copy of any of the .desktop files you want to modify. It is MUCH safer, and then you can always delete and start over.
Example: Mozilla Firefox, firefox.desktop
Then carefully change any wording, or add additional options.
Note: The ampersand '&' releases the command line immediately.
My own 'firefox.desktop' file:
My own 'libreoffice-startcenter.desktop' file:
A multi-tool icon 'toolbox.desktop' file:
Here are some of my earlier efforts.
For 11.04 and earlier:
Unity does support custom launchers from .desktop files. To create custom launcher from a
.desktop
file you need to create a*.desktop
file for your program.The
.desktop
file should look something like this:In your file manager open your home folder and navigate to: (You may need to press ctrl+h to show hidden files to see the
.gconf
directory.)you'll see a bunch of folders starting with "
app-
". you need to create a folder for your program. Use the same name.desktop you used in/usr/share/applications
. Go into 1 of the folders for something that is already on the dock & copy the xml file and paste that into your new folder. Open it with your text editor and change the name of the*.desktop
to your name.desktop
.Open gconf-editor (you can open gconf by running the command
gconf-editor
in the Terminal) & go to:Double click the list on the right & add your
name.desktop
.Log out & back in and you should see your launcher. (thank you kerry_s on the Ubuntu Forums for helping with this answer)
Unity also has a feature called Lenses. By default, you have two in Unity: Applications and Files. In the future, you will be able to install and create a lot more. There is some info about that on the Ubuntu wiki: https://wiki.ubuntu.com/Unity/Lenses
For 11.10 and newer:
You can still create the Launcher on the Desktop by using the old GUI dialog.
Using
ALT+F2
type:gnome-desktop-item-edit --create-new ~/Desktop
(Capital D)This will start the dialog( Create launcher):
You can put this
.desktop
file in any folder, and then drag and drop to the launcher.Note: The package
gnome-desktop-item-edit
must be installed first, so if you havegnome-panel
installed, then it is installed automatically.For 11.04 and earlier:
This is a method without editing config files and without root privileges.
First create the Launcher on the Desktop (only temporary)
Create Launcher...
Now you got the launcher on the Desktop. If you are satisfied with it, get it in the Launcher Panel:
Open your Home Folder. Press
Ctrl + H
to show hidden files if necessary.Browse to
.local/share/applications
Drag and drop your Launcher from Desktop to that folder.
Now drag and drop your launcher from
.local/share/applications
to the Launcher Bar on the left on your Screen.You can now delete your custom Launcher on the Desktop if it's still there.
That's it.
I see many complex answers here. This solution is, I think, simple.
alacarte
, if you don't have it. This is the menu editor that was installed by default before 11.10. Obviously you only have to do this once.)In Oneiric, you may also need to install the package
gnome-panel
, whichalacarte
should, but does not, depend on. See:https://bugs.launchpad.net/ubuntu/+source/alacarte/+bug/826049
For 11.10 and newer:
In Ubuntu 11.10 the easiest way create custom launcher from a .desktop file is either by copying an existing .desktop file or by creating your custom one.
To create a simple custom one you will need to add these entries to a .desktop file of your choice in
~/.local/share/applications/
nano ~/.local/share/applications/your_application_name.desktop
For extra options for your .desktop file you can visit this site. All the options available are very well described there.
You can also copy a existing application's .desktop file from
/usr/share/applications/
to your~/.local/share/applications/
and edit it to fit your needs.ie: this will copy
gedit
.desktop file to the folder where the .desktop files should be saved for a userAfter that open that location using
nautilus ~/.local/share/applications/
and drag n drop the file you have just created to the Unity launcher.Has an option instead of drag n dropping the file you can open
dconf-editor
(install it withsudo apt-get install dconf-tools
or look for it in theUSC
) and navigate to desktop.unity.launcher and edit the keyfavorites
by double clicking on the entries to the right of the key.To add your custom launcher add it at the position you want with this format
'/home/bruno/.local/share/applications/gedit.desktop'
. Don't forget to respect the,
and the spaces in that line and make sure that the line starts and ends with[
and]
respectively.With this method you will need to log off and back in for the change in
favorites
to take effect.For me in 12.04 I do the following:
in the Desktop create an "Untitled Document". Just right click in the Desktop and select Create New Document.
Edit the file with Gedit and add the following lines:
[Desktop Entry]
Type=Application
Save the file and THEN rename it to whatever you want but at the end of the name add .desktop. For example if I wanted to make a shortcut for a wine program like photoshop I would put as a name
photoshop.desktop
Now you should be able to right click the file and the Launcher Properties should appear like this example:
As you can see in the image now you can put whatever you want in the command line, another name, an icon for it, etc..
Don't forget to set Permissions as executable! Otherwise it will not work.
It is like the short version of other answers here.
To add apps to launcher in unity:
dash
(ubuntu logo , top left)Pin to launcher
.right click
the launcher icon andQuit
NOTE : Icons at this point can not be rearranged once loaded, you
must place them in the order you want them to appear when installing the icons in the launcher!
12.04
For those who like having a GUI: In 12.04 you also have the option of using Arronax which is a Nautilus plugin to create your launcher (.desktop files to be more accurate), heres an explanation of how it works.
If you already have the application launcher you can simply right click and click on the "Create starter for this file" option as shown below.
If you have desktop icons enabled you can create your own launcher with specific commands by simply right clicking on your desktop, this will give you the following option to create a blank starter:
Once you have clicked on "Create Starter" you will have the following dialogue box open where you can easily customize your starter with whatever command you'd like:
Once you've saved your launcher to your desktop you will see a file as shown here:
You then simply pick it up and drag it onto your dock in whatever place you like:
A couple of nice features:
Being able to assign Keywords to the command so it becomes searchable through the unity dash.
Relatively quick to create launchers for Windows programs in Wine as explained by this youtube video (haven't tested this out myself though)
Installation
Disclaimer prior to installing: Arronax is still in an Alpha stage of development due to there not being that many programmers working on it, I haven't had a single issue with it but I prefer giving you a heads up in case this affects your choice on installing another PPA you don't know.
To install using the terminal window (Ctrl+Alt+T to open it) type in the following commands:
After doing this you will have to restart Nautilus either by logging in and out, or by typing the following in the terminal window:
11.10
I intended for this to be an edit to Bart van Heukeloms answer as it also works for 11.10, but as a moderator kindly pointed out when I suggested the edit, it is a different answer, despite being one that works too. I tried this a few times on 11.10 before I upgraded and didn't have any issues. However I cannot vouch that it still works perfectly although I expect it should still work.
Installation in 11.10 is exactly the same as in 12.04.
This is a method without editing config files.
First create the Launcher on the Desktop (only temporary)
Create Launcher...
Now you got the launcher on the Desktop. If you are satisfied with it, get it in the Launcher Panel:
gksu nautilus
./home/your-username/Desktop
Copy
./usr/share/applications
Paste
./usr/share/applications
to the Launcher Bar on the left on your Screen.That's it.