Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Application icon for Linux

  1. #1

    Application icon for Linux

    I recently compiled my game to Linux with fpc, and while it works perfectly, now I want to add an icon to it.
    Is there anyway to embed an icon inside the executable?

  2. #2
    I think Lazarus can do that, there is some setting in the program I believe...not sure about pure fpc though
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  3. #3
    Is there anyway to embed an icon inside the executable?
    No, icons can't be inside the executable and shows somewhere in file browser/etc. You can show your icon only in menus/etc. For this you need to place your icon into /usr/share/pixmaps(with name equal to executable). Or if you can provide different sizes for icon then place them here: /usr/share/icons/hicolor/size/apps.

  4. #4
    From what I've read in the wiki, it seems that even lazarus only supports icons on Windows and Mac, and in Linux icons need to be in a specific folder.

  5. #5
    Quote Originally Posted by Andru View Post
    No, icons can't be inside the executable and shows somewhere in file browser/etc. You can show your icon only in menus/etc. For this you need to place your icon into /usr/share/pixmaps(with name equal to executable). Or if you can provide different sizes for icon then place them here: /usr/share/icons/hicolor/size/apps.
    That means the only way to supply a icon is to have some kind of installer, right?

  6. #6
    to have some kind of installer, right?
    Yes, and this "some kind of installer" is a "package"(most popular - deb and rpm). But different GNU/Linux distros use different type of packages.

  7. #7
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Although if you made a deb/rpm solution you'd cover roughly 80% of the linux market, I know a lot of people are now distributing tar.gz packages with a install.sh script which is nice since it build from source/.a and .o files upon installation and does all the dirty work - be it debian, redhat, the pacman system arch uses etc... All you'd need in the dep list are the fpc meta package and the appropriate dev libs. Although, you could include the *-dev .so files in your gz archive...

    The niceness of just doing a
    Code:
    tar xvf somepackage.tar.gz
    cd somepackage
    sudo ./install.sh
    In 50 less keystrokes thanks to tab in tty is so nice for the end user.... even the make $ make install route is nice
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  8. #8
    I see, but does that means that the package needs to include the source?
    This is a comercial project, also available for other platforms, so I don't want to release the source for now.
    Right now I've simply put the compiled executable along with the resource files in a tar.gz file, would there be any problem with this approach?

  9. #9
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Unless I am mistaken you could just include the .a and .o file and then just do the linking on the target - I recall some closed source codecs and etc worked that way...

    In your instance (executable in tar.gz) I guess you would just have to link it dynamically and hope for the best - just be warned that if any bugs arise with this setup, you cant ask for compiler messages and you may end up having a super fun time with clients... Or at least thats my experience with the last Ludum dare fiasco.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  10. #10
    I see, but does that means that the package needs to include the source?
    If you don't use libraries with GPL-like license(or LGPL with static linking) - then no need to include source code. For Linux rules of opening source code is the same as for other platforms

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •