Recent

Author Topic: Adding an icon to the executable (Linux OS)  (Read 1704 times)

KesterKick

  • New Member
  • *
  • Posts: 30
Adding an icon to the executable (Linux OS)
« on: November 27, 2023, 08:05:12 pm »
Hi,
I'm running Lazarus 3.2.2 in MX-Linux 23.1.

I know how to add my choice of icon to a form but do not know how to add my choice of icon to an individual executable.  I can easily create a standard icon for all executables but would find being able to provide a specific icon to a particular executable to be a useful addition to my knowledge.

I would be grateful for any advice on the matter.  Thanks.

dseligo

  • Hero Member
  • *****
  • Posts: 1419
Re: Adding an icon to the executable (Linux OS)
« Reply #1 on: November 27, 2023, 08:23:24 pm »
Did you try to set application icon in menu Project, Project Options, Application, button Load Icon? It works in Windows.

hukka

  • New Member
  • *
  • Posts: 33
    • Github
Re: Adding an icon to the executable (Linux OS)
« Reply #2 on: November 27, 2023, 09:06:26 pm »
Linux doesn't have a standardized way of using the icon embedded in the binary as far as I can tell. You have to set the icon in your desktop environment instead.

KesterKick

  • New Member
  • *
  • Posts: 30
Re: Adding an icon to the executable (Linux OS)
« Reply #3 on: November 28, 2023, 11:57:48 am »
Thanks hukka and dseligo,

It seems that I cannot change the icon for an individual executable in a Linux system.  @hukka: The desktop environment groups all executables as a similar file type - although I can change the icon for executables as a whole, there seems to be no way to change the icon for an individual executable file with or without Root privileges.  I will ask about this on the MX-Linux forum as clearly this is a Linux issue.

@dseligo: Windows is a different kettle of fish and certainly I have been able to provide individual icons for executables created in Pascal based programming applications going back to when I used Delphi 3 in Windows 98 and XP (acquired in a magazine cover cd rather a long time ago and a major move for me at the time from Basic and Visual Basic) - those were the days.

Cheers - if I get anything worth mentioning from the MX forum I'll report back.

dseligo

  • Hero Member
  • *****
  • Posts: 1419
Re: Adding an icon to the executable (Linux OS)
« Reply #4 on: November 28, 2023, 12:52:16 pm »
@dseligo: Windows is a different kettle of fish

I know, I thought that you maybe missed this. For Linux I don't make desktop applications (for now :)), only CLI.

Quote
and certainly I have been able to provide individual icons for executables created in Pascal based programming applications going back to when I used Delphi 3 in Windows 98 and XP (acquired in a magazine cover cd rather a long time ago and a major move for me at the time from Basic and Visual Basic) - those were the days.

8-)

Hartmut

  • Hero Member
  • *****
  • Posts: 855
Re: Adding an icon to the executable (Linux OS)
« Reply #5 on: November 28, 2023, 01:27:34 pm »
Did you try to set application icon in menu Project, Project Options, Application, button Load Icon? It works in Windows.

I use this way on Linux Ubuntu 18.04 and 22.04 and it always worked, if I used a correct icon file. Maybe you want to try it with this one: https://wiki.freepascal.org/images/1/15/Lazarus-icons-lpi-proposal-bpsoftware.png

If it should not work: create a new project where you only add this icon. Maybe you have disadjusted something in your real project.

BTW: I do not see my Icons on Linux in the filemanager (as on Windows), but I see them, when I start the program in the title bar of the program and in the taskbar.

HTH

bobby100

  • Sr. Member
  • ****
  • Posts: 260
    • Malzilla
Re: Adding an icon to the executable (Linux OS)
« Reply #6 on: November 28, 2023, 07:05:22 pm »
I know that, when I create DEB files, the icon that I select there, is the icon that after the installation of that DEB file will appear in file managers etc.

Try to copy the icon in PNG format to /usr/share/pixmaps
The PNG file must have the same name as your app (case-sensitive) and the extension PNG.
My icon is 128x128 pixels. I don't know if other formats are also working or not.
« Last Edit: November 28, 2023, 07:11:04 pm by bobby100 »

 

TinyPortal © 2005-2018