LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   XFree run single program fullscreen? (https://www.linuxquestions.org/questions/linux-general-1/xfree-run-single-program-fullscreen-115651/)

german 11-13-2003 12:57 PM

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.

unSpawn 11-13-2003 10:55 PM

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?

german 11-14-2003 09:01 AM

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.

:D :D :D

Faecal 11-14-2003 12:39 PM

Very simple method:

Code:

X :1
export DISPLAY=:1.0

while(true) ; do
  mozilla -width 1024 -height 768 ;
done ;


german 11-14-2003 02:08 PM

wow, that IS easy. Thanks. Works perfectly.

B.

Faecal 11-14-2003 06:11 PM

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.

german 11-14-2003 06:39 PM

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.


All times are GMT -5. The time now is 03:22 PM.