From d3092f5703968c73e68c768daa81ab017db675fc Mon Sep 17 00:00:00 2001 From: James Reilly Date: Fri, 29 May 2026 20:39:41 +0100 Subject: [PATCH] fix(ujust): only run brew bundle when enabling bluefin-cli Previously the bluefin-cli recipe always ran 'brew bundle' after toggling bling, which meant disabling bling would reinstall all Homebrew CLI packages unnecessarily. Now the recipe checks whether bling is already installed before toggling, and only runs brew bundle when enabling (i.e., bling was not previously installed). Closes #164 --- .../usr/share/ublue-os/just/system.just | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/system_files/bluefin/usr/share/ublue-os/just/system.just b/system_files/bluefin/usr/share/ublue-os/just/system.just index acf0894b..5f1a4929 100644 --- a/system_files/bluefin/usr/share/ublue-os/just/system.just +++ b/system_files/bluefin/usr/share/ublue-os/just/system.just @@ -2,11 +2,42 @@ # This file should only contain bluefin specific stuff # Configure Bluefin-CLI Terminal Experience with Brew +# Only installs brew packages when enabling bling (not when disabling) [group('System')] [no-exit-message] bluefin-cli: - @ublue-bling - brew bundle --file=/usr/share/ublue-os/homebrew/cli.Brewfile + #!/usr/bin/env bash + set -e + BLING_SRC_DIR="/usr/share/ublue-os/bling" + BLING_SCRIPT="bling.sh" + SHELL_NAME="$(basename "${SHELL}")" + case "${SHELL_NAME}" in + fish) + BLING_SCRIPT="bling.fish" + TARGET_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/fish/config.fish" + ;; + zsh) + TARGET_FILE="${ZDOTDIR:-$HOME}/.zshrc" + ;; + bash) + TARGET_FILE="${HOME}/.bashrc" + ;; + *) + echo "Unknown shell: ${SHELL_NAME}" + exit 1 + ;; + esac + # Check if bling is currently installed before toggling + BLING_WAS_INSTALLED=1 + if [ -f "${TARGET_FILE}" ] && grep -q "source ${BLING_SRC_DIR}/${BLING_SCRIPT}" "${TARGET_FILE}" 2>/dev/null; then + BLING_WAS_INSTALLED=0 + fi + # Toggle bling (ublue-bling will remove if installed, add if not) + ublue-bling + # Only install brew packages when enabling (bling was not installed before) + if [ "${BLING_WAS_INSTALLED}" -ne 0 ]; then + brew bundle --file=/usr/share/ublue-os/homebrew/cli.Brewfile + fi # alias for toggle-devmode devmode: