#!/bin/bash # Quick Font Installation Script for Tmux # Installs powerline fonts for better tmux appearance echo "๐ŸŽจ Tmux Font Installer" echo "=====================" echo "" # Check if running in WSL or native Linux if grep -qi microsoft /proc/version; then echo "โ„น๏ธ Detected WSL environment" echo "โš ๏ธ Note: You'll also need to configure your Windows Terminal font" echo "" fi # Function to install powerline fonts install_powerline() { echo "๐Ÿ“ฆ Installing Powerline Fonts..." if command -v apt-get &> /dev/null; then # Debian/Ubuntu sudo apt-get update sudo apt-get install -y fonts-powerline echo "โœ… Powerline fonts installed via apt" elif command -v pacman &> /dev/null; then # Arch Linux sudo pacman -S --noconfirm powerline-fonts echo "โœ… Powerline fonts installed via pacman" elif command -v dnf &> /dev/null; then # Fedora sudo dnf install -y powerline-fonts echo "โœ… Powerline fonts installed via dnf" else # Install from source echo "๐Ÿ“ฅ Installing from source..." git clone https://github.com/powerline/fonts.git --depth=1 cd fonts ./install.sh cd .. rm -rf fonts echo "โœ… Powerline fonts installed from source" fi } # Function to install nerd fonts install_nerd_fonts() { echo "" echo "๐Ÿ“ฆ Installing Nerd Fonts (FiraCode)..." # Create fonts directory mkdir -p ~/.local/share/fonts # Download FiraCode Nerd Font cd ~/.local/share/fonts if command -v wget &> /dev/null; then wget -q --show-progress https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip elif command -v curl &> /dev/null; then curl -L -o FiraCode.zip https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip else echo "โŒ Neither wget nor curl found. Please install one and try again." return 1 fi # Extract if command -v unzip &> /dev/null; then unzip -q FiraCode.zip rm FiraCode.zip echo "โœ… FiraCode Nerd Font installed" else echo "โŒ unzip not found. Please install unzip and try again." return 1 fi cd - > /dev/null } # Function to refresh font cache refresh_fonts() { echo "" echo "๐Ÿ”„ Refreshing font cache..." fc-cache -fv > /dev/null 2>&1 echo "โœ… Font cache refreshed" } # Function to test fonts test_fonts() { echo "" echo "๐Ÿงช Testing font symbols..." echo "" echo "Powerline arrows: " echo "Icons: โ " echo "" echo "If you see boxes or question marks, the fonts aren't working." echo "Make sure your terminal is configured to use a Nerd Font." } # Main installation echo "Choose installation option:" echo "1) Powerline Fonts Only (lightweight, ~5MB)" echo "2) Nerd Fonts (FiraCode) (complete, ~50MB)" echo "3) Both (recommended)" echo "" read -p "Enter choice [1-3]: " choice case $choice in 1) install_powerline ;; 2) install_nerd_fonts ;; 3) install_powerline install_nerd_fonts ;; *) echo "โŒ Invalid choice" exit 1 ;; esac refresh_fonts test_fonts echo "" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo "โœ… Font installation complete!" echo "" echo "๐Ÿ“‹ Next steps:" echo "" echo "1. Configure your terminal to use 'FiraCode Nerd Font Mono'" echo "" echo " Windows Terminal (WSL):" echo " - Open Settings (Ctrl+,)" echo " - Select your WSL profile" echo " - Appearance โ†’ Font face โ†’ FiraCode Nerd Font Mono" echo "" echo " Gnome Terminal:" echo " - Preferences โ†’ Profile โ†’ Text โ†’ Custom font" echo " - Select 'FiraCode Nerd Font Mono'" echo "" echo "2. Reload tmux configuration:" echo " tmux source-file ~/.tmux.conf" echo "" echo "3. Or restart tmux:" echo " php artisan tmux:stop --force" echo " php artisan tmux:start" echo "" echo "๐Ÿ“– Full guide: TMUX_FONTS_GUIDE.md" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”"