LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-13-2003, 12:57 PM   #1
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
XFree run single program fullscreen?


I saw a thread (yes, I searched for a while for it) here a while ago which I thought was cool, but discounted it cuz I didn't have any specific use for it. Now I have to make a kiosk-type linux box which essentially runs mozilla ONLY. What I would like to know, from all you generous cognoscenti out there, is what the command is (assume I'm in a fresh install of Slackware for instance, where X does not start by default) to start X with a specific program as a parameter, causing it to run that program in full screen, no window decorations or anything. something like

/usr/X11R6/bin/X --prog=/opt/MozillaFirebird/MozillaFirebird

though I know that's not what it was. Also, if there were some way to run it as a different user, so that I could somewhat securely add it to /etc/rc.d/rc.local, so when the power goes out and they have to restart the box it comes straight back to where it was.

Thank you so much for any help in accomplishing this, LQ has given me so much information, I wish people would ask more questions I could answer!

TIA

B.
 
Old 11-13-2003, 10:55 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
This is not from the Kiosk-HOWTO, but here's what I do. Two files necessary.Prereq is a functioning /usr/X11R6/bin/startx which loads /etc/X11/xinit/xinitrc which in turn loads ~/.Xclients or ~/.Xclients-default.

1. Touch ~/.Xclients or ~/.Xclients-default. Add this:
Code:
test -f $HOME/.wm_style && WMSTYLE=$(cat $HOME/.wm_style | tr [A-Z] [a-z])
xset s noblank; xset s 0 0
xauth generate $DISPLAY . trusted &
xhost - &
xsetOff
        case "$WMSTYLE" in 
        bb) exec /usr/X11R6/bin/blackbox;;
        qw) /mnt/stash/qw/Nitro;;
        xterm|*) exec xterm;;
        esac
fi
Chmod executable.

2. Now "echo qw > ~/.wm_style; startx" loads QuakeWorld, "echo bb > ~/.wm_style; startx" loads BlackBox and anything else defaults to having a single xterm. "Startx" is either your basic alias to start X11 or a Bash script that takes care of presenting xinit the user and server args.


I wish people would ask more questions I could answer!
OK. Did you harden your boxen appropriately?
 
Old 11-14-2003, 09:01 AM   #3
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Original Poster
Rep: Reputation: 30
Thank you, you may have saved my bacon.

Quote:
Originally posted by unSpawn
OK. Did you harden your boxen appropriately?
Ha yes. Two things I am able to help people with are OpenBSD's pf and iptables, I have always been security minded. And I don't choose passwords like "joe" or "me" like _some_ people I know.

Thanks again,

B.

 
Old 11-14-2003, 12:39 PM   #4
Faecal
Member
 
Registered: Sep 2002
Location: York, UK
Distribution: Debian Sid
Posts: 215

Rep: Reputation: 30
Very simple method:

Code:
X :1
export DISPLAY=:1.0

while(true) ; do
  mozilla -width 1024 -height 768 ;
done ;
 
Old 11-14-2003, 02:08 PM   #5
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Original Poster
Rep: Reputation: 30
wow, that IS easy. Thanks. Works perfectly.

B.
 
Old 11-14-2003, 06:11 PM   #6
Faecal
Member
 
Registered: Sep 2002
Location: York, UK
Distribution: Debian Sid
Posts: 215

Rep: Reputation: 30
A few points:
1) Don't put it in rc.local, make a script and call that script from inittab: that way it will restart if the user knows about ctrl-alt-backspace or something bad happens to the X server.

2) Remember to prefix it with a "su normaluser", but make sure that normaluser has some mozilla profiles and so forth. How much wiping you want to do in between usage sessions is purpose-dependant.

3) Think about hacking some stuff out of mozilla (XUL, so relatively trivial) - right now if the user clicks the little envelope or something, things can get rather confusing without a windowmanager running.

4) Don't forget that the user can still pretty much run arbitrary programs. It wouldn't take a world-class hax0r to produce a shell out of mozilla, probably.
 
Old 11-14-2003, 06:39 PM   #7
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Original Poster
Rep: Reputation: 30
thanks much. I have made a VERY unprivileged user, and I had already messed with the browser.jar (I ended up using firebird) to remove context menus, bookmark support, the address bar (), and just about every keyboard command. I have been testing it, it seems that a ctrl-alt-backspace don't screw it up, and for some (very good) reason, X11 doesn't detach from the text console so that when it starts, if you ctrl-alt-f1 it shows you text console, but doesn't allow you to ctrl-c, ctrl-d, or log in (and the other consoles 2 through 6 have disappeared, but I probably sound like an idiot for pointing those things out). And as well the KB isn't even gon be connected, it uses a touchscreen and a mouse-only HTML/ECMAScript interface I made so this is all assuming someone brings a mouse and crowbar from home, breaks the metal housing for the box itself, plugs in a keyboard, and THEN tries those things. Unlikely I think.

oh and it's official, you guys saved my bacon. So thank you. I've answered 4 or 5 questions since posting this for karma.

B.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto start a program in XFree on Fedora? MCSquared Fedora 22 09-12-2007 05:55 PM
booting to a fullscreen java program with a shell script sebastian.raghe Linux - Newbie 3 05-19-2005 02:42 AM
cant run fullscreen in games gunman Linux - Software 0 03-16-2005 01:38 PM
snes9x doesn't run fullscreen murray_linux Linux - Games 2 10-06-2004 01:00 PM
xlock does not run in fullscreen mode anymore after updating qtvision (KDE 3.1.1) Physitux Linux - Software 0 02-09-2004 02:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:50 PM.

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