mirror of
https://github.com/balkian/dotfiles.git
synced 2024-11-24 13:12:29 +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'
|
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"
|
TMPPREFIX="${TMPDIR%/}/zsh"
|
||||||
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
if command -v foo >/dev/null 2>&1 ; then
|
||||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
eval "$(pyenv init -)"
|
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
pyenv virtualenvwrapper
|
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_segment_separator=' '
|
||||||
_prompt_balkian_start_time=$SECONDS
|
_prompt_balkian_start_time=$SECONDS
|
||||||
|
|
||||||
|
hostnamecolor=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 30 + (total % 6)}')
|
||||||
|
|
||||||
function prompt_balkian_start_segment {
|
function prompt_balkian_start_segment {
|
||||||
local bg fg
|
local bg fg
|
||||||
[[ -n "$1" ]] && bg="%K{$1}" || bg="%k"
|
[[ -n "$1" ]] && bg="%K{$1}" || bg="%k"
|
||||||
@ -45,7 +47,7 @@ function prompt_balkian_end_segment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function prompt_balkian_build_prompt {
|
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'
|
prompt_balkian_start_segment black default '$_prompt_balkian_pwd'
|
||||||
|
|
||||||
if [[ -n "$git_info" ]]; then
|
if [[ -n "$git_info" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user