|
@@ -685,16 +685,19 @@ ip-address(){ |
|
|
test -n "$ip" && printf $1 $ip |
|
|
test -n "$ip" && printf $1 $ip |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__my_ps1_script(){ |
|
|
__my_ps1_script(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
test -n "$SCRIPT" && echo "${__my_c5}SCR${__my_cdef} " |
|
|
test -n "$SCRIPT" && echo "${__my_c5}SCR${__my_cdef} " |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
__my_ps1_scale(){ |
|
|
__my_ps1_scale(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
printf "${LINES}x${COLUMNS}" |
|
|
printf "${LINES}x${COLUMNS}" |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
__my_ps1_tmux(){ |
|
|
__my_ps1_tmux(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
null type tmux || return $last |
|
|
null type tmux || return $last |
|
@@ -702,11 +705,13 @@ __my_ps1_tmux(){ |
|
|
test -n "$TMUX" && echo "[TMUX:$tmuxc]" |
|
|
test -n "$TMUX" && echo "[TMUX:$tmuxc]" |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
__my_ps1_moc(){ |
|
|
__my_ps1_moc(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
__my_moc_state "[MOC:%s]" |
|
|
__my_moc_state "[MOC:%s]" |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for f in /usr/share/git/git-prompt.sh \ |
|
|
for f in /usr/share/git/git-prompt.sh \ |
|
|
/opt/local/share/doc/git-core/contrib/completion/git-prompt.sh |
|
|
/opt/local/share/doc/git-core/contrib/completion/git-prompt.sh |
|
|
do |
|
|
do |
|
@@ -721,11 +726,13 @@ __my_ps1_git(){ |
|
|
__git_ps1 "[GIT:$(__try_exec git config --get user.name):%s]" |
|
|
__git_ps1 "[GIT:$(__try_exec git config --get user.name):%s]" |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
__my_ps1_ipaddr(){ |
|
|
__my_ps1_ipaddr(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
! iswindows && ip-address [Addr:%s] |
|
|
! iswindows && ip-address [Addr:%s] |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
__my_ps1_bttry(){ |
|
|
__my_ps1_bttry(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
local bst="${TMP}/batterystatus" |
|
|
local bst="${TMP}/batterystatus" |
|
@@ -738,19 +745,22 @@ __my_ps1_bttry(){ |
|
|
fi |
|
|
fi |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
__my_ps1_dirs(){ |
|
|
__my_ps1_dirs(){ |
|
|
dirs | wc -l |
|
|
dirs | wc -l |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
__my_ps1_jobs(){ |
|
|
__my_ps1_jobs(){ |
|
|
jobs | wc -l |
|
|
jobs | wc -l |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if test "$TERM" != dumb |
|
|
if test "$TERM" != dumb |
|
|
then |
|
|
then |
|
|
__my_c1="\[\e[1;31m\]" # color for PWD |
|
|
|
|
|
|
|
|
__my_c1="\[\e[0;33m\]" # color for PWD |
|
|
__my_c2="\[\e[0;36m\]" # color for user |
|
|
__my_c2="\[\e[0;36m\]" # color for user |
|
|
__my_c3="\[\e[1;30m\]" # color for OLDPWD |
|
|
__my_c3="\[\e[1;30m\]" # color for OLDPWD |
|
|
if test "`hostname`" = arch-aspireone; then __my_c4="\[\e[1;34m\]" |
|
|
if test "`hostname`" = arch-aspireone; then __my_c4="\[\e[1;34m\]" |
|
|
elif test "`hostname`" = darwin-mba.local; then __my_c4="\[\e[1;33m\]" |
|
|
|
|
|
|
|
|
elif test "`hostname`" = darwin-mba.local; then __my_c4="\[\e[1;31m\]" |
|
|
elif test "`hostname`" = newkiwi; then __my_c4="\[\e[1;35m\]" |
|
|
elif test "`hostname`" = newkiwi; then __my_c4="\[\e[1;35m\]" |
|
|
else __my_c4="\[\e[1;32m\]" # color for :: |
|
|
else __my_c4="\[\e[1;32m\]" # color for :: |
|
|
fi |
|
|
fi |
|
|