]> git.siccegge.de Git - dotfiles/zsh.git/blobdiff - zshrc
more idiomatic check for systemctl
[dotfiles/zsh.git] / zshrc
diff --git a/zshrc b/zshrc
index 64ad4eaceb21954fb67ff78829269572a6b7812f..1f54e35a8d3c8321eef7361c5f88e4cc962e9f0d 100644 (file)
--- a/zshrc
+++ b/zshrc
@@ -65,7 +65,7 @@ precmd () {
     vcs_info
     setWindowTitle ${USER}@${HOST}
 
-    if [[ $UID == 0  && -f `which systemctl` ]]
+    if [[ $UID == 0 && $+commands[systemctl] != 0 ]]
     then
       use_systemd=true
       systemd_failed="`systemctl --state=failed | grep failed | cut -d \  -f 2 | tr '\n' ' '`"
@@ -93,7 +93,7 @@ case "${DOMAIN//cs.fau.de/informatik.uni-erlangen.de}" in
                ;;
 esac
 
-if [[ $UID == 0  && -f `which systemctl` ]]
+if [[ $UID == 0 && $+commands[systemctl] != 0 ]]
 then
   PROMPT=$'%{$fg[red]>>  $systemd_failed$reset_color%}\n'
 else