From cf8623bca198442161dfb1b17ef178f4d1ffc2fe Mon Sep 17 00:00:00 2001 From: Jonas H Date: Sun, 8 Mar 2026 22:20:21 +0100 Subject: [PATCH 1/3] add .gitmodules for zsh plugins --- .gitmodules | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..595f031 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,11 @@ +[submodule "zshrc/.zsh/plugins/zsh-autosuggestions"] + path = zshrc/.zsh/plugins/zsh-autosuggestions + url = https://github.com/zsh-users/zsh-autosuggestions + +[submodule "zshrc/.zsh/plugins/zsh-history-substring-search"] + path = zshrc/.zsh/plugins/zsh-history-substring-search + url = https://github.com/zsh-users/zsh-history-substring-search + +[submodule "zshrc/.zsh/plugins/zsh-syntax-highlighting"] + path = zshrc/.zsh/plugins/zsh-syntax-highlighting + url = https://github.com/zsh-users/zsh-syntax-highlighting From e149dac3131830acdbf60ab204b6827bda2719f6 Mon Sep 17 00:00:00 2001 From: Jonas Haugesen Date: Thu, 12 Mar 2026 08:58:03 +0100 Subject: [PATCH 2/3] submodules support --- dot-add | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dot-add b/dot-add index 0ed2987..457aae7 100755 --- a/dot-add +++ b/dot-add @@ -45,6 +45,21 @@ add_one() { local REL="${FILE#$HOME/}" local DEST="$DOTFILES_DIR/$PACKAGE/$REL" + # If the path is a git repo, add it as a submodule instead of moving files + if [[ -d "$FILE/.git" ]]; then + local REMOTE + REMOTE="$(git -C "$FILE" remote get-url origin 2>/dev/null || true)" + if [[ -z "$REMOTE" ]]; then + echo "Error: '$FILE' is a git repo but has no remote origin — can't add as submodule" >&2 + return 1 + fi + mkdir -p "$(dirname "$DEST")" + rm -rf "$FILE" + git -C "$DOTFILES_DIR" submodule add "$REMOTE" "$PACKAGE/$REL" + echo "Added submodule: $REMOTE -> $DEST" + return 0 + fi + mkdir -p "$(dirname "$DEST")" mv "$FILE" "$DEST" echo "Moved: $FILE -> $DEST" From 8069f6f1507c69bc75810bd7bd64d8be02d13c78 Mon Sep 17 00:00:00 2001 From: Jonas Haugesen Date: Thu, 12 Mar 2026 08:58:49 +0100 Subject: [PATCH 3/3] pacman refresh --- install.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/install.sh b/install.sh index 7c07e9f..55d1b27 100755 --- a/install.sh +++ b/install.sh @@ -25,6 +25,25 @@ DISTRO=$(detect_distro) # Dependencies # --------------------------------------------------------------------------- +# On Arch-based systems, partial upgrades are unsupported — installing a +# package that pulls in a newer library breaks packages built against the old +# one. The right fix is 'sudo pacman -Syu', but doing that over SSH risks +# a dropped connection mid-kernel-upgrade. So we just warn and let the user +# decide. +check_arch_updates() { + sudo pacman -Sy --noconfirm # refresh databases only, no upgrade + local updates + updates=$(pacman -Qu 2>/dev/null | wc -l) + if [[ "$updates" -gt 0 ]]; then + echo "" + echo "WARNING: $updates system package(s) are out of date." + echo " If pacman fails with dependency conflicts, run 'sudo pacman -Syu'" + echo " locally (not over SSH, to avoid kernel upgrade risks), then re-run" + echo " this script." + echo "" + fi +} + case "$DISTRO" in endeavouros) # EndeavourOS is Arch-based, use pacman @@ -52,6 +71,7 @@ case "$DISTRO" in firefox ) + check_arch_updates echo "Installing packages for EndeavourOS..." sudo pacman -S --noconfirm "${PACMAN_PACKAGES[@]}" ;; @@ -110,6 +130,7 @@ case "$DISTRO" in firefox ) + check_arch_updates echo "Installing packages for Arch Linux..." sudo pacman -S --noconfirm "${PACMAN_PACKAGES[@]}" ;;