Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding an icon in a Linux executable

I have written an application in Java and succesfully compiled it using gcj.

In (X)ubuntu's File Manager, my application appears with the default Linux executable icon, which I would like to replace with my own.

I have seen that other applications display a custom icon as the executable, such as Firefox, but have no idea how to approach the problem. Is there some sort of resource editor for Linux binaries?

Desktop Entry

I've tried creating a Desktop Entry file that executes the application as follows:

[Desktop Entry]
Version=1.0
Type=Application
Name=MyJavaApp
Comment=
Exec=./MyJavaApp
Path=./../../libs/
Terminal=true
Icon=./icon.png
X-KDE-Library=./../../libs/libswt.so

Double-clicking it makes a terminal pop up and disappear again, and that's it. I'm fairly sure the application doesn't launch because it can't find the required SWT library. I was hoping to see the output in the terminal, but I can't launch it from there.

Furthermore, Ubuntu doesn't seem to acknowledge Icon. I have tried various resolution PNGs; no dice.

like image 205
Paul Lammertsma Avatar asked Jan 24 '10 09:01

Paul Lammertsma


People also ask

Where are app icons Linux?

After installing the icon theme, from the Menu, go to Settings, then Themes. To find the icons in Linux Mint, look inside Themes Options. To only change the icons and not the theme, click on Icons. Here you will see all the available icons.


2 Answers

Executables on Linux do not have icons embedded (try to point your file manager to /usr/bin). What you have seen is probably a Desktop Entry. That's a text file describing the icon, program name and the executable.

like image 150
Lukáš Lalinský Avatar answered Nov 06 '22 00:11

Lukáš Lalinský


On Ubuntu:

mouse right click the icon you don't like -> Properties -> in the opened window click the icon -> choose an icon you want

like image 20
Andrew Avatar answered Nov 06 '22 00:11

Andrew