# Local Bin Scripts

This directory contains custom scripts that are installed to `~/.local/bin/` via Stow.

## Font Manager

Enhanced font management script with advanced features:

### Features
- **Archive Management**: Extract, list, and manage font archives
- **Backup System**: Automatic backups before cleaning
- **URL Installation**: Install fonts directly from URLs
- **Status Monitoring**: View current font status and logs
- **Error Handling**: Comprehensive error checking and logging
- **Color Output**: Colored terminal output for better UX

### Usage

```bash
# Basic commands
font-manager list              # List available fonts
font-manager extract <name>    # Extract specific font
font-manager all               # Extract all fonts
font-manager clean             # Clean active fonts (with backup)
font-manager status            # Show current status

# Advanced commands
font-manager backup            # List backups
font-manager restore <name>    # Restore from backup
font-manager install <url>    # Install from URL
```

### Zsh Integration

The following aliases and functions are available:

```bash
# Aliases
fm    # font-manager
fml   # font-manager list
fms   # font-manager status
fmc   # font-manager clean
fma   # font-manager all

# Functions
font-switch <name>    # Quick font switching
font-preview <name>  # Font preview
```

### Directory Structure

```
~/.local/share/fonts/
├── archives/     # Font archives (.tar.gz)
├── active/       # Extracted fonts
├── backups/      # Automatic backups
└── font-manager.log  # Operation log
```

### Examples

```bash
# Switch to JetBrains Mono
font-switch jetbrains-mono

# Install font from GitHub
font-manager install https://github.com/JetBrains/JetBrainsMono/releases/download/v2.304/JetBrainsMono-2.304.zip

# Preview a font
font-preview fira-code

# Check status
fms
```

### Installation

The script is automatically installed via Stow:

```bash
stow local-bin
```

This creates the necessary directory structure and installs the script to `~/.local/bin/font-manager`.
