#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $
#
#--lavr don't forget to do some adds later
# insert ssh-askpass & ssh-add

userresources=$HOME/.Xresources
#usermodmap=$HOME/.Xmodmap
userappdefs=$HOME/app-defaults
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
#sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi

if [ -d $userappdefs ]; then
    XAPPLRESDIR=$userappdefs
    export XAPPLRESDIR
fi

#--lavr env's-adds
LANG=ru_RU.KOI8-R
#TERMCAP=/usr/local/etc/xtermcap
TERMCAP=/etc/termcap
MANPATH=/usr/local/man:/usr/share/man:/usr/X11R6/man
MAIL=/var/mail/$USER
BLOCKSIZE=K
TZ=:/etc/localtime
TMPDIR=/tmp
PAGER=less
LESS=-ceM
LESSBINFMT="*u[%x]"
LESSCHARSET=latin1
VISUAL=/usr/bin/vi
EDITOR=/usr/bin/vi
PERLLIB=/usr/share/perl
XNLSPATH=/usr/X11R6/lib/X11/nls
XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
PATH=$HOME/bin:/usr/local/bin:$PATH
export LANG TERMCAP MANPATH MAIL BLOCKSIZE TZ TMPDIR PAGER
export LESS LESSBINFMT LESSCHARSET VISUAL EDITOR PERLLIB
export XNLSPATH XKEYSYMDB PATH

#-ssh-auth
#until ssh-askpass | ssh-add -p; do true; done
#-- for new ssh-add & ssh-askpass from OpenSSH
if [ -n "$SSH_AUTH_SOCK" ]; then
   until ssh-add < /dev/null; do true; done
fi

#--lavr start xconsole
xconsole -geometry 480x130+0-0 -daemon -notify -verbose -fn fixed &

sleep 2

#---lavr 1-st window +8+8
xterm +cm -fn 9x15 -geometry 80x40+8+8 -name Login -ls -sb &
xterm +cm -fn 9x15 -geometry 80x40+438+264 -title Unix1 -ls -sb &
#---lavr second window +1288+8
#ssh -f -q -o "BatchMode yes" cntc exec xterm +cm -fn 9x15 -geometry 80x40+1288+8 -title CNTC -sb -ls &
#xterm +cm -fn 9x15 -geometry 80x40+1806+279 -title CNTC-RUS -ls -sb &
#ssh -f -q -o BatchMode=yes eng exec xterm +cm -fn 9x15 -geometry 80x40+1720+267 -title Sunct0 -sb -ls &
#---lavr 3-d window +2569+8
###ssh -f -q -o "BatchMode yes" ultra.jinr.ru exec xterm -fn 9x15 -geometry 80x40+2569+8 -title Ultra -sb -ls &
#ssh -f -q -o BatchMode=yes ultra.jinr.ru exec xterm -fn 9x15 -geometry 80x40+2997+267 -title Ultra-1 -sb -ls &
#ssh -n nusun.jinr.ru exec xterm -fn 9x15 -geometry 80x40+1305+22 -title Nusun -sb -ls &
#---lavr 4-th window +8+773
#--- empty for load any-browsers
#---lavr 5-th window +1031+774
#ssh -p 2022 -f -q -o "BatchMode yes" unix1.jinr.ru exec xterm +cm -fn 9x15 -geometry 80x40+1289+1031 -title Unix1 -sb -ls &
#ssh -p 2022 -f -q -o "BatchMode yes" unix1.jinr.ru exec xterm +cm -fn 9x15 -geometry 80x40+1806+1304 -title Unix1 -sb -ls &
#ssh -p 2022 -f -q -o BatchMode=yes mp3.jinr.ru exec xterm +cm -fn 9x15 -geometry 80x40+1721+1291 -title Mp3 -sb -ls &
#---lavr 6-th window +2062+779
#ssh -f -q -o BatchMode=yes linux4u.jinr.ru /usr/X11/bin/xterm -fn 9x15 -geometry 80x40+2570+1035 -title L4u -sb -ls &
#ssh -l toor -f -q -o BatchMode=yes mp3 xterm +cm -fn 9x15 -geometry 80x40+2779+1056 -title Abit-1 -sb -ls &
#ssh -l toor -f -q -o BatchMode=yes mp3 xterm +cm -fn 9x15 -geometry 80x40+2979+1267 -title Abit-2 -sb -ls &
#---lavr load mailbox's
#xbiff -bg cyan -geometry 48x48+4+933 &
#xbuffy -geometry 179x27+2+800 -nobeep -bg cyan -header 0 -horiz -title unix1-mbox -names &
xbuffy -geometry 179x27+3+850 -nobeep -bg cyan -header 0 -horiz -title unix1-mbox -names &
#ssh -f -n cntc xbuffy -geometry +2+855 -bg weat -header 0 -horiz -title cntc -names &
#ssh -f -p 2022 -n unix1.jinr.ru xbuffy -geometry 179x27+2+744 -header 0 -horiz -title unix1-mbox -bg wheat -names &

sleep 2

#dclock -miltime -date "%d-%W/%m/%Y" -geometry 179x70+2+912 &
#dclock -miltime -date "%d-%W/%m/%Y" -geometry 140x50+413+932 &
dclock -miltime -date "%d-%W/%m/%Y" -geometry 179x73+2-35 &

#ssh -n cntc exec xbiff -geometry 48x48+118+933 &
#ssh -n sunct0 exec xbiff -geometry 48x48+118+933 &
#ssh -n ultra exec xbiff -geometry 48x48+175+933 -bg darkkhaki &

#xterm +cm -fn 8x16 -geometry 80x40+5+5 -title Alone -ls -sb &
sleep 1

exec fvwm95
