From 9aa99b5d234e17bb382192530541d43adfc32734 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Sun, 27 Oct 2024 17:24:58 -0500 Subject: [PATCH] Add install-dust, sync_to_protondrive --- justfile | 11 +++++++++++ sync_to_protondrive | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 sync_to_protondrive diff --git a/justfile b/justfile index f6bf133..3d858ea 100644 --- a/justfile +++ b/justfile @@ -78,3 +78,14 @@ neovim-root: sudo mkdir -p /root/.config/nvim sudo wget https://files.hyperreal.coffee/init.vim -O /root/.config/nvim/init.vim + +install-dust: + #!/usr/bin/env bash + set -euo pipefail + dl_url=$(curl -s "https://api.github.com/repos/bootandy/dust/releases/latest" | jq '.assets | .[].browser_download_url' | grep "x86_64-unknown-linux-gnu.tar.gz" | tr -d '"') + wget "$dl_url" + filename=$(basename -s .tar.gz dust*) + tar xvf "${filename}.tar.gz" + sudo cp -v "${filename}/dust" /usr/local/bin/ + sudo chown root:root /usr/local/bin/dust + rm -rf "$filename" "${filename}.tar.gz" diff --git a/sync_to_protondrive b/sync_to_protondrive new file mode 100755 index 0000000..853919c --- /dev/null +++ b/sync_to_protondrive @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -euo pipefail + +STAGING_DIR="/home/jas/protonshare" +SHARE_DIRS=( + /home/jas/calibre-library + /home/jas/documents + /home/jas/ebooks + /home/jas/org + /home/jas/org-roam + /home/jas/pictures +) + +rm -rf "${STAGING_DIR}" +mkdir -p "${STAGING_DIR}" + +for dir in "${SHARE_DIRS[@]}"; do + cp -rfv "$dir" "${STAGING_DIR}/" +done + +rclone sync --transfers 8 "${STAGING_DIR:?}/" protondrive:/ + +exit 0