From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4566 invoked from network); 26 Mar 1998 22:19:19 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 26 Mar 1998 22:19:19 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id RAA18801; Thu, 26 Mar 1998 17:16:01 -0500 (EST) Resent-Date: Thu, 26 Mar 1998 17:12:08 -0500 (EST) Message-Id: <199803262211.OAA21412@cousinit.hpl.hp.com> X-Authentication-Warning: cousinit.hpl.hp.com: Host localhost [127.0.0.1] didn't use HELO protocol X-Mailer: exmh version 1.6.4 10/10/95 To: ZSH User Mailinglist Subject: Re: Funky zsh prompts In-reply-to: Your message of "Thu, 26 Mar 1998 21:25:11 PST." <19980326212511.17303@thelonious.new.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 26 Mar 1998 14:11:27 -0800 From: Mike Smith Resent-Message-ID: <"ZgkPO3.0.Ya4.tAj6r"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1433 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Well if it were possible to display a small(very small)bitmap or xwindows bitmap file of a tachometer with a dial that reflects the load. This would require of course several bitmaps stored on the system. Each of the bitmaps would reflect a different load(state). The higher the needle is on the tachometer the higher the load on the system would be. Hope that is clear. Mike Smith mikesmit@hpl.hp.com > C. v. Stuckrad (stucki@math.fu-berlin.de) wrote: > > On Wed, 25 Mar 1998, Andrew Main wrote: > > > > > >Benbar came up with the amusing idea of making the smiley prompt change > > > >randomly every time I hit return (or even change to something that > > > >reflects the load of the machine). > > > > > > Cool idea. > > Very cool! I think it's about time I posted my BPFH :-) > > Any suggestions for improving it welcome. > > -------- 8< -------- 8< -------- > > reset_colour="$(echo -n '\e[0m')" > bold_colour="$(echo -n '\e[1m')" > > # Foreground > > grey="$(echo -n '\e[30m')" > red="$(echo -n '\e[31m')" > green="$(echo -n '\e[32m')" > yellow="$(echo -n '\e[33m')" > blue="$(echo -n '\e[34m')" > magenta="$(echo -n '\e[35m')" > cyan="$(echo -n '\e[36m')" > white="$(echo -n '\e[37m')" > > # Background > > bg_grey="$(echo -n '\e[40m')" > bg_red="$(echo -n '\e[41m')" > bg_green="$(echo -n '\e[42m')" > bg_yellow="$(echo -n '\e[43m')" > bg_blue="$(echo -n '\e[44m')" > bg_magenta="$(echo -n '\e[45m')" > bg_cyan="$(echo -n '\e[46m')" > bg_white="$(echo -n '\e[47m')" > > BASE_PROMPT="%{$bg_blue%}%m:%n%{$reset_colour%} " > POST_PROMPT="%{$reset_colour%}" > > BASE_PROMPT_NO_COLOUR=$(echo "$BASE_PROMPT" | perl -pe "s/%{.*?%}//g") > POST_PROMPT_NO_COLOUR=$(echo "$POST_PROMPT" | perl -pe "s/%{.*?%}//g") > > # Define prompts > > PROMPT_NEWLINE=$(echo -ne "\n%{\r%}") > > function precmd { > setopt noxtrace localoptions > local base_prompt base_prompt_etc prompt_length space_left > > base_prompt=$(print -P "$BASE_PROMPT_NO_COLOUR") > base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3.") > prompt_length=${#base_prompt_etc} > # echo "Prompt length is $prompt_length" > # echo "Base prompt length is $#base_prompt" > if [[ $prompt_length -lt 40 ]]; then > PATH_PROMPT="%{$bold_colour$cyan%}%(4~|...|)%3.%{$white%}" > else > space_left=$(( $COLUMNS - $#base_prompt - 2 )) > # echo "Space left is $space_left" > PATH_PROMPT="%{$bold_colour$green%}%${space_left}<...<%~$PROMPT_NEWLINE%{$white%}" > fi > PS1="$BASE_PROMPT$PATH_PROMPT %# $POST_PROMPT" > PS2="$BASE_PROMPT$PATH_PROMPT %_> $POST_PROMPT" > PS3="$BASE_PROMPT$PATH_PROMPT ?# $POST_PROMPT" > } >