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: