From a751783e735152b26c9098cdcfe2c3b9f1d1932f Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Tue, 5 Jul 2022 15:43:37 +0200 Subject: [PATCH] Edit scripts --- scripts/.local/bin/clear-clipboard.sh | 2 +- scripts/.local/bin/pdf-clean.sh | 2 ++ scripts/.local/bin/update.sh | 19 +++++-------------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/scripts/.local/bin/clear-clipboard.sh b/scripts/.local/bin/clear-clipboard.sh index c928871..e427c9b 100755 --- a/scripts/.local/bin/clear-clipboard.sh +++ b/scripts/.local/bin/clear-clipboard.sh @@ -4,6 +4,6 @@ wl-copy -c wl-copy -pc -# X clipboard (for XWayland) +# X clipboard echo -n "" | xclip -selection clipboard -i echo -n "" | xclip -selection primary -i diff --git a/scripts/.local/bin/pdf-clean.sh b/scripts/.local/bin/pdf-clean.sh index 05d2959..69c2700 100755 --- a/scripts/.local/bin/pdf-clean.sh +++ b/scripts/.local/bin/pdf-clean.sh @@ -1,5 +1,7 @@ #!/usr/bin/env dash +set -e + pdftk "$1" dump_data_utf8 output meta.txt sed -i 's/^InfoValue:.*$/InfoValue:/g' meta.txt pdftk "$1" update_info meta.txt output "$1.clean.pdf" diff --git a/scripts/.local/bin/update.sh b/scripts/.local/bin/update.sh index 9dbf057..70296ba 100755 --- a/scripts/.local/bin/update.sh +++ b/scripts/.local/bin/update.sh @@ -15,23 +15,14 @@ elif [ "$(uname -o)" = "GNU/Linux" ]; then fi fi -command -v flatpak >/dev/null 2>&1 \ - && { echo; flatpak update; } || true - -command -v npm >/dev/null 2>&1 \ - && { echo; npm update --location=global; } || true - -command -v rustup >/dev/null 2>&1 \ - && { echo; rustup update; } || true - -command -v nvim >/dev/null 2>&1 \ - && { echo; nvim --headless +PlugUpdate +PlugUpgrade +qa; echo; } || true - +command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; } +command -v npm >/dev/null 2>&1 && { echo; npm update --location=global; } +command -v rustup >/dev/null 2>&1 && { echo; rustup update; } +command -v nvim >/dev/null 2>&1 && { echo; nvim --headless +PlugUpdate +PlugUpgrade +qa; echo; } command -v docker >/dev/null 2>&1 && [ "$(docker images | wc -l)" -gt 1 ] \ && { echo; docker images \ | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' \ - | xargs -l docker pull; } || true + | xargs -l docker pull; } echo - zsh -ic "antidote update && fg &>/dev/null && echo && git -C $(dirname -- "$(readlink -e "$0")") pull"