#!/bin/sh # # $HOME/.xinitrc - initialize X Window System # # written by Hiroki Sato # $Id$ ### import environment varialbles if [ -f $HOME/.sh/.setenv ]; then eval `$HOME/.sh/.setenv -s` fi RESOURCES=$HOME/.Xresources XLOG=$HOME/.xsession-errors ARG0=`$BASENAME $0` putlog () { echo "$ARG0: $*" 1>&2 } ### display errors KILLPID=`$PSALL | $GREP "$TAIL -f $XLOG" | $GREP -v "$GREP" | $AWK '{print $2}' | $SORT -rn`; if [ ! -z "$KILLPID" ]; then for pid in $KILLPID do if [ $pid -gt 1 ]; then putlog "kill old \"tail -f\" process(pid:$pid)..." kill $pid; fi done fi $TAIL -f $XLOG >> /dev/console & ### set DISPLAY more precisely if [ "$DISPLAY" = ":0" -o "$DISPLAY" = ":0.0" ]; then putlog "set DISPLAY more precisely..." DISPLAY=`$HOSTNAME_BIN`:0.0; export DISPLAY fi ### merge resources if [ -f $RESOURCES ]; then putlog "resource merging..." xrdb -merge $RESOURCES fi ### using ssh? if [ -d $HOME/.ssh -a -x `which ssh-add` ]; then putlog "using ssh; needs ssh passphrase..." ssh-add < /dev/null fi ### include user configuration script if [ -f $HOME/.xinitrc.mine ]; then putlog "load local setup..." . $HOME/.xinitrc.mine fi ### exec terminal emulator putlog "invoke terminal emulator" kterm -geom +0-0 -iconic -n "emergency" & ### exec window manager putlog "exec $WINMGR" exec $WINMGR