Nerd font 필요
This commit is contained in:
1 parent
666d7c3a9c
commit
fb871e7f0a
3 files changed
+76
-12
No files matched your search
+53
-4
@@ -2,9 +2,10 @@
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
# Installs superfile (terminal file manager) — https://github.com/yorukot/superfile
|
||||
# Also installs JetBrains Mono Nerd Font (required for proper icon display).
|
||||
#
|
||||
# Uses the official installer on Mac/Linux:
|
||||
# bash -c "$(curl -sLo- https://superfile.dev/install.sh)"
|
||||
# Mac/Linux: Uses the official superfile installer
|
||||
# Windows: See install-superfile.ps1 (winget)
|
||||
#
|
||||
# Supported platforms:
|
||||
# macOS : Apple Silicon (arm64), Intel (x86_64)
|
||||
@@ -50,7 +51,7 @@ for cmd in curl; do
|
||||
done
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Install superfile
|
||||
# Step 1: Install superfile
|
||||
# ────────────────────────────────────────────
|
||||
info "Installing superfile (terminal file manager)..."
|
||||
|
||||
@@ -70,7 +71,55 @@ else
|
||||
fi
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Post-install notes
|
||||
# Step 2: Install JetBrains Mono Nerd Font
|
||||
# ────────────────────────────────────────────
|
||||
info "Installing JetBrains Mono Nerd Font (required for icon display)..."
|
||||
|
||||
OS="$(uname -s)"
|
||||
|
||||
case "$OS" in
|
||||
Darwin)
|
||||
brew install --cask font-jetbrains-mono-nerd-font
|
||||
success "JetBrains Mono Nerd Font installed via Homebrew"
|
||||
;;
|
||||
Linux)
|
||||
FONT_DIR="${HOME}/.local/share/fonts"
|
||||
FONT_NAME="JetBrainsMonoNerdFont"
|
||||
FONT_ZIP="JetBrainsMono.tar.xz"
|
||||
FONT_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/${FONT_ZIP}"
|
||||
|
||||
# Check if font is already installed
|
||||
if fc-list 2>/dev/null | grep -qi "$FONT_NAME"; then
|
||||
info "JetBrains Mono Nerd Font is already installed. Skipping."
|
||||
else
|
||||
TMPDIR="$(mktemp -d)"
|
||||
trap '[ -d "${TMPDIR:-}" ] && rm -rf "$TMPDIR"' EXIT
|
||||
|
||||
info "Downloading: $FONT_URL"
|
||||
curl -fsSL --progress-bar -o "${TMPDIR}/${FONT_ZIP}" "$FONT_URL" ||
|
||||
warn "Failed to download Nerd Font. Icons may not display correctly."
|
||||
|
||||
if [ -f "${TMPDIR}/${FONT_ZIP}" ]; then
|
||||
mkdir -p "$FONT_DIR"
|
||||
tar -xf "${TMPDIR}/${FONT_ZIP}" -C "$FONT_DIR" 2>/dev/null ||
|
||||
warn "Failed to extract font archive."
|
||||
|
||||
# Rebuild font cache
|
||||
if command -v fc-cache &>/dev/null; then
|
||||
fc-cache -f "$FONT_DIR" 2>/dev/null
|
||||
fi
|
||||
success "JetBrains Mono Nerd Font installed to $FONT_DIR"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
warn "JetBrains Mono Nerd Font auto-install is not supported on $OS."
|
||||
warn "Install it manually from: https://github.com/ryanoasis/nerd-fonts"
|
||||
;;
|
||||
esac
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Step 3: Post-install notes
|
||||
# ────────────────────────────────────────────
|
||||
info ""
|
||||
info "=================================================="
|
||||
|
||||
Reference in new issue
Block a user