# -*- shell-script -*- # This creates some standard functions. See also $talkdir/bashrc # which runs in the same bash context as the terminal. # Place any local environment variables and settings in "local". if [ -f local ]; then source local; fi # Environment variables. export HISTFILE=$talkdir/history export PATH=$talkdir:$PATH export LIBVIRT_DEFAULT_URI=qemu:///system export EDITOR="emacs -nw" # remember # # This function does two things: (1) It adds the command and arguments # to the shell history, so that commands can be recalled using up # arrow or reverse search. (2) It makes a function key recall the # command. The first command is assigned to F2, the second to F3 and # so forth. rm -f $HISTFILE touch $HISTFILE rm -f $talkdir/bindings touch bindings fnum=2 keys=(- OP OQ OR OS '[15~' '[17~' '[18~' '[19~' '[20~' '[21~') remember () { echo "$@" >> $HISTFILE echo \"\\e${keys[$fnum]}\":\"\\C-k \\C-u"$@"\" >> $talkdir/bindings ((fnum++)) } # terminal [--title=] # # This command launches the terminal. Usually used as the last line # of the script. # # Note: If you hand-configure gnome-terminal by adding a new profile # (eg. with larger fonts) then you can use that profile here by # replacing the --window flag with --window-with-profile=ProfileName terminal () { chmod -w $HISTFILE exec \ gnome-terminal \ --window-with-profile=Large \ --geometry=+140+64 \ --hide-menubar \ --disable-factory \ -e "/bin/bash --rcfile $talkdir/bashrc" \ "$@" }