Easy Standalone Linux Applications
Previously in this forum, about 6 months ago, I talked about how to combine XUL, thttpd, ngs-js (or your favorite CGI command-line language like Perl, Python, or PHP), and perhaps SQLite -- all to create Linux standalone applications (instead of web apps).
Well, tonight, I have learned the poorly documented technique for building robust standalone Linux applications with just XUL and perhaps SQLite. There's no longer a need to have a web server (even a tiny, embeddable one like thttpd). I'll have a short example posted here for all you novice programmers wanting to program your first Linux app, or even smart programmers who want to learn a new technique that might make application development easier for you.
Here's how it works:
1. All the end user needs on their Linux PC is Firefox 1.5 or better, and perhaps SQLite or any /usr/bin commands you might want to depend on.
2. The user doubleclicks a single executable binary file (ELF format). (Spoiler: these are made using 'makeself' command.)
3. This file then expands into /tmp and calls a startup Bash script.
4. The startup Bash script calls firefox (or equivalent) by doing:
mozilla -chrome file:/myapp.xul
6. Myapp.XUL contains an HTML-like language inside with some special XML header information. You draw the GUI in this.
9. XPCOM is fairly difficult to use and that's one of the big complaints. However, all you really need to learn are the XPCOM components for file i/o and process execution, intially, and learn the other components later on.
11. The XPCOM can then shell out to run processes and get results, or interact with files. Although there's an XPCOM component for SQLite interaction, you could always just shell out to the SQLite command to run it too, as well as MySQL or PostgreSQL -- any database you can access from command line on Linux.
Anyway, this is all a lot to go over and I want to show you how to this in the least lines of text. I'll post that on my blog in a week or so and link that in later on.