commit 7c551db63aefc86fb245563981f2c935757a478f parent 0e9f564fa789a9fb9dcf215db30ea90cf3f8cb0c Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Sat, 9 Jan 2021 13:53:31 +0100 memeselect: add target to update annna Diffstat:
M | .local/bin/memeselect | | | 16 | ++++++++++++---- |
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/.local/bin/memeselect b/.local/bin/memeselect @@ -1,5 +1,13 @@ #!/bin/sh -hashtags="$HOME/code/annna/modules/hashtags/hashtags.txt" -m="$(dmenu -l 10 < "$hashtags")" -printf '%s' "${m% *}" | xclip -i -plumb "${m#* }" +annna="$HOME/code/annna" +hashtags="${annna}/modules/hashtags/hashtags.txt" +updatestr="update list" + +m="$((printf '%s\n' "$updatestr"; cat "$hashtags") | dmenu -l 10)" + +if [ "$m" = "$updatestr" ]; then + cd "$annna" && git pull >/dev/null +else + printf '%s' "${m% *}" | xclip -i + plumb "${m#* }" +fi