Hosted in marc.info.
From 9fans Fri Feb 18 22:00:57 2005
From: Russ Cox <russcox () gmail ! com>
Date: Fri, 18 Feb 2005 22:00:57 +0000
To: 9fans
Subject: Re: [9fans] Life with plan9port
Message-Id: <ee9e417a050218140037ce9362 () mail ! gmail ! com>
X-MARC-Message: https://marc.info/?l=9fans&m=111559026036780
This is a bunch of my startup files. It's the sh half, but
I have similar stuff set up for rc. (I use bash on one machine
and rc on another to force myself to keep plan9port
working nicely with both.)
Notice the setting of $BROWSER (see web(1)), $EDITOR,
$GS_FONTPATH, $PAGER (see cat(1)), $secstore (used by factotum),
$COREDIR (see core(1); most of my systems are set up to
dump cores into /core/username).
The complicated if at the end of .profile checks to see if I'm
logging in on tty1, and if so starts factotum, ssh-agent, and X.
It needs to set $NAMESPACE because X is not yet running.
The .bashrc set +o emacs and set +o vi turn off (sic) emacs
and vi line editing, so that bash runs in cooked mode, so
I can edit my command lines with 9term.
The script riostart, which has nothing to do with rio
(it does on Plan 9!), starts my stats, acme, and firefox
windows.
Russ
t23=; cat .profile
PATH=$HOME/bin:$PATH:/usr/local/plan9/bin
PLAN9=/usr/local/plan9
BROWSER=firefox
CVS_RSH=ssh
EDITOR=E
GS_FONTPATH=$PLAN9/postscript/font
H=`hostname | sed 's/\..*//'`
MPAGE="-t -bLetter"
PAGER=nobs
PS1=$H'=; '
unset FCEDIT VISUAL
font=/usr/local/plan9/font/lucm/unicode.9.font
home=$HOME
prompt="$H=; ^A " # for rc
user=$USER
secstore=swtch.com
server=am
export \
BROWSER\
CVS_RSH\
EDITOR\
FCEDIT\
GS_FONTPATH\
H\
MPAGE\
PAGER\
PATH\
PLAN9\
PS1\
VISUAL\
font\
home\
prompt\
user\
secstore\
ulimit -c unlimited
if [ -d /core/rsc ]; then
COREDIR=/core/rsc; export COREDIR
fi
. $HOME/.bashrc
if [ "`/bin/ls -l /proc/self/fd/0 2>/dev/null | awk '{print $NF}'`" =
'/dev/tty1' ]
then
# echo
# echo Console login.
NAMESPACE=/tmp/ns.`hostname`
export NAMESPACE
rm -rf $NAMESPACE; mkdir $NAMESPACE
# echo ' name' space $NAMESPACE
# echo Starting factotum.
9 factotum
# echo Starting SSH agent.
eval `9 ssh-agent -e`
startx
fi
t23=; cat .bashrc
_cd () {
\cd "$@" &&
case "$TERM!$-" in
linux!*)
;;
*!*i*)
awd
esac
}
alias cd=_cd
PS1=$H'=; ' export PS1
set +o emacs
set +o vi
set -a # autoexport
[ -d $PLAN9 ] || . $HOME/.profile
t23=; cat .xinitrc
plumber
riostart
rio &
sleeper
t23=; cat bin/riostart
#!/usr/local/plan9/bin/rc
astats &
sleep 2
# the funny acme comments are for restart
switch(`{hostname}){ # acme
case tux # acme
acme -a -W 1592x1100@0,100 -l lib/acme.dump &
case t23 * # acme
acme -a -W 1392x942@0,100 -l lib/acme.dump &
} # acme
firefox &
t23=; cat bin/sleeper
#!/bin/sh
while true
do
sleep 1000
done
t23=;
t23=; cat bin/restart
#!/bin/sh
grep $1 $HOME/bin/riostart | /usr/local/plan9/bin/rc
t23=; cat bin/astats
#!/bin/sh
x=/usr/local/plan9/bin/auxstats
l=lcs.mit.edu
c=csail.mit.edu
mach="tux.$c:$x amsterdam.$l:$x tears.$l:$x sweat.$l:$x"
if [ `hostname` = t23 ]
then
mach="t23 $mach"
fi
stats -W 500x100@0,0 -lmisce $mach
# stats -W 100x100@0,0 -lmisce
t23=;