dotfiles

regexghost dotfiles and scripts
git clone https://git.regexghost.com/dotfiles.git
Log | Files | Refs | README

commit 5765461e8d6085c18c142e3c8a13271907685633
parent 5606cf2a40cd7ac187fa445d07a12ced2d791c85
Author: regexghost <dev@regexghost.com>
Date:   Wed,  8 Jul 2026 19:13:59 +0100

devlog function, git guide page and other minor changes

Diffstat:
Mdotfiles/.kshrc | 19+++++++++++++++++++
Aguides/git.md | 8++++++++
Mterminal-scripts/backup.sh | 1+
Mterminal-scripts/iphone-music-sync.sh | 2+-
4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/dotfiles/.kshrc b/dotfiles/.kshrc @@ -332,6 +332,25 @@ blog () { [ -d "$dir" ] && cd "$dir" || mkdir -p "$dir" && cd "$dir" } +devlog () { + month_num="$(date "+%m")" + month_name="$(date "+%B")" + year="$(date "+%Y")" + date="$(date "+%d")" + filename="$HOME/Programs/websites/personal-website/devlog/${year}-${month_num}-${month_name}.md" + + if [ -f "$filename" ]; then + "${VISUAL:-${EDITOR:-vi}}" "$filename" + else + echo "+++" >> "$filename" + echo "title = \"${month_name} ${year} Devlog\"" >> "$filename" + echo "datePublished = ${year}-${month_num}-${date}" >> "$filename" + echo "template = \"blog-page.html\"" >> "$filename" + echo "+++" >> "$filename" + "${VISUAL:-${EDITOR:-vi}}" "$filename" + fi +} + to () { cd "$(directory_bookmarks get "$1")" } diff --git a/guides/git.md b/guides/git.md @@ -0,0 +1,8 @@ +# GitHub repo + +git init +git add README.md +git commit -m "first commit" +git branch -M main +git remote add origin https://github.com/regexghost/<repo>.git +git push -u origin main diff --git a/terminal-scripts/backup.sh b/terminal-scripts/backup.sh @@ -16,6 +16,7 @@ elif [ "$1" = "remove" ] || [ "$1" = "rm" ]; then elif [ "$1" = "ls" ]; then cat "$BACKUP_FILE" | sed 's/^/~/g' elif [ "$1" = "make" ]; then + date "+y/%m/%d" >> "$XDG_DATA_HOME/regexghost/script-data/backup-history.txt" rsync -ar --links --delete --info=progress2 "${BACKUP_LOCATION}/latest/" "${BACKUP_LOCATION}/previous/" rsync -ar --links --delete --info=progress2 --files-from="${BACKUP_FILE}" "$HOME" "${BACKUP_LOCATION}/latest/" fi diff --git a/terminal-scripts/iphone-music-sync.sh b/terminal-scripts/iphone-music-sync.sh @@ -31,7 +31,7 @@ while read -r line; do echo "${local} -> ${phone}" [ -d "${MOUNT_LOCATION}/${phone}" ] || mkdir "${MOUNT_LOCATION}/${phone}" rsync -vr --copy-links --update --delete --modify-window=1 --info=progress2 "${HOME}/Music/${local}/" "${MOUNT_LOCATION}/${phone}/" - find ~/Music/"${local}/" -type f | sort | sed "s|.*${local}/|../${phone}/|g" > "/tmp/${phone}.m3u8" + find "${MOUNT_LOCATION}/${phone}/" -type f | sort | sed "s|.*${phone}/|../${phone}/|g" > "/tmp/${phone}.m3u8" cp "/tmp/${phone}.m3u8" "${MOUNT_LOCATION}/Playlists/" done < "$XDG_CONFIG_HOME/regexghost/playlists-phone-sync.csv"