From 1af9672ce1811413645fb38d0044bd0cc887d1b0 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Wed, 10 May 2023 12:40:42 -0600 Subject: [PATCH 1/2] git check --- scripts/git-check-remote | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/git-check-remote b/scripts/git-check-remote index 8355113..2ba10a6 100755 --- a/scripts/git-check-remote +++ b/scripts/git-check-remote @@ -1,6 +1,7 @@ #!/bin/sh -# -git -C "$1" remote update +# Check for new commits in remote + +git -C "$1" remote update > /dev/null 2>&1 commits=$(git -C "$1" status | grep -o "[0-9*]\scommit" | cut -d " " -f 1) [ -z "$commits" ] && exit From 8a18d0665164271ccc70008cddf2b46454fc4e81 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Wed, 10 May 2023 13:10:17 -0600 Subject: [PATCH 2/2] check remote script --- scripts/git-check-remote | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/git-check-remote b/scripts/git-check-remote index 2ba10a6..28eab68 100755 --- a/scripts/git-check-remote +++ b/scripts/git-check-remote @@ -1,9 +1,17 @@ #!/bin/sh # Check for new commits in remote -git -C "$1" remote update > /dev/null 2>&1 +# Git folders to check for new commits +set -- $HOME/Documents $HOME/.config +total=0 -commits=$(git -C "$1" status | grep -o "[0-9*]\scommit" | cut -d " " -f 1) -[ -z "$commits" ] && exit +for repo in $@ ; do + git -C "$repo" remote update > /dev/null 2>&1 + commits=$(git -C "$repo" status | grep -o "[0-9*]\scommit" | cut -d " " -f 1) + [ -n "$commits" ] && total=$(($total+$commits)) +done -printf "󰊢 $commits" +[ "$total" = 0 ] && exit + +printf "󰊢 $total" +kill -54 "$(pidof dwmblocks)"