Add Application Icon

To add applications to the Dash (then you press the windows key), Go to ~/.local/share/applications and create your .desktop files there.

For example:

  • Open Nautilus (also called Files (the file manager))
  • Browse to ~/.local/share/applications (ctrl + h to show hidden folders/files)
  • Right click and choose create empty document
  • Name the file testing.desktop
  • Enter in a valid desktop contents (sample below)
  • Save it and now that entry will show when you press the windows key under applications.

A much easier way…

1
sudo apt-get install alacarte

Then run alacarte and create menu entries as you like. They will show in the unity launcher.


Sample desktop file (from sublime text 2)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env xdg-open  

[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=subl
Terminal=false
Icon="/opt/Sublime Text 2/Icon/48x48/sublime_text.png"
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow
Icon[en_US]=/opt/Sublime Text 2/Icon/128x128/sublime_text.png

[NewWindow Shortcut Group]
Name=New Window
Exec=subl -n
TargetEnvironment=Unity

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!