From fb871e7f0ab90427899899d069ef7c6dbc1da4d0 Mon Sep 17 00:00:00 2001 From: Jerry Chae Date: Thu, 14 May 2026 09:16:32 +0900 Subject: [PATCH] =?UTF-8?q?Nerd=20font=20=ED=95=84=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- install-superfile.ps1 | 29 ++++++++++++++++------ install-superfile.sh | 57 ++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 76 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index cef5911..bcd184a 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ curl -fsSL "https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-bott **superfile:** ```bash -bash -c "$(curl -sLo- https://superfile.dev/install.sh)" +curl -fsSL "https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-superfile.sh?ref_type=heads" | bash ``` **dua:** diff --git a/install-superfile.ps1 b/install-superfile.ps1 index 7f8794b..47bb079 100644 --- a/install-superfile.ps1 +++ b/install-superfile.ps1 @@ -1,11 +1,12 @@ #Requires -Version 5.1 <# .SYNOPSIS - Installs superfile (terminal file manager) via winget. + Installs superfile (terminal file manager) and JetBrains Mono Nerd Font. .DESCRIPTION - Installs superfile via winget (yorukot.superfile). - superfile is a modern terminal file manager with vim-style keybindings. + Installs superfile via winget (yorukot.superfile) and + JetBrains Mono Nerd Font via winget (DEVCOM.JetBrainsMonoNerdFont). + superfile requires a Nerd Font for proper icon display. Supported platforms: - Windows x64 (AMD64 / Intel 64bit) @@ -72,7 +73,7 @@ if ($spfCmd) { $spfBin = $spfCmd.Source } -# 2) Refresh PATH from registry (winget may have added paths) +# 2) Refresh PATH from registry if (-not $spfBin) { $env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'User') + ';' + [System.Environment]::GetEnvironmentVariable('Path', 'Machine') $spfCmd = Get-Command spf -ErrorAction SilentlyContinue @@ -126,7 +127,20 @@ if ($spfBin) { } # ──────────────────────────────────────────── -# Step 2: Post-install notes +# Step 2: Install JetBrains Mono Nerd Font +# ──────────────────────────────────────────── +Info "Installing JetBrains Mono Nerd Font (required for icon display)..." + +if (Get-Command winget -ErrorAction SilentlyContinue) { + winget install --id DEVCOM.JetBrainsMonoNerdFont --accept-package-agreements --accept-source-agreements 2>&1 | Out-Null + Success "JetBrains Mono Nerd Font installed via winget" +} else { + Warn "winget not available. Install JetBrains Mono Nerd Font manually from:" + Warn " https://github.com/ryanoasis/nerd-fonts/releases" +} + +# ──────────────────────────────────────────── +# Step 3: Post-install notes # ──────────────────────────────────────────── Info "" Info "==================================================" @@ -140,12 +154,13 @@ Info "" Info "IMPORTANT: Close this terminal and open a new one to use superfile (spf)." Info "PATH changes require a new terminal session to take effect." Info "" +Info "Note: The command name is 'spf', not 'superfile'." +Info "Set your terminal font to 'JetBrainsMono Nerd Font Mono' for proper icon display." +Info "" Info "Getting started:" Info " spf - Start superfile file manager" Info " spf --help - Show help" Info "" -Info "Note: The command name is 'spf', not 'superfile'." -Info "" Info "Key bindings (vim-style):" Info " h/j/k/l - Left/Down/Up/Right" Info " Enter - Open directory / file" diff --git a/install-superfile.sh b/install-superfile.sh index d9d8202..cded248 100755 --- a/install-superfile.sh +++ b/install-superfile.sh @@ -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 "=================================================="