I can confirm the above mostly works on Ubuntu 18.04.
Note that putting the .desktop
file in ~/.local/share/applications
has no visual effect.
It does not put an entry on your desktop!
However, it does add the application to your list of applications and then allows it to be added to favorites (sometimes).
So, why does the file have .desktop
as an extension when it has nothing to do with the desktop?
If you think this is muddled thinking by developers, you will not be alone.
This file:
[Desktop Entry]
Version=1.0
Type=Application
Name=PhpStorm
Icon=/usr/local/PhpStorm-183.5153.36/bin/phpstorm.svg
Exec="/usr/local/PhpStorm-183.5153.36/bin/phpstorm.sh" %f
Comment=Lightning-smart PHP IDE
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-phpstorm
Placed in ~/Desktop
with the name jetbrains-phpstorm.desktop
does not show an icon on the desktop.
However, if it is named PhpStorm.desktop
it does put an icon on the desktop.
The exact same file placed in ~/.local/share/applications
with the name jetbrains-phpstorm.desktop
does 2 things:
- Shows PhpStorm in Show applications
- Allows you to Add to favorites
And in ~/.local/share/applications
, it doesn't matter what you call the file: jetbrains-phpstorm.desktop
works the same as PhpStorm.desktop
When I said "sometimes", here's a file that works in ~/Desktop
and when placed in ~/.local/share/applications
allows the application to appear in Show applications but does not allow you to Add to favorites:
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gnome-panel-launcher
Name[en_US]=Create Launcher
Exec=bash -c 'gnome-desktop-item-edit --create-new ~/Desktop'
Name=Create Shortcut
Icon=gnome-panel-launcher
Exec=google-chrome --profile-directory=Default
? – Teivel Oct 22 '17 at 1:14