s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
3. Building a Kiosk Environment
3.1 FVWM2FVWM2 (FVWM, version 2 -- www.fvwm.org) is a flexible, reliable, and lightweight X Window manager that provides excellent configurability for creating a kiosk environment. For kiosk use you must change some of its default settings. You need to modify the system.fvwm2rc file to remove things like virtual desktops, title bars, exit controls, etc, leaving a relatively minimalist FVWM environment. Because the kiosk is a standalone unit, modifying the system-wide settings does not present a problem. You can also take advantage of FVWM's settable object properties to use X Window bitmaps (xpm files) to mask the parts of Netscape Navigator you don't want users to access. The FVWM2 file you need to modify is /etc/X11/fvwm2/system.fvwm2rc. (If you use a different distribution than Red Hat, this file may be located elsewhere.) You may have to poke around in this file to find the sections listed below.
/etc/X11/fvwm2/system.fvwm2rcIn
to
This eliminates the virtual desktops. Next, in the Default Styles section, change
to
This will disable most of the normal windowing controls. Add the following two lines to the Default Styles section:
The Default Styles part of the file should look something like this when you finish:
You can use the xdaliclock and sxpm programs to cover up parts of Netscape Navigator. The ``StaysOnTop'' attribute is the active ingredient. Next, find the following four lines and comment them out as shown:
Commenting out these lines will eliminate the nice task launcher from FVWM2, which is okay because you're after as simple an environment as you can create.
3.2 Netscape NavigatorNetscape Navigator is a better choice for setting up a kiosk than Netscape Communicator. Being simpler, there are fewer objects to hide. Under Microsoft Windows, Netscape Navigator has a kiosk mode that eliminates most of the Navigator controls but there is, at the time of this writing, no built-in kiosk mode for the Unix version of Navigator. The Unix version can, however, be invoked with a You need to decide on our kiosk screen resolution. Using a 19- or 20-inch monitor, we found 640x480 too large, 1024x768 too small, and 800x600 just about right for public viewing (you may decide differently). Once you decide on the resolution, you are ready to begin adjusting Navigator. For the rest of this HOWTO we assume 800x600 resolution. You'll need to adjust accordingly if you select a different resolution. Note: Navigator is going to be invoked by root during bootup,
so make all of the Netscape adjustments under the root account in the
Invoke Netscape and click into the Under Save these options, then click Notice how much more kiosk-like the interface has become? When you exit Navigator, these settings will be saved.
3.3 Overlay Masks for NavigatorIf you look closely at your adjusted Navigator screen, you'll see four areas that need to be covered and protected from mouse or trackball clicks:
Here's a rough schematic of the areas you need to mask:
To mask over the top areas (#1-3), we'll need three graphic images. To mask the security key (#4) we'll use xdaliclock.
Creating the Graphical MasksThe easiest way to create graphical masks to cover areas #1-3 is to grab a screenshot of Navigator in full 800x600 mode and then crop out areas that correspond to #1-3. I used GIMP for this. You can then re-design the basic graphics, changing the colors if you wish, or putting your own logo on them. Save them as:
The xpm format is the native X Window bitmap format. You will use the X Window program sxpm to place them on the screen. Creating the masks with just the right number of pixels and just the right placement on the monitor requires some experimentation. For your convenience, I have placed the xpm files we created plus our configuration files in at the following web site: http://www.rom.on.ca/kiosk/HOWTO/. You may find it simpler to download our masks and use them as a starting point for your own graphics.
3.4 /root/kiosk.xinitrcJust as you would normally create a .xinitrc file for your personal use, you must create an X Window session initialization file for our kiosk application. The following script implements a number of features:
This is the main file that runs the kiosk.
#!/bin/sh # kiosk.xinitrc -- Initialization script for kiosk X Window session # Start screensaver /usr/X11R6/bin/xscreensaver-command -exit /usr/X11R6/bin/xscreensaver & # Overlay over Navigator (mask #1) sxpm /root/navtop.xpm & # Overlay small graphic over Toolbar twister - left-hand side (mask #2) sxpm -g +0+23 /root/navleft.xpm & # Overlay larger graphic to cover everything to the right of # Home on the Toolbar (mask #3) sxpm -g +275+23 /root/navright.xpm & # Place xdaliclock over top of Netscape security key, lower lhc (mask #4) /usr/X11R6/bin/xdaliclock -g 38x20+0+578 -font fixed -noseconds \ -bg gray -fg black & sleep 2 # Start fvwm2 window manager fvwm2 & # restart netscape if it ever exits while true ; do if [ -f /.netscape/lock] ; then rm /.netscape/lock fi /usr/bin/netscape -geometry 800x600 done # This should never be reached
3.5 /root/xkioskYou can now start testing your kiosk setup. Since you will need to do this repeatedly, manually, as well as from an initialization script, create the following as a shell script named /root/xkiosk:
/usr/X11R6/bin/xinit /root/kiosk.xinitrc -- /usr/X11R6/bin/X \ -xf86config /root/kiosk.XF86Config bc Because you will be testing often, and reusing this later when you
automate the startup, create this command as a shell script called
Next Previous Contents |