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
  • 116,445
  • 54
  • 318
  • 493
Marcus
  • 341
  • 1
  • 3
  • 3
  • 3
    Useful Info: This problem exists in Ubuntu 12.10 only. It is working fine in Ubuntu 12.04 or lesser. – saji89 Jan 19 '13 at 16:12

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
  • 4
  • 11
  • 1
    That's the answer. I would only add that you don't have to copy the file but can rather make a soft link like `QD.` mentioned below. + If you used Main Menu application to create the .desktop file, you can find it in `~/.local/share/applications`. On my machine it was called `alacarte-made.desktop` so be aware that it's name has nothing to do with the application launched. – Pijusn Jan 01 '13 at 10:04
  • Actually, the best way is to put eclipse4.xpm into /usr/share/icons folder, because using ~/.local/* location works for a single user only. – kmedv May 13 '13 at 06:30
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
  • 2
  • 2
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
  • 70,934
  • 124
  • 466
  • 653
TCHsu
  • 101
  • 4
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
  • 12,914
  • 37
  • 45
  • 86
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
  • 53,609
  • 102
  • 137
  • 162
  • And what version of Ubuntu you was using? When you say *referencing the icon in that folder*, What folder and how did you reference the icon? Please, edit your answer adding the requested information. – Lucio Feb 16 '13 at 02:37
-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
  • 2
  • 10
  • 2
    I believe this started with Ubuntu 12.10, before 12.10 xpm icons were resized properly. – Peter van der Does Nov 16 '12 at 13:15
  • 1
    Oh. I first saw this after upgrading to 12.10 and eclipse Juno and thought perhaps it was because of the new eclipse version. I will check of the problem still persists (after all the updates that came in the meantime). If it does, I will file a bug against Ubuntu 12.10. – Axel Nov 16 '12 at 13:24