#! /bin/tcsh -f # {{{ Versioning and license info # # $Id: setup,v 1.13 2006/08/21 15:55:14 proclus Exp $ # Many thanks to Robert L. Campbell # Copyright (C) 2006 Michael L. Love # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # or find it at: http://www.gnu.org/copyleft/gpl.html # # }}} # {{{ Variable definitions setenv BOLD "" setenv UNBOLD "" setenv PREMARK "[01;" setenv POSTMARK "m" setenv UNMARK "" # cleanup ansi here ;-} # setenv UNMARK "" setenv UNMARK "" setenv UNMARK "" setenv UNMARK "" setenv LTGREY ${PREMARK}0${POSTMARK} setenv UNLTGREY ${UNMARK} setenv UNDERLINE ${PREMARK}4${POSTMARK} setenv UNUNDERLINE ${UNMARK} setenv BLINK ${PREMARK}5${POSTMARK} setenv UNBLINK ${UNMARK} setenv BLOCK ${PREMARK}7${POSTMARK} setenv UNBLOCK ${UNMARK} setenv GREY ${PREMARK}30${POSTMARK} setenv UNGREY ${UNMARK} setenv YELLOW ${PREMARK}33${POSTMARK} setenv UNYELLOW ${UNMARK} setenv GREEN ${PREMARK}32${POSTMARK} setenv UNGREEN ${UNMARK} setenv BLUE ${PREMARK}34${POSTMARK} setenv UNBLUE ${UNMARK} setenv CYAN ${PREMARK}36${POSTMARK} setenv UNCYAN ${UNMARK} setenv RED ${PREMARK}31${POSTMARK} setenv UNRED ${UNMARK} setenv MAGENTA ${PREMARK}35${POSTMARK} setenv UNMAGENTA ${UNMARK} setenv WHITE ${PREMARK}37${POSTMARK} setenv UNWHITE ${UNMARK} setenv BLOCKYELLOW ${PREMARK}43${POSTMARK} setenv UNBLOCKYELLOW ${UNMARK} setenv BLOCKGREEN ${PREMARK}42${POSTMARK} setenv UNBLOCKGREEN ${UNMARK} setenv BLOCKBLUE ${PREMARK}44${POSTMARK} setenv UNBLOCKBLUE ${UNMARK} setenv BLOCKCYAN ${PREMARK}46${POSTMARK} setenv UNBLOCKCYAN ${UNMARK} setenv BLOCKRED ${PREMARK}41${POSTMARK} setenv UNBLOCKRED ${UNMARK} setenv BLOCKMAGENTA ${PREMARK}45${POSTMARK} setenv UNBLOCKMAGENTA ${UNMARK} setenv BLOCKWHITE ${PREMARK}47${POSTMARK} setenv UNBLOCKWHITE ${UNMARK} # }}} # {{{ Set some basic/general values # determine operating system (architecture) setenv OS `uname -s` setenv OS_VERSION `uname -r` setenv MACHINE `uname -m` if ( -f /etc/debian_version ) then setenv DISTRO Debian else if ( -f /etc/fedora-release ) then setenv DISTRO FedoraCore else setenv DISTRO endif # make some big programs run better! if ( ${OS} != 'Darwin' && ${OS_VERSION} != '7.0.0' ) then unlimit stacksize limit coredumpsize 0 endif # }}} # {{{ Handle arguments #switch ($#argv) #case 0: # {{{ No argument given? # # echo put usage info here # # breaksw # }}} #default: #@ i = 0 #while (1) # #setenv word $i #echo ${PREMARK}${i}${POSTMARK}${i}${UNMARK} # #@ i = $i + 1 #end # #echo # #endsw echo echo Welcome to ${GREEN}stay_awake-1.1${UNGREEN} echo echo "Your OS is: ${CYAN}${DISTRO}${UNCYAN} " echo " ${BLUE}${OS}${UNBLUE} " echo " ${MAGENTA}${OS_VERSION}${UNMAGENTA} " echo " ${RED}${MACHINE}${UNRED} " echo setenv divider ${BLUE}' | '${UNBLUE} while(1) echo -n `date`$divider`whoami`$divider`hostname`$divider`uptime|sed s/'^ '//|sed s/', '/"${divider}"/g|cut -d' ' -f 2,3,4,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21`" " && sleep 1 end