* Re: Simple prompt theme
[not found] <5.2.1.1.0.20030530233427.02681cc8@valenzud.inbox.email.ari zona.edu>
@ 2003-05-31 8:20 ` Dirus
0 siblings, 0 replies; 2+ messages in thread
From: Dirus @ 2003-05-31 8:20 UTC (permalink / raw)
To: zsh-users
At 12:36 AM 5/31/2003, I wrote:
>I've made a simple prompt theme...
I made a small change to add %_ to PS2 since that seems to show off the zsh
a bit more, and I also renamed _text and _other to just text and
other. Rather than risk flooding the mailing list I'll just post it here:
http://www.u.arizona.edu/~valenzud/prompt_simple_setup
This URL will probably only be valid for another month or two (just graduated).
^ permalink raw reply [flat|nested] 2+ messages in thread
* Simple prompt theme
@ 2003-05-31 7:36 Dirus
0 siblings, 0 replies; 2+ messages in thread
From: Dirus @ 2003-05-31 7:36 UTC (permalink / raw)
To: zsh-users
I've made a simple prompt theme that displays "user@host:path>" by default
in white but can accept up to two colors. I use it with "cyan blue" but it
looks good with "red yellow" too, maybe I shouldn't leave the default color
white? Anyway, it basically shows what the "redhat" and "suse" prompts do
but in a way that still allows people to set colors to brighten up their
prompt. I'm not sure if I need this line, but the other themes seem to
have it (now that's peer pressure!):
prompt_opts=( cr percent )
I hope it doesn't bother anyone if I paste it at the end of this email. I
could do a diff -u with an empty file but that doesn't make much sense. I
suppose it's a bit much of me to even think others might want to use it
(but I'm proud of it), at least I didn't call it the dirus theme. ;) I
hope this is the right mailing list for it (I didn't know if I should post
to workers or to users), and I hope no one minds the extra 2k in their inbox.
prompt_simple_setup:
# Created by Dirus
prompt_simple_help () {
cat <<'EOF'
As it's name suggests, this prompt is designed to be small and to work
with all fonts, and yet still provide useful information.
This prompt is color-scheme-able. You can invoke it thus:
prompt simple [<text-color> [<punctuation-color>]]
The default color is just white and is intended to work on a black
background. Simply use darker colors (such as black) for use on a
lighter background.
EOF
}
prompt_simple_setup () {
local text_color=${1:-'white'}
local _text="%{$fg_no_bold[$text_color]%}"
local _other="%{$fg_bold[${2:-$text_color}]%}"
PS1="$_text%n$_other@$_text%m$_other:$_text%~$_other>%{$reset_color%} "
PS2="$_other>%{$reset_color%} "
prompt_opts=( cr percent )
precmd () { }
preexec () { }
}
prompt_simple_preview () {
if (( ! $#* )); then
prompt_preview_theme simple
print
prompt_preview_theme simple green
print
prompt_preview_theme simple red yellow
print
prompt_preview_theme simple white yellow
print
prompt_preview_theme simple cyan blue
print
prompt_preview_theme simple green blue
else
prompt_preview_theme simple "$@"
fi
}
prompt_simple_setup "$@"
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-05-31 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <5.2.1.1.0.20030530233427.02681cc8@valenzud.inbox.email.ari zona.edu>
2003-05-31 8:20 ` Simple prompt theme Dirus
2003-05-31 7:36 Dirus
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).