-   Linux - Newbie (
-   -   booting to a fullscreen java program with a shell script (

sebastian.raghe 05-16-2005 10:04 AM

booting to a fullscreen java program with a shell script
ok, so here is what i'm doing:

i'm building an arcade mechine out of a PC. but the mechine will run games designed by me and my friends. we've designed a gui to handle the games and so forth, but our problem is booting directly to the gui.

I'm using a debian install and i've tried to manipulate the scripts in rc2.d. i removed the gdm startup and threw in my script that i wrote to boot directly to the guio, but it doesn't do it.


export DISPLAY=:2
X :2 &
cd /home/arcade
java version1

thats my scripts right now (version1 is the java program) if anyone can give me advice i'd be very apreciative. i'm new to this whoile linux thing so i'm finding it very difficult to find this answere on my own.

thanks again


theYinYeti 05-17-2005 04:16 AM

You should bread the problem apart :) You actually have 3 problems:
1- boot in graphical mode,
2- auto-start Java,
3- make it full-screen.

For 1, I can help you: see my web site > Computing > Linux > Configuration > auto-login.

Point 2 is quite easy: it is just a matter of replacing the start of the window manager with the start of a script that first starts the window manager and then java. Eg:

/path/to/window/manager &
/path/to/java my.Class &
wait $wmPid

As for point 3, I suggest you use the Matchbox window manager.

I hope this helps.


sebastian.raghe 05-18-2005 09:47 AM

thanks you for your reply.

but i'm wondering if it's necisary to start a window manager. for example when i run my script in a consol it just runs my program full screen. no windows manager or anything. which is what i want. the mechine we are using is far less then new and we need to save as much system resource as possible.

also. should i use the script from your site to begin my program start script? or shall i make 3 different scripts? again, i'm rather new to this all and may need a handhold. this project will make me learn to use linux but i know i can't do it all alone.


theYinYeti 05-19-2005 02:42 AM

You'll have to be more specific. In Linux, there are 5 ways to do graphics, as far as I know:
- ASCII art on the console,
- framebuffer graphics on the console,
- SVGAlib on the console (deprecated AFAIK),
- X11,
- more or less experimental alternatives to X11.

For serious work with good graphics, I only see two of those as valid: framebuffer and X11. I don't know framebuffer, nor do I know if Java can interact with it (there's always JNI, though). So I (wrongly?) assumed that you would use X11.

X11 can be very small if you really want, so system resources are not really a problem. The smallest X11 probably is kdrive (not to be confused with KDE application "kdrive"...), formerly known as tinyX. But I'm not sure you'll get enough performance out of it: it all depends on how much you depend on hardware acceleration.

If you need hardware acceleration, or other fancy things, you're probably better off with X.Org or XFree86. It is not that much bigger, actually. I run XFree86 on a P150MMX with 32MB RAM. You probably have better than that :) Just don't forget to optimize its configuration for best performance:
- use a font server... or not;
- don't load modules that you don't need;

Now the window manager. Indeed you don't need a window manager. But some applications can't be told to open at the wanted location with the wanted size (eg: 800x600+0+0); in such case, Matchbox is usefull, as it is lightweight and opens all windows in fullscreen mode (provided you don't use side-panels).

If you adapt /etc/inittab as told on my site, last line could look like that:

X:5:respawn:/bin/su - UTIL -c '/usr/local/bin/startx /usr/local/bin/'
with "" containing the script that I wrote above.
All this actually depends on what exactly it is you want to do.


All times are GMT -5. The time now is 04:37 AM.