justfiles for automating various tasks on my workstation

Fix file paths

+8 -8
notes.just
···
[group('notes')]
newnotecat category:
#!/usr/bin/env bash
-
NOTES_DIR="${HOME}/nextcloud/notes"
+
NOTES_DIR="${HOME}/nextcloud/Notes"
CATEGORY={{ category }}
mkdir -p "${NOTES_DIR}/${CATEGORY}"
···
[group('notes')]
lsnotecats:
#!/usr/bin/env bash
-
NOTES_DIR="${HOME}/nextcloud/notes"
+
NOTES_DIR="${HOME}/nextcloud/Notes"
echo "# Note categories" | gum format -t markdown
/bin/ls "$NOTES_DIR" | xargs -I _ printf "- %s/\n" _ | gum format -t markdown
···
[group('notes')]
newmem year:
#!/usr/bin/env bash
-
MEM_DIR="${HOME}/nextcloud/notes/memories"
+
MEM_DIR="${HOME}/nextcloud/Notes/memories"
YEAR={{ year }}
if [ ! -f "${MEM_DIR}/${YEAR}.md" ]; then
cat <<EOF >"${MEM_DIR}/${YEAR}.md"
···
[group('notes')]
viewmem year:
#!/usr/bin/env bash
-
MEM_DIR="${HOME}/nextcloud/notes/memories"
+
MEM_DIR="${HOME}/nextcloud/Notes/memories"
YEAR={{ year }}
glow -p "${MEM_DIR}/${YEAR}.md"
···
[group('notes')]
lsmems:
#!/usr/bin/env bash
-
MEM_DIR="${HOME}/nextcloud/notes/memories"
+
MEM_DIR="${HOME}/nextcloud/Notes/memories"
echo "# Memory years" | gum format -t markdown
/bin/ls "$MEM_DIR" | xargs -I _ printf "- %s\n" _ | gum format -t markdown
···
newtechnote filename:
#!/usr/bin/env bash
FILENAME={{ filename }}
-
TECHNOTE_DIR="${HOME}/nextcloud/notes/tech"
+
TECHNOTE_DIR="${HOME}/nextcloud/Notes/tech"
nvim "${TECHNOTE_DIR}/${FILENAME}.md"
# View private tech note with glow
···
viewtechnote filename:
#!/usr/bin/env bash
FILENAME={{ filename }}
-
TECHNOTE_DIR="${HOME}/nextcloud/notes/tech"
+
TECHNOTE_DIR="${HOME}/nextcloud/Notes/tech"
glow -p "${TECHNOTE_DIR}/${FILENAME}.md"
# List all private tech notes
[group('notes')]
lstechnotes:
#!/usr/bin/env bash
-
TECHNOTE_DIR="${HOME}/nextcloud/notes/tech"
+
TECHNOTE_DIR="${HOME}/nextcloud/Notes/tech"
echo "# Tech notes" | gum format -t markdown
/bin/ls "$TECHNOTE_DIR" | xargs -I _ printf "- %s\n" _ | gum format -t markdown
+2
setup.just
···
for dir in "Desktop" "Documents" "Downloads" "Music" "Pictures" "Public" "Templates" "Videos"; do
rm -rfv "${HOME}/${dir}"
done
+
ln -sf "${HOME}/nextcloud/Documents" "${HOME}/documents"
+
ln -sf "${HOME}/nextcloud/Pictures" "${HOME}/pictures"
xdg-user-dirs-update
# Setup borgmatic config
+3 -3
utilities.just
···
find "${HOME}/games/gog/baldurs-gate-3/drive_c/users/steamuser/My Documents/Larian Studios/Baldur's Gate 3/Screenshots" \
-maxdepth 1 \
-mindepth 1 \
-
-exec cp -fv {} "${HOME}/nextcloud/pictures/bg3_screenshots" \;
+
-exec cp -fv {} "${HOME}/nextcloud/Pictures/bg3_screenshots" \;
fi
if [ "$GAME" = "eso" ]; then
find "${HOME}/.steam/steam/steamapps/compatdata/306130/pfx/drive_c/users/steamuser/Documents/Elder Scrolls Online/live/Screenshots" \
-maxdepth 1 \
-mindepth 1 \
-
-exec cp -fv {} "${HOME}/nextcloud/pictures/eso_screenshots" \;
+
-exec cp -fv {} "${HOME}/nextcloud/Pictures/eso_screenshots" \;
fi
if [ "$GAME" = "starfield" ]; then
···
-maxdepth 1 \
-mindepth 1 \
-not -name "*-thumbnail.png" \
-
-exec cp -fv {} "${HOME}/nextcloud/pictures/starfield_screenshots" \;
+
-exec cp -fv {} "${HOME}/nextcloud/Pictures/starfield_screenshots" \;
fi
# Create a .tar.gz archive from {{dir}}