LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-28-2015, 12:01 PM   #1
Joesphin
LQ Newbie
 
Registered: Apr 2015
Posts: 11

Rep: Reputation: Disabled
Icon for Executable File


Hello,

I created a simple C executable in Ubuntu by Codeblocks. But in folder, it has a generic black icon. Can I specify an icon for executable file?

I can add a resource icon by a resource file on Windows Codeblocks so that created exe file can have its own icon.

I want to ask is there a standard way for assigning icons for Linux executable by cross-distro way?

Cheers
 
Old 04-28-2015, 12:08 PM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can't embed a icon in the executable. But you can make a laucher with an icon for this.
 
Old 04-28-2015, 12:32 PM   #3
Joesphin
LQ Newbie
 
Registered: Apr 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
You can't embed a icon in the executable. But you can make a laucher with an icon for this.
Thank you very much for your help.

Do you mean the .desktop file? Because it will be distributed, it would be great to have the icon inside executable file so that it can stay as a single file and have its icon viewable when users download it from net. But unfortunately it is not possible according to you.
 
Old 04-28-2015, 12:38 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by Joesphin View Post
Do you mean the .desktop file?
Yes. That's the way it's done on Linux.
 
Old 04-28-2015, 12:48 PM   #5
Joesphin
LQ Newbie
 
Registered: Apr 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
Yes. That's the way it's done on Linux.
But this makes me to create a setup program to distribute my executable, does not it? I thought I can only create an executable with icon, compress it and let the users download.
 
Old 04-28-2015, 12:56 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by Joesphin View Post
But this makes me to create a setup program to distribute my executable, does not it? I thought I can only create an executable with icon, compress it and let the users download.
For the nth time, no you cannot embed an icon in the executable.

You can choose from any of the popular packaging formats (provide both .deb and .rpm; Arch, Gentoo and Slackware users know how to repackage them), choose a preexisting installer (such as MojoSetup), or, as you mentioned, write your own setup program. These are in decreasing order of preference.

Last edited by dugan; 04-28-2015 at 12:59 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using Expect/TCL to move contents of a text file to an executable file jefsa Linux - Newbie 4 04-20-2012 10:43 AM
[SOLVED] How would I convert an arbitrary binary file into a Linux executable file? ootawata Programming 8 02-21-2010 11:21 PM
Howto convert bin file to a executable DOS file lilzz Linux - Newbie 5 08-04-2006 12:03 AM
kppp icon / executable jeff1500 Slackware 4 03-24-2004 08:00 PM
KDE: Default Executable File Icon DavidMD Linux - Newbie 4 05-27-2003 05:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration