I just installed Oneiric Ocelot, and I can't figure out how to add an application, which is stored in my home directory, to the dash. I can create a launcher, but I want it in the dash also.
4 Answers
There are 2 ways to go about this
No new software method
For 11.10 and newer:
To create a simple custom .desktop
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
[Desktop Entry]
Name=the name you want shown
Comment=
Exec=command to run
Icon=icon name
Terminal=false
Type=Application
StartupNotify=true
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 user
cd ~/.local/share/applications
sudo cp /usr/share/applications/gedit.desktop .
After 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 with sudo apt-get install dconf-tools
or look for it in the USC) and navigate to desktop.unity.launcher
and edit the key favorites 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//.local/share/applications/.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. This will make it appear in the dash
Using New software
Using gnome-desktop-item-edit
For this you need gnome-tweak-tool
or gnome-shell
installed
Use ALT+F2 and type
gnome-desktop-item-edit --create-new ~/Desktop
This will open the dialog Create Launcher
You can put this .desktop
file in /home/<username>/.local/share/applications/
to make it appear in the dash
Using alacarte
For this method, you need alacarte
installed.Do it by
sudo apt-get install alacarte
And use ALT+F2 and type in alacarte
You will get this dialog:
Select the category you want and click "New Item"
You will get this dialog
Click OK . It will appear in the dash
NOTE for Ubuntu 13.04 and above: After performing the above steps, nothing will happen and it will seem like nothing is added to the dash
To resolve this, go to
~/.local/share/applications
and you should be able to see a file namedalacarte-made.desktop
.Right Click on this file and check the box which allows it
excecute
permissions.After closing the properties dialog, your entry will now appear in the dash.
Sources:
-
1alacart does not work in ubuntu 13.04. nothing appears in the dash after adding an item. Commented Apr 4, 2013 at 3:21
-
1@waspinator Indeed. Luckily, the 'No new software method For 11.10 and newer' still works like a charm! (Done this using 13.10)– parvusCommented Dec 18, 2013 at 20:05
-
1I appreciate your "No software" method. (works on 15.04) Commented Jul 11, 2015 at 14:37
-
1To appear in dash application results, just add
NoDisplay=false
at the end of the.desktop
file and tada! (source) Commented Feb 20, 2016 at 16:16 -
To generate the
.desktop
file from a running application right-click the icon in the Launcher and select "Add to Dash". Then you can modify the generated file in~/.local/share/applications
.– absynceCommented Jan 6, 2017 at 21:31
One way I use is to add an entry in the menu's with alacarte package.
- Install alacarte if it isn't already:
sudo apt-get install alacarte
- Open alacarte by typing it into the run prompt (ALT+F2)
- Click New item and fill in name and command.
- Click OK and close alacarte.
- Application should appear in the dash search.
Works on Unity and GNOME Shell (Ubuntu 17.10 and above).
-
6In Ubuntu 13 you can go into alacarte and add the new item. After you create it, it will look like nothing happened. Then go to ~/.local/share/applications and you should see a file alacarte-made.desktop. Right click on the file and go to properties then add the bottom of the properties window check the box to allow it to execute. After you do that the item should show up in your dash.– JamesCommented Dec 2, 2013 at 0:21
-
-
1
-
-
1
A .desktop file in .local/share/applications
folder will also do the trick.
Just add the required .desktop
files, make them executable using chmod +x <filename>
and restart unity by typing unity --replace
A .desktop file for sublime text
[Desktop Entry]
Encoding=UTF-8
Name=Sublime Text 2
Comment=Launch Sublime Text 2
Icon=/home/user/Sublime Text 2/Icon/48x48/sublime_text.png
Exec="/home/user/Sublime Text 2/sublime_text"
Terminal=false
Type=Application
Categories=Developer;Accessories;Accessibility;
StartupNotify=true
Note
If Exec string contains space characters, double quotes should be used.
-
4
chmod +x <filename>
is not needed for dash. It is only required for.desktop
files you want to run by double-clicking them. Useful for the ones in~/Desktop
, but not useful in~/.local/share/applications
Commented Apr 16, 2013 at 5:10 -
Is this answer true? I've got lots of .desktop files in .local/share/applications, and only some of them appear in the dash, presumably those specified in dconf-editor (launcher).– EoghanMCommented May 17, 2019 at 9:31
-
Yes, it should still work. Check if any of them have a NoDisplay=true. Try adding NoDisplay=false if it still doesn't show up. If it doesn't work even then, I have no idea.– MaheshCommented Jun 6, 2019 at 12:06
-
The
--replace
option to unity is a no-op now (unity 7.5.0 in Ubuntu 19.04). Is there another way of re-reading.local/share/applications
? I've lots of stuff in there from a prior installation that is never getting read (have tried login/logout)– EoghanMCommented Aug 12, 2019 at 21:33 -
Okay I've gotten to the bottom of it. The
unity --replace
step is not needed as of 7.5.0; the dash gets updated in real-time. My problem was that the target executable of theExec=
line was not installed on my computer (after a reinstall). Somehow Unity detects this and hides those.desktop
files that would not execute.– EoghanMCommented Aug 12, 2019 at 22:02
Usually when you install you the icon will be automatically added. But if it is not, then do the following:
- Open the Unity dashboard.
- Type main menu in the search bar. (In Germany you need to type "Hauptmenu")
- Open it and select the best category your app fits (if you want create one).
- Select insert item.
- Type name, command (a terminal command or path to the executable) and comment.
- Add the item.
- Launch the item from the Unity dash board.