summaryrefslogtreecommitdiff
path: root/net:foret/Prompts.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'net:foret/Prompts.zsh')
-rw-r--r--net:foret/Prompts.zsh37
1 files changed, 23 insertions, 14 deletions
diff --git a/net:foret/Prompts.zsh b/net:foret/Prompts.zsh
index 817330f..3524614 100644
--- a/net:foret/Prompts.zsh
+++ b/net:foret/Prompts.zsh
@@ -10,29 +10,38 @@
_prompt_colors[target]="1;31"
-__compilation ()
+__static_dynamic ()
{
- unset COMPILATION
- if [ -n "$TARGET" -o -n "$STATIC" -o -n "$DYNAMIC" -o $(( ${V:-0} + ${NPROC:-0} )) -gt 0 ]
- then
- COMPILATION="["
-
[ $(( ${STATIC:-$(( 1 ^ ${DYNAMIC:-0} ))} + ${DYNAMIC:-$(( 1 ^ ${STATIC:-0} ))} )) -lt 2 ] && \
case "${STATIC:-$(( 1 ^ ${DYNAMIC:-0} ))}${DYNAMIC:-$((1 ^ ${STATIC:-0}))}" in
"10")
- COMPILATION+=$C_$_make_colors[dynamic]$_C"static"$C_$_prompt_colors[soft_generic]$_C ;;
+ echo $C_$_make_colors[static]$_C"static" ;;
"01")
- COMPILATION+=$C_$_make_colors[target]$_C"dynamic"$C_$_prompt_colors[soft_generic]$_C ;;
+ echo $C_$_make_colors[dynamic]$_C"dynamic" ;;
esac
+}
- COMPILATION+=$C_$_make_colors[target]$_C$TARGET$C_$_prompt_colors[soft_generic]$_C
+__compilation_target ()
+{
+ [ -n "$TARGET" ] && echo $C_$_make_colors[target]$_C$TARGET
+}
+__verbose_compilation ()
+{
[ -n "$V" -a "$V" -gt 0 ] && \
- COMPILATION+=$C_$_make_colors[verbose]$_C$(for i in {1..$V} ; echo -n "V")$C_$_prompt_colors[soft_generic]$_C
+ echo $C_$_make_colors[verbose]$_C$(for i in {1..$V} ; echo -n "V")
+}
+__nproc_compilation ()
+{
[ -n "$NPROC" -a "$NPROC" -gt 0 ] && \
- COMPILATION+=$C_$_make_colors[nproc]$_C$(for i in {1..$NPROC} ; echo -n "|")$C_$_prompt_colors[soft_generic]$_C
-
- COMPILATION+="] "
- fi
+ echo $C_$_make_colors[nproc]$_C$(for i in {1..$NPROC} ; echo -n "|")
+}
+__makeflags ()
+{
+ echo $MAKEFLAGS
}
+
+PS1_TASKBAR+=(__makeflags __verbose_compilation __nproc_compilation)
+PS1_EXTRA_INFO+=(__static_dynamic __compilation_target)
+