From 0cb850b8a4820401cdfbda5f045eaf623ad555e6 Mon Sep 17 00:00:00 2001 From: bretello Date: Sun, 11 Apr 2021 13:09:47 +0200 Subject: [PATCH] zsh: add conditional insertion for systemd and debian plugins --- antibody_plugins.txt | 1 + antibody_plugins_arch.txt | 2 -- brethil_dotfile.sh | 15 +++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 antibody_plugins_arch.txt diff --git a/antibody_plugins.txt b/antibody_plugins.txt index 3be4c00..e2786f9 100644 --- a/antibody_plugins.txt +++ b/antibody_plugins.txt @@ -9,6 +9,7 @@ robbyrussell/oh-my-zsh path:plugins/git robbyrussell/oh-my-zsh path:plugins/grc robbyrussell/oh-my-zsh path:plugins/pip robbyrussell/oh-my-zsh path:plugins/pyenv +robbyrussell/oh-my-zsh path:plugins/pylint robbyrussell/oh-my-zsh path:plugins/sudo robbyrussell/oh-my-zsh path:plugins/vi-mode robbyrussell/oh-my-zsh path:plugins/zsh-navigation-tools diff --git a/antibody_plugins_arch.txt b/antibody_plugins_arch.txt deleted file mode 100644 index a6c511b..0000000 --- a/antibody_plugins_arch.txt +++ /dev/null @@ -1,2 +0,0 @@ -robbyrussell/oh-my-zsh path:plugins/systemd -robbyrussell/oh-my-zsh path:plugins/archlinux diff --git a/brethil_dotfile.sh b/brethil_dotfile.sh index d05a4c3..df669b2 100755 --- a/brethil_dotfile.sh +++ b/brethil_dotfile.sh @@ -8,17 +8,20 @@ export ZSH_THEME="brethil" export DISABLE_UNTRACKED_FILES_DIRTY=true export VIRTUAL_ENV_DISABLE_PROMPT=true -_ZSH_CACHE="${HOME}/.cache/zsh" -if [[ ! -d "${_ZSH_CACHE}" ]]; then mkdir -p "${_ZSH_CACHE}"; fi - # Source all zsh plugins source <(antibody init) export ANTIBODY="$(antibody home)" antibody bundle < "$DOTFILES/antibody_plugins.txt" -uname="$(uname -a)" -if [[ $uname == *"ARCH"* || $uname == *"MANJARO"* ]]; then - antibody bundle < "$DOTFILES/antibody_plugins_arch.txt" + +if [[ "$(command -v systemctl)" ]]; then + antibody bundle robbyrussell/oh-my-zsh path:plugins/systemd fi +if [[ "$(command -v pacman)" ]]; then + antibody bundle robbyrussell/oh-my-zsh path:plugins/archlinux +elif [[ "$(command -v apt)" ]]; then + antibody bundle robbyrussell/oh-my-zsh path:plugins/debian +fi + if [[ -n "$_DOTFILES_EXTRA_PLUGINS" ]]; then antibody bundle < "$DOTFILES/antibody_plugins_extra.txt" fi