summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-03-07 13:24:36 +0100
committerHugues Hiegel <hugues@hiegel.fr>2008-03-07 14:15:23 +0100
commitac993bb0b997874a4ddb7a300b0195322b196b5c (patch)
tree3c6df6225b5a8c885cde2091db0ef8e01649210d
parente2761ab1784145e286ce51297071ce2a85ca0d19 (diff)
- preprint now accepts a second argument to give the color to use
- .zlogin uses now preprint command
-rw-r--r--.zlogin4
-rw-r--r--01_Functions.zsh14
2 files changed, 15 insertions, 3 deletions
diff --git a/.zlogin b/.zlogin
index a70e425..4bec47e 100644
--- a/.zlogin
+++ b/.zlogin
@@ -1,10 +1,10 @@
#for _col in {1..$COLUMNS} ; do echo -n "_" ; done ;\ echo;\
-echo "--------------------------------------------------[ événements ]---" ;
+preprint "événements" $color[bold] ; echo
cmd_exists when && when w --calendar=~/.when/birthdays
cmd_exists calendar && calendar -A0 | sed "s/\(\*.*\)/\1/;s/\(\*.*\*\)/\1/" ;\
-echo "--------------------------------------------------[ calendrier ]---" ;
+preprint "calendrier" $color[bold] ; echo
[ -x ~/sbin//calendrier ] && ~/sbin/calendrier
#cmd_exists remind && remind -n
diff --git a/01_Functions.zsh b/01_Functions.zsh
index 809d85a..18cf1c6 100644
--- a/01_Functions.zsh
+++ b/01_Functions.zsh
@@ -8,6 +8,14 @@
## these files with or without this notice.
##
+##
+## User-defined functions
+##
+#
+# For preexec, precmd, chpwd and other built-in functions,
+# go see the file Prompts.zsh
+#
+
cmd_exists ()
{
@@ -35,12 +43,16 @@ term_title()
preprint()
{
+ local my_color
+
+ my_color=${2-"$color[black];$color[bold]"}
+
hbar=
for i in {1..$(($COLUMNS - ${#1} - 5))}
do
hbar=$hbar-
done
- print -Pn "${C_}0;30;1${_C}${hbar}[ $1 ]-\r${C_}0${_C}"
+ print -Pn "${C_}$my_color${_C}${hbar}[ $1 ]-\r${C_}0${_C}"
}
get_git_branch ()