Starship
The minimal, blazing-fast, and infinitely customizable prompt for any shell!
Requirementsβ
- Starship - Quick install
- Starship - Configuration
- NerdFonts (recommendation:
JetBrainsMono)
Install fonts on Ubuntuβ
-
Download and Install:
Script to download, install, and activate JetBrains Mono Nerd Font on Ubuntu
#!/usr/bin/env bash
set -e
FONT_NAME="JetBrainsMono"
FONT_URL="https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/JetBrainsMono.zip"
INSTALL_DIR="$HOME/.local/share/fonts/$FONT_NAME-Nerd"
echo "Starting installation of $FONT_NAME Nerd Font..."
# Create installation directory
mkdir -p "$INSTALL_DIR"
# Download the zip file
TEMP_ZIP="$(mktemp /tmp/JetBrainsMono.XXXXXX.zip)"
echo "Downloading $FONT_NAME Nerd Font..."
curl -L -o "$TEMP_ZIP" "$FONT_URL"
# Unzip font files into the installation directory
echo "Extracting font files..."
unzip -o "$TEMP_ZIP" -d "$INSTALL_DIR"
# Remove temporary zip
rm "$TEMP_ZIP"
# Refresh font cache
echo "Refreshing font cache..."
fc-cache -fv
# Verify installation
echo "Installed fonts:"
fc-list | grep "JetBrainsMono"
echo "Installation complete!"
echo "You can now set 'JetBrainsMono Nerd Font' in your terminal preferences (GNOME Terminal, Alacritty, Kitty, etc.)" -
Set Font in Terminal:
Once installed, configure your terminal to use the font.
- GNOME Terminal:
Preferences β Profile β Text β Custom font β JetBrainsMono Nerd Font
- GNOME Terminal:
-
Test Nerd Font Icons:
To check if the Nerd Font icons are working, run:
echo "ξ° ξ ξ ο‘ ο"- If the icons display correctly (not as boxes or question marks), your font is installed and working.
-
Notes:
- The installation is per-user by default. To install system-wide, copy fonts to
/usr/local/share/fonts/. - The font works well with
Oh My Zsh,Starship,Powerlevel10k, and modern code editors (VS Code).
- The installation is per-user by default. To install system-wide, copy fonts to
Install fonts on Windowsβ
- Download the Font
- Extract the
.zipfile. - Right-click on all
.ttffiles β Install (or Install for all users). - Configure Your Terminal
-
Windows Terminal (WSL profile):
- Open WSL -> Right click on WSL window -> Properties -> Font
- Set Font to
JetBrainsMono - Click
OK
-
VS Code + WSL:
"editor.fontFamily": "JetBrainsMono Nerd Font",
"terminal.integrated.fontFamily": "JetBrainsMono Nerd Font",
-
Custom configurationβ
~/.config/starship.toml
# ~/.config/starship.toml
# General prompt settings
add_newline = false
format = """
$username\
$hostname\
$time\
$python\
$directory\
$kubernetes\
$git_branch\
$git_state\
$git_status\
$cmd_duration\
$line_break\
$character"""
# Prompt symbols
[character]
success_symbol = "[β](bold green)"
error_symbol = "[β](bold red)"
# Hostname module
[hostname]
ssh_only = false
format = '@[$hostname]($style): '
style = 'red'
disabled = false
# User module
[username]
style_user = 'green'
style_root = 'black'
format = 'σ±© [$user]($style)'
disabled = false
show_always = true
# Time module
[time]
disabled = true
format = "[$time]($style) "
style = "dimmed white"
time_format = "%T"
# Directory module
[directory]
style = "blue"
truncation_length = 3
truncation_symbol = 'β¦/'
truncate_to_repo = true
# Git branch module
[git_branch]
format = '[$symbol$branch(:$remote_branch)]($style) '
symbol = "ξ "
style = "purple bold"
# Git status module
[git_status]
staged = "[+](green)"
untracked = "[?](blue)"
modified = "[*](yellow)"
conflicted = "[=](red)"
ahead = "β‘(red)"
behind = "[β£](red)"
style = 'blue'
# Git state module
[git_state]
style = 'yellow'
disabled = false
# Kubernetes module
[kubernetes]
format = '\([$symbol$context(::$namespace)]($style)\) '
symbol = 'ξ '
detect_files = ['helmfile.yaml']
disabled = false
# Python module
[python]
disabled = false
format = '[(${version} )(\($virtualenv\) )]($style)'
style = "yellow"
pyenv_version_name = true
# Command duration
[cmd_duration]
min_time = 500
format = "σ°
[$duration]($style) "
style = "yellow"