A sophisticated TUI (Terminal User Interface) for managing print queues on macOS, built with Go and Bubble Tea.
- Real-time monitoring of system print queue with automatic refresh
- Batch operations for canceling multiple jobs
- Job details including file names, sizes, and status
- Quick actions to open files or their containing folders
- Dual-pane interface with keyboard-driven navigation
- Smart file detection automatically identifies printable formats (PDF, DOC, images)
- Glob pattern matching for filtering files (e.g.,
*.pdf,report-*.doc) - Directory navigation with arrow keys or vim bindings
- Batch selection with toggle-all functionality for printable files
- Visual indicators distinguish directories 📁, printable files 📄, and regular files
- Adaptive layout that scales to terminal size
- Focus indicators with colored borders showing active pane
- Scroll support for long file lists with position indicators
- Path display showing current directory in file browser
- XDG-compliant data storage respecting system standards
# Clone and build
git clone https://github.com/adriangalilea/printer.git
cd printer
make install # Installs to ~/.local/binEnsure ~/.local/bin is in your PATH.
# Open queue manager
printer
# Start in file picker with pattern
printer add ~/Documents/*.pdf
printer add "~/reports/2024-*.pdf"| Key | Action |
|---|---|
a |
Add files (opens file browser) |
o |
Open selected file |
O |
Open file's folder |
x |
Cancel selected job |
X |
Cancel all marked jobs |
Space |
Mark/unmark job |
r |
Refresh queue |
q |
Quit |
| Key | Action |
|---|---|
Tab |
Switch between input field and file list |
↑/k |
Navigate up (moves to input when at top) |
↓/j |
Navigate down (moves to files from input) |
←/h/Backspace |
Go to parent directory |
→/l |
Enter directory |
Space |
Mark/unmark file (or toggle all) |
Enter |
Add marked files / enter directory |
Esc |
Return to queue |
The input field supports glob patterns:
*.pdf- All PDFs in current directoryreport-*.doc- All docs starting with "report-"**/*.pdf- All PDFs recursively (if supported)
- main.go - TUI application logic with Bubble Tea framework
- system.go - System integration for print queue operations
- tracker.go - Persistent job tracking with XDG-compliant storage
Print job metadata is stored in $XDG_DATA_HOME/printer/jobs.json (defaults to ~/.local/share/printer/) to maintain file path associations and enable file/folder opening features.
Automatically detected as printable:
- Documents:
.pdf,.txt,.doc,.docx - Images:
.jpg,.jpeg,.png,.gif
- macOS (uses
lpr,lpstat,cancelcommands) - Go 1.19+ for building
- CUPS printing system (standard on macOS)
# Build
make build
# Run without installing
make run
# Clean build artifacts
make clean- Bubble Tea - Terminal UI framework
- Lip Gloss - Style definitions for terminal layouts
- Bubbles - TUI component library
MIT
Adrian Galilea (@adriangalilea)