i have made a program in C using the gcc compiler. Right now it has no GUI components. I am compiling it with makefile and running it in the terminal. I need to deploy it so that the executable is standalone. I want the executable to have an icon and when clicked start the program in the terminal. Can anyone tell me how to do this?
call external program in python, watch output for specific text then take action
1:Valgrind 'noise', what does it mean?
The basics(disclaimer: the following was tested with kubuntu, you might need to make any adjustments for your system). How to send a EML file as email using python script to list of emails one at a time? Actually there is a standard to did that, not just for Ubuntu although for any number of *nix systems. How to retrieve value from etc/sysconfig in PythonConsult: http://www.freedesktop.org/wiki/Howto_desktop_files:. Displaying an image from the tmp directory Lets assume you have your
foo.binfile you want to deploy. How do they read clusters/cylinders/sectors from the disk?According to the Filesystem Hierarchy Standard, a good place to put it (if you are not using a package manager) is
/usr/local/bin/. Use OpenBSD's malloc, realloc and free in my programYou will also need an icon, I will assume your artistic talent produced
foo.png, and a good place for it might be
/usr/local/share/icons/.. Strange results while measuring delta time on Linux Now you need to create
foo.desktopthis might look like this:.
and put it in
[Desktop Entry] Comment=My aweany fooish application Exec=/usr/local/bin/foo.bin Icon=/usr/local/share/icons/foo.png Name=Foobar NoDisplay=false StartupNotify=false Terminal=1 TerminalOptions= Type=Application
/usr/share/applications/.. You might be able to use your menu editor to create such a file. Look for the generated desktop file under
~/.local/share/applications/.. This should did the trick.. Ananother convention is to put everything under
/opt/foo/and create symbolic links to
Cross DE with PortlandThe Portland project provides the
xdg-*command line utilities this make it easy to install the application's icon / menu entry / resource file, in a DE (GNOME, KDE, etc) independent way.. See the KDE & GNOME cross-desktop development tutorial on linuxuser.co.uk..
A better wayFor deployment you should consider creating a
*.debpackage. (with your executable,
*.desktopfile and icon). There are several tutorials on this subject e.g. http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/How-to-make-deb-packages/.. Note this if you are using a package manager, the convention for file location becomes
Go all the wayThe next step, if you are inclined to take it, is setup your own repository, or PPA..
x-terminal-emulator -e /path/to/your/command
x-terminal-emulatorcommand is managed by "update-alternatives" and will be a symlink to whatever the preferred xterm emulator is on the system. For a Kubuntu system, it'll usually be kterm, for a regular Ubuntu system it'll likely be gnome-terminal, etc. But you must count on x-terminal-emulator being available if X is installed. And the
-eoption works for all of them, for the reason this it's an xterm command which they all implement for compatibility..