Program icon for Linux application lazarus / 32-Linux ---------------------------------------------------------------------- Bruno45 · 2006-10-16 09:19 How can I define a program icon for a Linux application. For Windows I have made a rc-file that includes the MAINICON and compiled it to a res-file. Is there a similar approach for Linux? Bruno ---------------------------------------------------------------------- felipemdc · 2006-10-16 11:41 Quote from: "Bruno45"How can I define a program icon for a Linux application. For Windows I have made a rc-file that includes the MAINICON and compiled it to a res-file. Is there a similar approach for Linux? No, the concept of having a icon inside the executable to discribe it does not exist under Linux. Try opening with konqueror or another graphical file manager your /usr/bin directory. All executables have the same icon. What people do on Linux is distribute a icon image separated from the executable, and use that icon when creating shortcuts to the program, like a shortcut on the K Menu, for example. Creating shortcuts is a big problem, because this is a Distribution- dependent task. On each distro this is done in a different way. ---------------------------------------------------------------------- MadMike · 2021-09-15 12:54 Hi, A bit late I know but is there not an 'icon' property for the main form? ('Form1.icon') Mike ---------------------------------------------------------------------- MarkMLl · 2021-09-15 15:47 Quote from: felipemdc on October 16, 2006, 01:41:27 pmQuote from: Bruno45How can I define a program icon for a Linux application. For Windows I have made a rc-file that includes the MAINICON and compiled it to a res-file. Is there a similar approach for Linux? No, the concept of having a icon inside the executable to discribe it does not exist under Linux. Try opening with konqueror or another graphical file manager your /usr/bin directory. All executables have the same icon. Rubbish. Just because the average startup menu or file browser doesn't know how to find an icon doesn't mean that there is no icon, and programs running on the average desktop environment display icons for running and minimised programs entirely adequately. HOWEVER, even though (as has already been pointed out) the Lazarus project options allow a graphic to be associated with the main form, this can- in my experience- get to be a bit erratic once multiple forms (windows) are involved. QuoteWhat people do on Linux is distribute a icon image separated from the executable, and use that icon when creating shortcuts to the program, like a shortcut on the K Menu, for example. Creating shortcuts is a big problem, because this is a Distribution- dependent task. On each distro this is done in a different way. You badly need to familiarise yourself with the xdg utilities which are supported as standard by all major desktop environments. The overall standard includes what goes into the .desktop files, but also defines the command lines (if not the operation) of various utilities: Code: [Select]xdg-dbus-proxy (1)   - D-Bus proxy xdg-desktop-icon (1) - command line tool for (un)installing icons to the desktop xdg-desktop-menu (1) - command line tool for (un)installing desktop menu items xdg-email (1)        - command line tool for sending mail using the user's preferred e-mail composer xdg-icon-resource (1) - command line tool for (un)installing icon resources xdg-mime (1)         - command line tool for querying information about file type handling and adding descriptions for new file types xdg-open (1)         - opens a file or URL in the user's preferred application xdg-screensaver (1)  - command line tool for controlling the screensaver xdg-settings (1)     - get various settings from the desktop environment xdg-user-dir (1)     - Find an XDG user dir xdg-user-dirs-update (1) - Update XDG user dir configuration MarkMLl ---------------------------------------------------------------------- renabor · 2021-09-15 16:35 In the Options Menu, under Resources, you can simply add the .ico file, and that icon will be the default both for Linux and Windows executable! ---------------------------------------------------------------------- Renat.Su · 2021-09-15 18:26 Under linux, I put the application icon in png format in a folder /usr/share/pixmaps/$app_name.png and add field-value icon=$app_name to /usr/share/applications/$app_name.desktop file. This is all set in the .deb package. Read more there ---------------------------------------------------------------------- tetrastes · 2021-09-15 19:25 Quote from: MarkMLl on September 15, 2021, 05:47:10 pmQuote from: felipemdc on October 16, 2006, 01:41:27 pmQuote from: Bruno45How can I define a program icon for a Linux application. For Windows I have made a rc-file that includes the MAINICON and compiled it to a res-file. Is there a similar approach for Linux? No, the concept of having a icon inside the executable to discribe it does not exist under Linux. Try opening with konqueror or another graphical file manager your /usr/bin directory. All executables have the same icon. Rubbish. Just because the average startup menu or file browser doesn't know how to find an icon doesn't mean that there is no icon, and programs running on the average desktop environment display icons for running and minimised programs entirely adequately. HOWEVER, even though (as has already been pointed out) the Lazarus project options allow a graphic to be associated with the main form, this can- in my experience- get to be a bit erratic once multiple forms (windows) are involved. QuoteWhat people do on Linux is distribute a icon image separated from the executable, and use that icon when creating shortcuts to the program, like a shortcut on the K Menu, for example. Creating shortcuts is a big problem, because this is a Distribution- dependent task. On each distro this is done in a different way. You badly need to familiarise yourself with the xdg utilities which are supported as standard by all major desktop environments. The overall standard includes what goes into the .desktop files, but also defines the command lines (if not the operation) of various utilities: Code: [Select]xdg-dbus-proxy (1)   - D-Bus proxy xdg-desktop-icon (1) - command line tool for (un)installing icons to the desktop xdg-desktop-menu (1) - command line tool for (un)installing desktop menu items xdg-email (1)        - command line tool for sending mail using the user's preferred e-mail composer xdg-icon-resource (1) - command line tool for (un)installing icon resources xdg-mime (1)         - command line tool for querying information about file type handling and adding descriptions for new file types xdg-open (1)         - opens a file or URL in the user's preferred application xdg-screensaver (1)  - command line tool for controlling the screensaver xdg-settings (1)     - get various settings from the desktop environment xdg-user-dir (1)     - Find an XDG user dir xdg-user-dirs-update (1) - Update XDG user dir configuration MarkMLl Note that the post of felipemdc is dated 2006, the year when xdg-utils were released.  It's not wondering that he did not familiarise himself with them. ---------------------------------------------------------------------- MarkMLl · 2021-09-15 19:46 Quote from: tetrastes on September 15, 2021, 09:25:22 pmNote that the post of felipemdc is dated 2006, the year when xdg-utils were released.  It's not wondering that he did not familiarise himself with them.  Good heavens, I didn't realise I was commenting to such an ancient thread! My apologies for my bad humo(u)r, and my apologies in particular for directing such at Felipe. MarkMLl ---------------------------------------------------------------------- VTwin · 2021-09-15 23:27 Quote from: renabor on September 15, 2021, 06:35:28 pmIn the Options Menu, under Resources, you can simply add the .ico file, and that icon will be the default both for Linux and Windows executable! Yes. It does not show up on the executable, but does in the dock when running it, at least in Ubuntu.