mirror of
https://github.com/balkian/dotfiles.git
synced 2024-12-22 08:38:12 +00:00
Different prompt color per hostname
This commit is contained in:
parent
32509d6482
commit
1e449408bb
@ -102,9 +102,20 @@ function newdev () {
|
||||
|
||||
alias gsicluster='ssh balkian@shannon.gsi.dit.upm.es -p 1337'
|
||||
|
||||
function gsiclustercopy(){
|
||||
scp -P 1337 $1 balkian@shannon.gsi.dit.upm.es:/shared/balkian/$2
|
||||
}
|
||||
|
||||
TMPPREFIX="${TMPDIR%/}/zsh"
|
||||
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
pyenv virtualenvwrapper
|
||||
if command -v foo >/dev/null 2>&1 ; then
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
pyenv virtualenvwrapper
|
||||
fi
|
||||
|
||||
export GOPATH=$HOME/go
|
||||
export PATH=$PATH:$GOPATH/bin/
|
||||
|
||||
setopt interactivecomments
|
||||
|
@ -21,6 +21,8 @@ _prompt_balkian_current_bg='NONE'
|
||||
_prompt_balkian_segment_separator=' '
|
||||
_prompt_balkian_start_time=$SECONDS
|
||||
|
||||
hostnamecolor=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 30 + (total % 6)}')
|
||||
|
||||
function prompt_balkian_start_segment {
|
||||
local bg fg
|
||||
[[ -n "$1" ]] && bg="%K{$1}" || bg="%k"
|
||||
@ -45,7 +47,7 @@ function prompt_balkian_end_segment {
|
||||
}
|
||||
|
||||
function prompt_balkian_build_prompt {
|
||||
prompt_balkian_start_segment black default '%(?::%F{red}✘ )%(!:%F{yellow}⚡ :)%(1j:%F{cyan}⚙ :)%F{green}%n%F{white}@%F{green}%m%f'
|
||||
prompt_balkian_start_segment black default '%(?::%F{red}✘ )%(!:%F{yellow}⚡ :)%(1j:%F{cyan}⚙ :)%F{${hostnamecolor}}%n%F{white}@%F{${hostnamecolor}}%m%f'
|
||||
prompt_balkian_start_segment black default '$_prompt_balkian_pwd'
|
||||
|
||||
if [[ -n "$git_info" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user