]> git.rmz.io Git - dotfiles.git/blobdiff - zshenv
zsh: shell agnostic check for systemctl
[dotfiles.git] / zshenv
diff --git a/zshenv b/zshenv
index fc7ffc889394e6cafec3fc710908b7e2bd7bc953..e939573326c76c7ac3bd0c61c1aff7038e1684a0 100644 (file)
--- a/zshenv
+++ b/zshenv
@@ -5,7 +5,7 @@ export XDG_DATA_HOME="$HOME/.local/share"
 export XDG_CACHE_HOME="$HOME/.cache"
 export HOST=$(hostname)
 
 export XDG_CACHE_HOME="$HOME/.cache"
 export HOST=$(hostname)
 
-if [[ $+commands[systemctl] ]]; then
+if hash systemctl 2>/dev/null; then
     systemctl --user import-environment \
         XDG_CACHE_HOME \
         XDG_CONFIG_HOME \
     systemctl --user import-environment \
         XDG_CACHE_HOME \
         XDG_CONFIG_HOME \