Print Queue Manager
A simple command-line tool to store things you want to print when you're away from your home network, then print them all at once when you're back.
Features
- Store file paths and URLs in a print queue
- Watch folder: Drop files into
~/to-printand they'll be printed automatically - Print all pending items with a single command
- Track what's been printed and what's still pending
- Works with your default macOS printer
Requirements
- Python 3.6+
- macOS (uses
lpcommand for printing) curl(for downloading URLs)
Usage
Two ways to queue items
Method 1: Manually add items to the queue
Add a local file:
./print_queue.py add /path/to/document.pdf
./print_queue.py add ~/Downloads/invoice.pdf --name "Monthly Invoice"
Add a URL:
./print_queue.py add https://example.com/article.html
./print_queue.py add https://example.com/page.html --name "Important Article"
Method 2: Use the watch folder (simpler!)
Just drop files into ~/to-print:
cp ~/Downloads/document.pdf ~/to-print/
mv ~/Desktop/receipt.pdf ~/to-print/
The watch folder accepts: PDF, TXT, JPG, PNG, GIF, DOC, DOCX, HTML, and PS files.
List items in the queue
Show pending items:
./print_queue.py list
Show all items (including already printed):
./print_queue.py list --all
Print all pending items
Print everything in the queue:
./print_queue.py print
Preview what would be printed (dry run):
./print_queue.py print --dry-run
Remove items from queue
Remove a specific item by ID:
./print_queue.py remove 3
Clear all printed items from the queue:
./print_queue.py clear
How it works
Manual queue:
- When you're away from your home network, use
addto store items in the queue - The queue is stored in
queue.jsonin this directory - When you're back on your home network, run
printto print everything - Items are marked as printed but stay in the queue
- Use
clearto remove printed items when you're done
Watch folder:
- Drop any files into
~/to-printwhenever you want - When you run
print, all files in the folder are printed - After printing, files are moved to
~/to-print/printed/to avoid reprinting - You can delete or keep the printed files - they won't be reprinted
Examples
Using the watch folder (easiest):
# Away from home - just drop files in the folder
cp ~/Downloads/receipt.pdf ~/to-print/
cp ~/Desktop/ticket.pdf ~/to-print/
# Back home - check what's ready
./print_queue.py list
# Print everything
./print_queue.py print
Using manual queue (for URLs or tracking):
# Away from home - add items to queue
./print_queue.py add ~/Downloads/receipt.pdf
./print_queue.py add https://github.com/user/repo/blob/main/README.md --name "GitHub README"
# Back home - check what's queued
./print_queue.py list
# Print everything
./print_queue.py print
# Later, clean up printed items
./print_queue.py clear
Mix both methods:
# Add URLs to queue
./print_queue.py add https://example.com/article.html
# Drop files in folder
cp ~/Downloads/*.pdf ~/to-print/
# Print everything at once (queue + folder)
./print_queue.py print
Tips
- Watch folder is the easiest: Just drop files into
~/to-print- no commands needed until you're ready to print - File paths are converted to absolute paths, so they'll work even if you change directories
- URLs are downloaded and sent directly to the printer
- For better web page printing, consider saving the page as PDF first, then dropping it in the watch folder
- Use
--nameto give items friendly names instead of long file paths or URLs - Printed files from the folder are moved to
~/to-print/printed/- check there if you need to reprint something
Troubleshooting
"File not found" error: Make sure the file path is correct and the file exists
Printing fails:
- Check that your printer is set up and
lpstat -p -dshows your default printer - Make sure you're connected to the network where your printer is available
- For URLs, ensure you have internet connectivity
Permission denied: Make sure the script is executable with chmod +x print_queue.py