From 84a28ac3754b6f132f6225af603557677b0ea799 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 3 May 2014 15:04:19 +0200 Subject: zshrc: show username in prompt if it's not "derf' --- etc/.zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/.zshrc b/etc/.zshrc index 899e6c0..a3a0c9d 100644 --- a/etc/.zshrc +++ b/etc/.zshrc @@ -202,6 +202,7 @@ zle -N self-insert url-quote-magic typeset -A ps rps ps=( + user "%n" host "%F{yellow}%m" dir "%F{default}%30<…<%2v%>>" sign "%(!.%F{red}.%F{green})%(?.%(!.#.>).%?)%F{default}" @@ -213,7 +214,11 @@ rps=( end "%(1V.%F{yellow}]%F{default}.)" ) -PS1="${ps[host]} ${ps[dir]} ${ps[sign]} " +if [[ ${USER} == derf ]]; then + PS1="${ps[host]} ${ps[dir]} ${ps[sign]} " +else + PS1="${ps[user]}@${ps[host]} ${ps[dir]} ${ps[sign]} " +fi RPS1="${rps[start]}${rps[dirinfo]}${rps[end]}" -- cgit v1.2.3