X-Git-Url: https://git.siccegge.de//index.cgi?p=dotfiles%2Fzsh.git;a=blobdiff_plain;f=zshrc;h=abd47ce5a61cbf00d758a90a76009d23573bc82b;hp=a6df1013f42361caa972ccd9a6f449a9d81168aa;hb=d486c08b2dd4badb323f28d2e5ca464d9da4080f;hpb=ee56453096e805310a6fef51660a7f4f54239408 diff --git a/zshrc b/zshrc index a6df101..abd47ce 100644 --- a/zshrc +++ b/zshrc @@ -55,6 +55,12 @@ setWindowTitle(){ precmd () { vcs_info setWindowTitle ${USER}@${HOST} + + if [[ $UID == 0 && -f `which systemctl` ]] + then + use_systemd=true + systemd_failed="`systemctl --state=failed | grep failed | cut -d \ -f 2 | tr '\n' ' '`" + fi } config=("default" "`uname -s`") @@ -78,7 +84,15 @@ case "${DOMAIN//cs.fau.de/informatik.uni-erlangen.de}" in ;; esac -PROMPT=$'%{$fg[yellow]%}%n@%{$fg[magenta]%}%m%{$reset_color%} %~ \n%{$fg[cyan]%}%T%{$reset_color%} %0(?,%{$fg[green]%},%{$fg[red]%}%s)%?%{$reset_color%} %# ' +if [[ $UID == 0 && -f `which systemctl` ]] +then + PROMPT=$'%{$fg[red]>> $systemd_failed$reset_color%}\n' +else + PROMPT="" +fi + +PROMPT+=$'%{$fg[yellow]%}%n@%{$fg[magenta]%}%m%{$reset_color%} %~ \n%{$fg[cyan]%}%T%{$reset_color%} %0(?,%{$fg[green]%},%{$fg[red]%}%s)%?%{$reset_color%} %# ' + RPROMPT='${vcs_info_msg_0_}' export DEBEMAIL='christoph@debian.org'