LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 05-16-2005, 10:04 AM   #1
sebastian.raghe
LQ Newbie
 
Registered: Apr 2005
Location: Grimsby, Canada
Distribution: Debian (etc)
Posts: 4

Rep: Reputation: 0
Question 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.


Code:
export DISPLAY=:2
X :2 &
cd /home/arcade
java version1
exit
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

-sebastian
 
Old 05-17-2005, 04:16 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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:
Code:
#!/bin/bash
/path/to/window/manager &
wmPid=$!
/path/to/java my.Class &
wait $wmPid
As for point 3, I suggest you use the Matchbox window manager.

I hope this helps.

Yves.
 
Old 05-18-2005, 09:47 AM   #3
sebastian.raghe
LQ Newbie
 
Registered: Apr 2005
Location: Grimsby, Canada
Distribution: Debian (etc)
Posts: 4

Original Poster
Rep: Reputation: 0
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.

-sebastian
 
Old 05-19-2005, 02:42 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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:
Code:
X:5:respawn:/bin/su - UTIL -c '/usr/local/bin/startx /usr/local/bin/java+app.sh'
with "java+app.sh" containing the script that I wrote above.
All this actually depends on what exactly it is you want to do.

Yves.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running SHell script from java anirudh Programming 2 01-07-2005 07:37 AM
Creating a shell script to run Java program paultaylor Programming 7 11-12-2004 03:11 PM
unix korn shell script that interact with windows java program ann124 Programming 5 11-09-2004 09:14 PM
How to use Java in a Shell Script arnneisp Programming 1 07-13-2004 02:18 AM
shell script to compile java czy11421 Programming 4 04-30-2004 09:42 AM


All times are GMT -5. The time now is 11:08 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration