#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

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

# setup environment

LANG=ru_RU.KOI8-R
TERMCAP=/usr/local/etc/xtermcap
MANPATH=/usr/local/man:/usr/share/man:/usr/X11R6/man
MAIL=/var/mail/$USER
BLOCKSIZE=K
TZ=:/etc/localtime
TMPDIR=/tmp
PAGER=/usr/bin/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

#-- if you have the same pass-phrase for all: old_rsa, rsa & dsa:
#                                             add it to memory

if [ -n "$SSH_AUTH_SOCK" ]; then
   until ssh-add $HOME/.ssh/identity $HOME/.ssh/id_dsa $HOME/.ssh/id_rsa < /dev/null; do true; done
fi

#--lavr, if we have different pass-phrase for all identity, then add it
#                                         separatly
# uncomment below if you have different pass-phrase:
#--lavr, add old-rsa identity to memory
#if [ -n "$SSH_AUTH_SOCK" ]; then
#   until ssh-add < /dev/null; do true; done
#fi
#
#--lavr, add rsa to memory
#if [ -n "$SSH_AUTH_SOCK" ]; then
#   until ssh-add $HOME/.ssh/id_rsa < /dev/null; do true; done
#fi
#
#--lavr, add dsa to memory
#if [ -n "$SSH_AUTH_SOCK" ]; then
#   until ssh-add $HOME/.ssh/id_dsa < /dev/null; do true; done
#fi

# start some nice programs

#-xsetroot -solid SteelBlue
#-xclock -geometry 164x150-0+0 &
#-xload -geometry 164x75-0+175 &
#-xbiff -geometry 47x47-70+451 -bg green &
#---xterm -fn koi6x13 -geometry 80x40+0+0 -name login -ls &
#xterm -fn koi8x13 -name sun+cyr -bg wheat -ls -sb &
#xterm -fn koi8x13 -title cv+cyr -bg wheat -ls -sb -e rlogin cv &
#xterm -geometry 80x40 -name login -ls -sb &
#xterm -title unix1+cyr -bg wheat -ls -sb &
#color_xterm -title unix1+cyr -bg wheat -ls -sb &
#color_xterm -title cv+cyr -bg wheat -ls -sb -e rlogin cv &
#color_xterm -title sunct0 -bg wheat -sb -ls -e rlogin sunct0 &
#xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail &
#xterm -geometry 80x25+262+168 -title unix1+cyr -bg wheat -ls -sb &
#ssh -f -q -o "BatchMode yes" cv xterm -geometry 80x40+1031+7 -title CV -ls -sb &
#ssh -f -q -o "BatchMode yes" bcv xterm -geometry 80x40+1031+774 -title BCV-1 -sb -ls &
#ssh -f -q -o "BatchMode yes" bcv xterm -geometry 80x40+1293+944 -title BCV-2 -sb -ls &
#rxvt -fn 8x13 -geometry 80x40+1293+944 -title C-BCV -sb -ls -e rlogin bcv &
#rsh cv xbiff -geometry 48x48+70+624 -display unix1:0 -bg wheat &
#ssh -f -q -o "BatchMode yes"  cv xbiff -geometry 48x48+70+624 -bg wheat &
#xclock -geometry 216x32+5+689 -digital -chime&
#---lavr 1-st window +8+8
xconsole -geometry 480x130+0-0 -daemon -nonotify -verbose -fn fixed &
sleep 2
xset b 9
sleep 2
aumix -v 50%
xterm -fn 9x15 -geometry 80x40+8+8 -name login -ls -sb &
xterm -fn 9x15 -geometry 80x40+438+264 -title Unix1 -ls -sb &
#---lavr second window +1288+8
#ssh -f -q -o "BatchMode yes" spp xterm -fn 9x15 -geometry 80x40+1288+8 -title Spp -sb -ls &
ssh -X -f -q -o "BatchMode yes" linux4u /usr/X11/bin/xterm -fn 9x15 -geometry 80x40+1288+8 -title L4u -sb -ls &
#ssh -X -f -q -o "BatchMode yes" sunct0 exec xterm -fn 9x15 -geometry 80x40+1720+267 -title Sunct0 -sb -ls &
#---lavr 3-d window +2569+8
###ssh -X -f -q -o "BatchMode yes" ultra exec xterm -fn 9x15 -geometry 80x40+2569+8 -title Ultra -sb -ls &
###ssh -X -f -q -o "BatchMode yes" ultra exec xterm -fn 9x15 -geometry 80x40+2997+267 -title Ultra-1 -sb -ls &
#ssh -n nusun1 exec xterm -fn 9x15 -geometry 80x40+1305+22 -title Nusun1 -sb -ls &
#ssh -n nusun 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 -X -f -q -o "BatchMode yes" sunct4 exec xterm -fn 9x15 -geometry 80x40+1289+1031 -title Sunct4 -sb -ls &
#ssh -X -f -q -o "BatchMode yes" sunct2 exec xterm -fn 9x15 -geometry 80x40+1721+1291 -title Sunct2 -sb -ls &
#---lavr 6-th window +2062+779
#ssh -X -f -q -o "BatchMode yes" linux4u /usr/X11/bin/xterm -fn 9x15 -geometry 80x40+2570+1035 -title L4u -sb -ls &
#ssh -l toor -f -q -o "BatchMode yes" mp3 xterm -fn 9x15 -geometry 80x40+2779+1056 -title Abit-1 -sb -ls &
#ssh -l toor -f -q -o "BatchMode yes" mp3 xterm -fn 9x15 -geometry 80x40+2979+1267 -title Abit-2 -sb -ls &
#---lavr load mailbox's
#xbiff -bg cyan -geometry 48x48+4+933 &
xbiff -volume 5 -bg cyan -geometry 48x48+5+815 &
ssh -X -n cv exec xbiff -volume 5 -geometry 48x48+30+875 -bg wheat &
ssh -X -n ultra exec xbiff -volume 5 -geometry 48x48+5+934 -bg darkkhaki &
#ssh -X -n cv exec xbiff -geometry 48x48+62+933 -bg wheat &
#ssh -X -n sunct0 exec xbiff -geometry 48x48+118+933 &
#ssh -X -n ultra exec xbiff -geometry 48x48+175+933 -bg darkkhaki &
dclock -miltime -date "%d-%W/%m/%Y" -geometry 138x70+92+912 &
#dclock -miltime -date "%d-%W/%m/%Y" -geometry 140x50+413+932 &

# run preffered window-manager
#exec twm
#exec fvwm95-2
#exec fvwm
#exec fvwm2
exec fvwm95
