From 81afb2846e37b430121c1d81b1e3578e87a3c742 Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Wed, 5 Aug 2020 09:10:58 +0200 Subject: [PATCH] Nouveau module Antibody MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Antibody est un gestionnaire de plugin pour zsh: https://getantibody.github.io La commande ‘antibody update’ recherche les m-à-j ET les installe. --- plugins.d/antibody.sh | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/plugins.d/antibody.sh b/plugins.d/antibody.sh index 0125550..af049f3 100755 --- a/plugins.d/antibody.sh +++ b/plugins.d/antibody.sh @@ -28,13 +28,16 @@ no_distract=false notification() { sound="Basso" - title="Homebrew" + title="Antibody" #subtitle="Attention !!!" message="$1" - image="error.png" + image_err="error.png" + image_ok="success.png" - if [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v terminal-notifier)" ]; then - terminal-notifier -title "$title" -message "$message" -sound "$sound" -contentImage "$image" + if [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v terminal-notifiera)" ]; then + terminal-notifier -title "$title" -message "$message" -sound "$sound" -contentImage "$image_ok" + elif [[ "$OSTYPE" == "darwin"* ]] && [ -n "$(which alerter)" ]; then + alerter -title "$title" -subtitle "" -message "$message" -sound "$sound" -contentImage "$image_ok" -timeout 3 fi } @@ -46,7 +49,7 @@ fi echo -e "\033[1m🙏 Antibody \033[0m" echo "" -#update=$(antibody update 2>&1) +update=$(antibody update 2>&1) installed=$(echo "$update" | grep "updating") updated=$(echo "$update" | grep "updated") @@ -85,19 +88,6 @@ if [ -n "$updated" ]; then IFS=$'\n' for j in $(echo "$updated") - do - url=$(echo "$j" | awk '{print $3}') - module=$(echo "$j" | awk -F "/" '{print $NF}') - commit=$(echo "$j" | awk -F "$url" '{print $NF}') - echo "$commit" - echo -e "\033[1m$module\033[0m ($url)" - done -else - echo -e "\033[4mNo Antibody modules to update.\033[0m" - echo "" - - IFS=$'\n' - for j in $(cat updated.txt) do url=$(echo "$j" | awk '{print $3}') module=$(echo "$j" | awk -F "/" '{print $NF}' | awk '{print $1}') @@ -107,8 +97,13 @@ else echo "Commits: $commit" echo "Last commit: "$url"/commits/"$last_commit # https://github.com/zsh-users/zsh-completions/commits/ + + notif="$module has been updated" + notification "$notif" done - +else + echo -e "\033[4mNo Antibody modules to update.\033[0m" + echo "" fi <