#!/bin/sh # kiosk-dm --- this is the display manager used on my kiosk machines. # it simply invokes xinit and "kiosk-session". # created by jwz, 21-May-2000 # whether to do GPM tricks... use_gpm=true force=false while [ $# -gt 0 ]; do case $1 in --gpm) use_gpm=true ;; --no-gpm) use_gpm=false ;; --force) force=true ;; *) echo "usage: $0 --gpm --no-gpm --force" >&2 exit 1 ;; esac shift done if [ "$1" = "-force" ]; then force=true fi PATH=/bin:/usr/bin:/usr/X11R6/bin # don't let any single process allocate (sbrk) more than 64M. # (that is half of the available memory in these machines.) # (note that this requires bash 2.04 or better: ulimit is # broken in bash 1.14.) # ulimit -v 65536 cd / /usr/local/sbin/kiosk-home-init # print some useful stats to the console while waiting for X to start... # /usr/bin/top -bn1 | head -9 /sbin/ifconfig eth0 | head -2 # Check to see if this machine has Cyrix video; if so, tell X to use a # different layout from our XF86Config-4 file. # if ( /sbin/lspci | grep Cyrix >/dev/null ) ; then xlayout="Cyrix" elif ( /sbin/lspci | grep 'S3 Inc' >/dev/null ) ; then xlayout="Savage" elif ( /sbin/lspci | grep 'Trident' >/dev/null ) ; then xlayout="Trident" elif ( /sbin/lspci | grep 'VGA.*VIA Tech' >/dev/null ) ; then xlayout="VIA_UniChrome" else xlayout="SiS" fi # Maybe use GPM to map all mouse buttons to button1. # (XF86Config-4 must read mouse events from /dev/gpmdata for this to work) # killall gpm >/dev/null 2>&1 if [ "$use_gpm" = true ]; then xlayout="${xlayout}_GPM" sleep 2 killall -9 gpm >/dev/null 2>&1 rm -f /var/run/gpm.pid >/dev/null 2>&1 sleep 1 /usr/local/sbin/gpm -m /dev/mouse -t imps2 -R msc -B 111 & # /usr/local/sbin/gpm -m /dev/mouse -t ps2 -R msc -B 111 & # /usr/sbin/gpm -t ps2 -R msc & sleep 1 fi # if /etc/nox exists, don't run X. instead, wait for it to vanish. # unless "-force" was on the command line. if [ "$force" != true ]; then while [ -f /rw/etc/nox ]; do sleep 60 done fi exec xinit /usr/local/sbin/kiosk-session -- -layout $xlayout \ >/tmp/.xsession-errors 2>&1