Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 26863 Details for
Bug 43753
zsh gentoo prompt
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
zsh gentoo prompt
prompt_gentoo_setup (text/plain), 1.58 KB, created by
Tobias Minich
on 2004-03-04 15:21:35 UTC
(
hide
)
Description:
zsh gentoo prompt
Filename:
MIME Type:
Creator:
Tobias Minich
Created:
2004-03-04 15:21:35 UTC
Size:
1.58 KB
patch
obsolete
># gentoo prompt theme > >prompt_gentoo_help () { > cat <<'EOF' >This prompt is color-scheme-able. You can invoke it thus: > > prompt gentoo [<promptcolor> [<usercolor> [<rootcolor>]]] > >EOF >} > >prompt_gentoo_setup () { > prompt_gentoo_prompt=${1:-'blue'} > prompt_gentoo_user=${2:-'green'} > prompt_gentoo_root=${3:-'red'} > > if [ `/usr/bin/whoami` = 'root' ] > then > base_prompt="%{$fg_bold[$prompt_gentoo_root]%}%m%{$reset_color%} " > else > base_prompt="%{$fg_bold[$prompt_gentoo_user]%}%n@%m%{$reset_color%} " > fi > post_prompt="%{$reset_color%}" > > base_prompt_no_color=$(echo "$base_prompt" | perl -pe "s/%{.*?%}//g") > post_prompt_no_color=$(echo "$post_prompt" | perl -pe "s/%{.*?%}//g") > > precmd () { prompt_gentoo_precmd } > preexec () { } >} > >prompt_gentoo_precmd () { > setopt noxtrace localoptions > local base_prompt_expanded_no_color base_prompt_etc > local prompt_length space_left > > base_prompt_expanded_no_color=$(print -P "$base_prompt_no_color") > base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3~") > prompt_length=${#base_prompt_etc} ># if [[ $prompt_length -lt 40 ]]; then ># path_prompt="%{$fg_bold[$prompt_adam1_color2]%}%(4~|...|)%3~%{$fg_bold[white]%}" ># else ># space_left=$(( $COLUMNS - $#base_prompt_expanded_no_color - 2 )) ># path_prompt="%{$fg_bold[$prompt_adam1_color3]%}%${space_left}<...<%~$prompt_newline%{$fg_bold_white%}" ># fi > path_prompt="%{$fg_bold[$prompt_gentoo_prompt]%}%1/" > PS1="$base_prompt$path_prompt %(0#.#.$) $post_prompt" > PS2="$base_prompt$path_prompt %_> $post_prompt" > PS3="$base_prompt$path_prompt ?# $post_prompt" >} > >prompt_gentoo_setup "$@"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 43753
: 26863