summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-01-11 16:19:53 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2012-01-11 16:19:53 +0100
commit7ae359477171a803a546ed36d8d5cf49894e8f9c (patch)
tree2cdb8b1e247bfdd136b8584cb6beb29f911462ba /bashrc
parentbd2c98f15b172aa36be1a6be383ab6a2ae97aa17 (diff)
downloaddotfiles-7ae359477171a803a546ed36d8d5cf49894e8f9c.tar.gz
dotfiles-7ae359477171a803a546ed36d8d5cf49894e8f9c.tar.xz
dotfiles-7ae359477171a803a546ed36d8d5cf49894e8f9c.zip
prompt: change some colors
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc/common/prompt.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/bashrc/common/prompt.sh b/bashrc/common/prompt.sh
index fe2a139..cc57e38 100644
--- a/bashrc/common/prompt.sh
+++ b/bashrc/common/prompt.sh
@@ -7,22 +7,22 @@ export PS2="$(pcolor lblue)> $(pcolor)"
export PS3="$(color lblue)#? $(color)"
__make_prompt() {
- local PS1UH PS1D PS1R PS1F PS1P PS1BO PS1BC PS1VE user host rc=$? s
+ local PS1UH PS1D PS1R PS1F PS1P PS1BO PS1BC PS1VE user host _hostname rc=$? s
+ _hostname=$(hostname)
# username + nodename
- [[ $USER == "alex" ]] || user="\u"
- [[ $HOSTNAME == "laptop" ]] || host="\h"
- [[ -n "$user" && -n "$host" ]] && user="${user}@"
+ [[ $(id -nu) == "alex" ]] || user="\u"
+ [[ "${_hostname}" == "laptop" ]] || host="@${_hostname}"
[[ -z "$user" && -z "$host" ]] || host="${host} "
if [[ $(id -u) -eq 0 ]]; then
PS1UH="$(pcolor lred)${user}${host}$(pcolor)"
else
- PS1UH="$(pcolor lgreen)${user}${host}$(pcolor)"
+ PS1UH="$(pcolor lcyan)${user}${host}$(pcolor)"
fi
# working directory
- PS1D="$(pcolor lblue)$(pwd -P)$(pcolor)"
+ PS1D="$(pcolor lpurple)$(pwd -P)$(pcolor)"
# return code
if [[ $rc -eq 0 ]]; then
@@ -107,7 +107,6 @@ __make_prompt() {
export PS1="${PS1VE}${PS1UH}${PS1D} ${PS1BO}${PS1R}${PS1F}${PS1BC} ${s}${PS1P}"
if [[ "${TERM#screen}" != "${TERM}" ]]; then
- _hostname=$(hostname)
echo -ne "\ek$(id -un)@${_hostname%%\.*}\e\\"
fi
}