diff --git a/bashscript.sh b/bashscript.sh index 8a5a8db..2d483ce 100644 --- a/bashscript.sh +++ b/bashscript.sh @@ -1,4 +1,14 @@ #!/usr/bin/env bash + +# NOTE: +# This prompt uses Nerd Font (Powerline glyphs). +# Recommended font: JetBrainsMono Nerd Font +# +# If separators like    look broken: +# 1) Run ./install-nerdfont.sh +# 2) Select "JetBrainsMono Nerd Font" in your terminal + + set -euo pipefail # Must be root diff --git a/install-nerdfont.sh b/install-nerdfont.sh new file mode 100755 index 0000000..bacc47c --- /dev/null +++ b/install-nerdfont.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -e + +FONT_NAME="JetBrainsMono Nerd Font" +FONT_DIR="$HOME/.local/share/fonts" +FONT_TEST="JetBrainsMonoNerdFont-Regular.ttf" + +echo "🔎 Sjekker Nerd Font..." + +if fc-list | grep -qi "JetBrainsMono Nerd Font"; then + echo "✅ Nerd Font allerede installert." + exit 0 +fi + +echo "⬇️ Laster ned JetBrainsMono Nerd Font..." + +mkdir -p "$FONT_DIR" +cd "$FONT_DIR" + +TMP_ZIP="$(mktemp --suffix=.zip)" + +curl -fsSL \ + https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip \ + -o "$TMP_ZIP" + +echo "📦 Pakker ut fonter..." +unzip -o "$TMP_ZIP" >/dev/null +rm -f "$TMP_ZIP" + +echo "🔄 Oppdaterer font cache..." +fc-cache -f >/dev/null + +echo "🎉 Ferdig!" +echo +echo "⚠️ Viktig:" +echo " Du må nå velge «JetBrainsMono Nerd Font» i terminalen din." +echo " (Terminal → Preferences → Font)"