27 lines
805 B
Bash
Executable file
27 lines
805 B
Bash
Executable file
#! /bin/zsh
|
|
|
|
OVER_PROMPT_CFG="/etc/over/env/prompt.cfg"
|
|
|
|
if [[ -a "$OVER_PROMPT_CFG" ]]; then
|
|
source "$OVER_PROMPT_CFG"
|
|
fi
|
|
|
|
function __over_prompt_set_title {
|
|
if [[ ${TERM} =~ "screen" ]]; then
|
|
print -Pn "\033k\033${@}\033\134"
|
|
fi
|
|
}
|
|
|
|
function __over_prompt_preexec {
|
|
__over_prompt_set_title "${USER}: ${PWD} -> ${1}"
|
|
}
|
|
|
|
function __over_prompt_precmd {
|
|
__over_prompt_set_title "${USER}: ${PWD}"
|
|
python3 /usr/share/over-env/prompt.py "${COLUMNS}" "${PWD}" "${OVER_PROMPT_LAST_REFRESH}" "${OVER_PROMPT_SYSLOAD_WARN:=1.25}" "${OVER_PROMPT_SYSLOAD_YELL:=3.0}" "${OVER_PROMPT_FREESPACE_WARN:=0.15}" "${OVER_PROMPT_FREESPACE_YELL:=0.05}"
|
|
PS1="$(print "%(?.%{\e[1;36m%}.%{\e[1;31m%}%?%{\e[0m%}:%{\e[1;31m%})%(\!.#.$)%{\e[0m%} ")"
|
|
OVER_PROMPT_LAST_REFRESH=$(date +%s)
|
|
}
|
|
|
|
unset OVER_PROMPT_CFG
|
|
unset RPS1
|