34

I have a problem with the manual installation of Eclipse Juno. After unpacking the tarball to /opt, adding a symlink from /usr/local/bin and adding the following to a new file /usr/share/applications/eclipse.desktop:

[Desktop Entry]
Version=1.0
Name=Eclipse
GenericName=Integrated Development Application
Comment=Eclipse Juno
Exec=/usr/local/bin/eclipse
TryExec=/usr/local/bin/eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Development;IDE;

I still get this weird behavior from the dash:

Huge icon in Unity dash

Eclipse runs just fine and the icon is clickable but as you can see the size is a bit off. How can i fix this? Shouldn't Unity automatically scale the icon?

Eliah Kagan
  • 119,640
Marcus
  • 341

6 Answers6

26
  • Create a link to ecplise icon.xpm in your share folder:

ln -s /opt/eclipse/icon.xpm ~/.local/share/icons/eclipse4.xpm

for your user only or

sudo ln -s /opt/eclipse/icon.xpm /usr/share/icons/eclipse4.xpm

for all users

  • In your eclipse.desktop file (in ~/.local/share/applications or /usr/share/applications), replace Icon=/opt/eclipse/icon.xpm by Icon=eclipse4. You don't need to add the .xpm suffix.

If necessary, also update Icon[en_US] line with the same value.

The file eclipse.desktop may have a different name depending on the tool you used to create it.

Edit: Improve answer thanks to Pius, QD. and iAm comments

Antwane
  • 411
11

@Tawane I add symlink into ~/.local/share/icons/ which maybe makes it more easy:

ln -s /opt/eclipse/icon.xpm ~/.local/share/icons/eclipse.xpm
Yu-Hsuan
  • 211
10

this may help you...

enter image description here

you can save image and change icon to this.

I scaled image icon.xpm size to 48 x 48 pixel which is in eclipse application

It looks well:

enter image description here


48x48 may look a little blurry on higher (or even medium) resolution. You may use 512x512 (even though it's a little bit an overkill) to ensure your system resizes it to whatever is used. PNGs are resized properly, so you can always supply it with a bigger image than actually displayed.

512x512 icon version can be found here: Eclipse icon

The image is taken from Eclipse help page: Eclipse help page

Jorge Castro
  • 73,717
TCHsu
  • 101
3

It seems Unity cannot resize xpm files correctly.

As a workaround, you can convert your icon to png.

sudo apt-get install imagemagick
convert /opt/eclipse/icon.xpm /opt/eclipse/icon.png

Don't forget to update your .desktop file.

guntbert
  • 13,475
0

I had the same problem but solved this buy copying icon.xpm to /usr/share/pixmaps and referencing the icon in that folder.

Eric Carvalho
  • 55,453
-1

The icon in the eclipse directory (eclipse.xpm) has a size of 256x256. Replace it with a smaller one (48x48 works for me).

Axel
  • 274