guest@dotshare [~/groups/shells/zsh] $ ls I-cant-believe-its-not-butter/ | cat

I can't believe it's not butter! (scrot, raw, dl) (+1 likes)

Graawr Oct 26, 2013 (shells/zsh)

SCROT

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Functions
function ssh_state {
    if [ -n "$SSh_CONNECTION" ]; then
        echo "%{$fg[red]%}<%{$fg[white]%}SSH%{$fg[red]%}> "
    fi
}

function collapse_pwd {
    if [[ $(pwd) == $HOME ]]; then
        echo $(pwd)
    else    
        echo $(pwd | sed -e "s,^$HOME,~,")
    fi
}

function error_code {
    if [[ $? == 0 ]]; then
        echo ""
    else
        echo "%{$fg[white]%}<%{$fg[red]%}%?%{$fg[white]%}>%{$reset_color%}"
fi
}

last_command='%(?.>>.<<)'


## Prompts
PROMPT='
  %{$fg[red]%}<%{$fg[white]%}$(collapse_pwd)%{$fg[red]%}> $(ssh_state)
%{$fg[white]%}$last_command%{$reset_color%} '

RPROMPT='$(error_code)%{$reset_color%}'

CLICK TO VIEW

x

Notes

“I can’t believe it’s not butter!” series.
I only show the prompt because the rest of the conf is really strongly inspired (some would stay stolen) from the most favored ones here.