|
|
@ -21,7 +21,7 @@ _prompt_paradox_current_bg='NONE'
|
|
|
|
_prompt_paradox_segment_separator=''
|
|
|
|
_prompt_paradox_segment_separator=''
|
|
|
|
_prompt_paradox_start_time=$SECONDS
|
|
|
|
_prompt_paradox_start_time=$SECONDS
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_start_segment {
|
|
|
|
prompt_paradox_start_segment() {
|
|
|
|
local bg fg
|
|
|
|
local bg fg
|
|
|
|
[[ -n "$1" ]] && bg="%K{$1}" || bg="%k"
|
|
|
|
[[ -n "$1" ]] && bg="%K{$1}" || bg="%k"
|
|
|
|
[[ -n "$2" ]] && fg="%F{$2}" || fg="%f"
|
|
|
|
[[ -n "$2" ]] && fg="%F{$2}" || fg="%f"
|
|
|
@ -34,7 +34,7 @@ function prompt_paradox_start_segment {
|
|
|
|
[[ -n "$3" ]] && print -n "$3"
|
|
|
|
[[ -n "$3" ]] && print -n "$3"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_end_segment {
|
|
|
|
prompt_paradox_end_segment() {
|
|
|
|
if [[ -n "$_prompt_paradox_current_bg" ]]; then
|
|
|
|
if [[ -n "$_prompt_paradox_current_bg" ]]; then
|
|
|
|
print -n " %k%F{$_prompt_paradox_current_bg}$_prompt_paradox_segment_separator"
|
|
|
|
print -n " %k%F{$_prompt_paradox_current_bg}$_prompt_paradox_segment_separator"
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -44,7 +44,7 @@ function prompt_paradox_end_segment {
|
|
|
|
_prompt_paradox_current_bg=''
|
|
|
|
_prompt_paradox_current_bg=''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_build_prompt {
|
|
|
|
prompt_paradox_build_prompt() {
|
|
|
|
prompt_paradox_start_segment black default '%(?::%F{red}✘ )%(!:%F{yellow}⚡ :)%(1j:%F{cyan}⚙ :)%F{blue}%n%F{red}@%F{green}%m%f'
|
|
|
|
prompt_paradox_start_segment black default '%(?::%F{red}✘ )%(!:%F{yellow}⚡ :)%(1j:%F{cyan}⚙ :)%F{blue}%n%F{red}@%F{green}%m%f'
|
|
|
|
prompt_paradox_start_segment blue black '$_prompt_paradox_pwd'
|
|
|
|
prompt_paradox_start_segment blue black '$_prompt_paradox_pwd'
|
|
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ function prompt_paradox_build_prompt {
|
|
|
|
prompt_paradox_end_segment
|
|
|
|
prompt_paradox_end_segment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_pwd {
|
|
|
|
prompt_paradox_pwd() {
|
|
|
|
local pwd="${PWD/#$HOME/~}"
|
|
|
|
local pwd="${PWD/#$HOME/~}"
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$pwd" == (#m)[/~] ]]; then
|
|
|
|
if [[ "$pwd" == (#m)[/~] ]]; then
|
|
|
@ -66,7 +66,7 @@ function prompt_paradox_pwd {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_print_elapsed_time {
|
|
|
|
prompt_paradox_print_elapsed_time() {
|
|
|
|
local end_time=$(( SECONDS - _prompt_paradox_start_time ))
|
|
|
|
local end_time=$(( SECONDS - _prompt_paradox_start_time ))
|
|
|
|
local hours minutes seconds remainder
|
|
|
|
local hours minutes seconds remainder
|
|
|
|
|
|
|
|
|
|
|
@ -85,7 +85,7 @@ function prompt_paradox_print_elapsed_time {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_precmd {
|
|
|
|
prompt_paradox_precmd() {
|
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
|
|
|
|
|
|
|
|
|
|
@ -101,11 +101,11 @@ function prompt_paradox_precmd {
|
|
|
|
prompt_paradox_print_elapsed_time
|
|
|
|
prompt_paradox_print_elapsed_time
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_preexec {
|
|
|
|
prompt_paradox_preexec() {
|
|
|
|
_prompt_paradox_start_time="$SECONDS"
|
|
|
|
_prompt_paradox_start_time="$SECONDS"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_setup {
|
|
|
|
prompt_paradox_setup() {
|
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
|
|
|
prompt_opts=(cr percent subst)
|
|
|
|
prompt_opts=(cr percent subst)
|
|
|
|