Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My goal is to create a working launcher for PHPStorm which will work in both the desktop and the Unity launcher, using the proper logo, in 12.04. I followed the instructions here - How can I create launchers on my desktop? - to create a launcher on the desktop using the Gnome dialog box. That worked a treat as far as the desktop was concerned, but dragging the icon to the Unity launcher gave it a weird icon:

enter image description here

The PHPStorm.desktop file looks like this:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_GB]=gnome-panel-launcher
Name[en_GB]=PHPStorm
Exec=/home/shane/Software/PhpStorm-4.0.1/bin/phpstorm.sh
Comment[en_GB]=PHStorm
Name=PHPStorm
Comment=PHStorm
Icon=/home/shane/Software/PhpStorm-4.0.1/bin/webide.png

Next I tried to follow the accepted answer from here: How can I change the icon of an application in the Unity launcher?, but I found that there was no icons folder in ~/.local/share/. I went ahead and created it, and the rest of the folders mentioned in the answer, ~/.local/share/icons/hicolor/16x16/ etc. I then created a phpstorm.png in each folder, at the required sizes.

Next, I edited my PHPStorm.desktop file to the following and copied it to ~/.local/share/applications/

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_GB]=phpstorm
Name[en_GB]=PHPStorm
Exec=/home/shane/Software/PhpStorm-4.0.1/bin/phpstorm.sh
Comment[en_GB]=PHPStorm
Name=PHPStorm
Comment=PHPStorm
Icon=phpstorm
#Icon=/home/shane/Software/PhpStorm-4.0.1/bin/webide.png

After logging back in, my unity launcher icon had disappeared completely, and the icon on my desktop had turned white.

What have I done wrong here? Why aren't the icons being picked up from the icons folder, and is the initial lack of icons folder something I should be concerned about?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted
+100

Regarding the icons folder

The only program that has icons in ~/.local/share/icons is Wine, so no, a default install shouldn't create the folder.

Most installed programs place their icons in /usr/share/icons, where all users can access them.

Regarding the .desktop file

I went ahead and created it, and the rest of the folders mentioned in the answer, ~/.local/share/icons/hicolor/16x16/ etc.

The icon has to be placed in a folder called ~/.local/share/icons/hicolor/16x16/apps/.

share|improve this answer
    
22 hours... I can't even vote up with 8 rep! –  shanethehat Apr 30 '12 at 22:16
add comment

I personally prefer adding icons to launcher by first adding applications to unity dash:

  1. Install Main Menu via Ubuntu Software Center.
  2. Open dash and type "Main Menu".
  3. Open menu editor and add your application to proper category (set name, icon, command etc).
  4. Save and exit.
  5. Open dash again type application name and run it.
  6. Right-click on icon of your application in launcher and check that you want hold it in launcher.

Now you have application in launcher and also in dash :)

share|improve this answer
add comment

I just created this wiki page :) https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles

share|improve this answer
    
Sadly I can't even vote up this effort, but thank you! –  shanethehat Apr 30 '12 at 22:30
    
Hey, you are welcome :) I don't need your upvote, I like helping out. –  hakermania Apr 30 '12 at 22:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.