Nerd Font Installer Script

    0

    0

    This code prints the list of fonts and their locations. The first line declares a variable fonts containing an array of font files. The second line iterates over this array and prints the name and location of each font file. The third line deletes any fonts found in the fonts_dir variable that are marked as "Windows Compatible.

    #!/bin/bash
    
    declare -a fonts=(
      BitstreamVeraSansMono
      CodeNewRoman
      DroidSansMono
      FiraCode
      FiraMono
      Go-Mono
      Hack
      Hermit
      JetBrainsMono
      Meslo
      Noto
      Overpass
      ProggyClean
      RobotoMono
      SourceCodePro
      SpaceMono
      Ubuntu
      UbuntuMono
    )
    
    version='2.1.0'
    fonts_dir="${HOME}/.local/share/fonts"
    
    if [[ ! -d "$fonts_dir" ]]; then
      mkdir -p "$fonts_dir"
    fi
    
    for font in "${fonts[@]}"; do
      zip_file="${font}.zip"
      download_url="https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}"
      echo "Downloading $download_url"
      wget "$download_url"
      unzip "$zip_file" -d "$fonts_dir"
      rm "$zip_file"
    done
    
    find "$fonts_dir" -name '*Windows Compatible*' -delete
    
    fc-cache -fv
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.