Files
RedBear-OS/recipes/shells/zsh/source/Functions/Prompts/prompt_oliver_setup
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

46 lines
1.5 KiB
Plaintext

# oliver prompt theme
prompt_oliver_help() {
cat <<'ENDHELP'
With this prompt theme, the prompt contains the current directory,
history number, number of jobs (if non-zero) and the previous
command's exit code (if non-zero) and a final character which
depends on privileges.
The colour of the prompt depends on two associative arrays -
$pcolour and $tcolour. Each array is indexed by the name of the
local host. Alternatively, the colour can be set with parameters
to prompt. To specify colours, use English words like 'yellow',
optionally preceded by 'bold'.
The hostname and username are also included unless they are in the
$normal_hosts or $normal_users array.
ENDHELP
}
prompt_oliver_setup() {
prompt_opts=( cr subst percent )
[[ "${(t)pcolour}" != assoc* ]] && typeset -Ag pcolour
[[ "${(t)tcolour}" != assoc* ]] && typeset -Ag tcolour
local pcol=${1:-${pcolour[${HOST:=`hostname`}]:-bold}}
local pcolr="%F{${${pcol#bold}:-default}}"
[[ $pcol = bold* ]] && pcolr=%B$pcolr
local tcol=${2:-${tcolour[$HOST]}}
local tcolr="fg=${${tcol#bold}:-default}"
[[ $tcol = bold* ]] && tcolr=bold,$tcolr
local a host="%m:" user="%n "
[[ $HOST == (${(j(|))~normal_hosts}) ]] && host=""
[[ $LOGNAME == (root|${(j(|))~normal_users}) ]] && user=""
PS1="$pcolr$user$host%~%"'$((COLUMNS-12))'"(l.$prompt_newline. )[%h%1(j.%%%j.)%0(?..:%?)]%# %b%f%k" RPS2='<%^'
PS2=''
typeset -ga zle_highlight
zle_highlight[(r)default:*]=default:$tcolr
}
prompt_oliver_setup "$@"