mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
added stderror Prompt
This commit is contained in:
parent
1120f97305
commit
83d4548812
1 changed files with 31 additions and 0 deletions
31
themes/stderror.zsh-theme
Normal file
31
themes/stderror.zsh-theme
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# stderror.net Prompt
|
||||
#
|
||||
# mailto daniel(at)stderror.net
|
||||
|
||||
precmd () # dirty stuff for a clean prompt
|
||||
{
|
||||
local -A color
|
||||
local run
|
||||
local fill
|
||||
run=0
|
||||
local host=`hostname`
|
||||
len=`echo "+--<:)>--{$USER@$host}--[20:15]" | wc -c`
|
||||
color['time']=${1:-'white'}
|
||||
color['pwd']=${2:-'blue'}
|
||||
color['com']=${3:-'black'}
|
||||
smile='`if [ ${?} = 0 ]; then echo -ne "%F{green}:)%F{blue}"; else echo -ne "%F{red} :(%F{blue}"; fi;`'
|
||||
(( sub = ${COLUMNS} - ${len} ))
|
||||
while [ ${run} -lt ${sub} ]; do fill="${fill}-"; run=$((${run} + 1)); done;
|
||||
if [ "$USER" = "root" ]; then
|
||||
color['user']=${4:-'red'}
|
||||
else
|
||||
color['user']=${4:-'green'}
|
||||
fi
|
||||
PROMPT="
|
||||
%F{blue}+--<$smile>--{%F{$color['user']}%n%F{cyan}@%F{red}${host}%F{blue}}-$fill-[%F{yellow}%T%F{blue}]
|
||||
+{%f%d%F{cyan}>>%f"
|
||||
ps2="» "
|
||||
PS3="${PS2}"
|
||||
PS4="${PS2}"
|
||||
export PROMPT PS2 PS3 PS4
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue