Skip to content

feat: add installation scripts for Nerd Fonts on Ubuntu and macOS#11

Merged
bybatkhuu merged 5 commits intomainfrom
dev
Mar 16, 2026
Merged

feat: add installation scripts for Nerd Fonts on Ubuntu and macOS#11
bybatkhuu merged 5 commits intomainfrom
dev

Conversation

@bybatkhuu
Copy link
Copy Markdown
Contributor

This pull request adds automated installation of Nerd Fonts for both Linux (Ubuntu/Debian) and macOS environments as part of the user and root setup scripts. The changes ensure that popular patched fonts are installed and available for improved terminal and development experience, with platform-specific handling and error checks.

Nerd Fonts installation automation:

  • Added a new script install-nerd-fonts.sh for Ubuntu/Debian systems that downloads and installs several Nerd Fonts (Ubuntu Mono, Ubuntu, Roboto Mono, Terminess) and updates the font cache, with checks for required commands and OS/distro compatibility.
  • Added a new script install-nerd-fonts.sh for macOS that installs the same set of Nerd Fonts using Homebrew, with OS and dependency checks.

Integration into setup workflows:

  • Updated the main Linux user setup script (setup-user.sh) to fetch and run the Nerd Fonts installation script for the current user.
  • Updated the main Linux root setup script (setup-ubuntu.sh) to fetch and run the Nerd Fonts installation script for the root user.
  • Updated the main macOS setup script (setup-macos.sh) to fetch and run the Nerd Fonts installation script, with a warning if installation fails (does not block the setup).

@bybatkhuu bybatkhuu self-assigned this Mar 16, 2026
@bybatkhuu bybatkhuu added the enhancement New feature or request label Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 07:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated Nerd Fonts installation to the Unix setup flows to improve terminal/editor glyph support during environment bootstrap.

Changes:

  • Invoke a new Nerd Fonts install step during macOS setup (non-fatal).
  • Invoke a new Nerd Fonts install step during Ubuntu setup for both the current user and root (currently fatal on failure).
  • Add OS-specific install-nerd-fonts.sh scripts for macOS (Homebrew) and Ubuntu/Debian (direct download + fc-cache).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/setup/unix/macos/setup-macos.sh Adds a Nerd Fonts install step to the macOS setup flow (warn/continue on failure).
src/setup/unix/macos/install-nerd-fonts.sh New macOS Nerd Fonts installer using Homebrew font casks.
src/setup/unix/linux/ubuntu/setup-ubuntu.sh Adds a Nerd Fonts install step for root during Ubuntu setup (currently exits on failure).
src/setup/unix/linux/ubuntu/install-nerd-fonts.sh New Ubuntu/Debian Nerd Fonts installer via GitHub downloads + font cache refresh.
src/setup/unix/linux/setup-user.sh Adds a Nerd Fonts install step during user setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +35
echo "[INFO]: Installing Nerd Fonts..."

echo "[INFO]: Installing Ubuntu Mono Nerd Font..."
brew install font-ubuntu-mono-nerd-font || {
echo "[WARN]: Failed to install 'Ubuntu Mono Nerd Font', skipping!" >&2
}
Comment on lines +254 to +257
_fetch "setup/unix/linux/ubuntu/install-nerd-fonts.sh" | bash || {
echo "[ERROR]: Failed to install Nerd Fonts for user '${USERNAME}'!" >&2
exit 2
}
Comment on lines +54 to +60
echo "[INFO]: Downloading Ubuntu Mono Nerd Font..."
rm -vf UbuntuMonoNerdFont-*.ttf || true
curl -fLO https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/UbuntuMono/Regular/UbuntuMonoNerdFont-Regular.ttf || exit 2
curl -fLO https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/UbuntuMono/Bold/UbuntuMonoNerdFont-Bold.ttf || exit 2
echo "[OK]: Done."

echo "[INFO]: Downloading Ubuntu Nerd Font..."
Comment on lines +33 to +38
for _cmd in curl fc-cache; do
if ! command -v "${_cmd}" >/dev/null 2>&1; then
echo "[ERROR]: Not found '${_cmd}' command, please install it first." >&2
exit 1
fi
done
Comment on lines +270 to +273
_fetch "setup/unix/linux/ubuntu/install-nerd-fonts.sh" | ${_SUDO} bash || {
echo "[ERROR]: Failed to install Nerd Fonts for root user!" >&2
exit 2
}
@bybatkhuu bybatkhuu merged commit b26a3f5 into main Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants