Neat little cursor

Neat little cursor

Post by Alex Rig » Fri, 30 Dec 1994 16:21:23



Here's a neat little cursor script that I wrote.  The comments should
explain it.  I'm open to all comments/questions/suggestions/etc

#####
# cursor
#
# This program is designed to change the standard cursor
# for the Super User from the '#' to include the current
# working directory and change color with each sucessive
# login (ALT-F?).  ALT-F10 and up will change the cursor
# to brown (yuck).  It will will also put and machine
# name in the prompt.  Which is handy uucping across
# machines.
#
# Note: the current working directory will not print
# properly in the bourne shell.  Besides your prompt can
# get REAL long.
#
# Originally Written by Alex J. Riggs -- on 12/04/94
#
# Last modified 12/13/94
#####

##################### Start cursor code ####################

CoLoR_NuM=`who am i | cut -c16`

case $CoLoR_NuM
in
     1 ) CoLoR_SeT=green ;;
     2 ) CoLoR_SeT=lt_blue ;;
     3 ) CoLoR_SeT=red ;;
     4 ) CoLoR_SeT=yellow ;;
     5 ) CoLoR_SeT=lt_magenta ;;
     6 ) CoLoR_SeT=lt_cyan ;;
     7 ) CoLoR_SeT=hi_white ;;
     8 ) CoLoR_SeT=cyan ;;
     9 ) CoLoR_SeT=lt_red ;;
     * ) CoLoR_SeT=brown ;;
esac

setcolor -o black
setcolor $CoLoR_SeT black

USER=`id | cut -d\( -f2 | cut -d \) -f1`
SYSTEM=`uname -n`

####
# pick the prompt you like
####





################### End cursor code ###################

I put just the code in the .profile files of the users that like it
and works very well.  You'll find that after about a day or so of
use that you get the color code memorized.  Have fun there's lots
of room to "fiddle" with this one.