A macOS menubar application that monitors your Downloads, Desktop, and iCloud reading directories for PDF and EPUB files, displaying the 15 most recently modified files in a convenient dropdown menu for quick access.
- Real-time monitoring - Uses FSEvents to detect new files as they're added
- Smart filtering - Only shows PDF and EPUB files
- Recent files priority - Displays the 15 most recently modified files across all monitored directories
- One-click opening - Click any file in the menu to open it with the default application
- ChatGPT integration - Hold Option (⌥) and click any PDF or EPUB to send it to ChatGPT for analysis
- Lightweight - Runs efficiently in the background as a menubar-only app
- Multi-directory support - Monitors three key locations:
~/Downloads
~/Desktop
~/Library/Mobile Documents/com~apple~CloudDocs/reading
- Smart date sorting - Uses last accessed times for reading directory, last modified times for Downloads/Desktop
# Clone the repository
git clone <repository-url>
cd readbar
# Run the application
swift readbar.swift
To see detailed logging information, run with the debug flag:
swift readbar.swift --debug
- Menubar Icon - Look for the document icon in your menubar
- Click the Icon - Opens a dropdown showing your 15 most recent PDF/EPUB files
- Select a File - Click any file to open it with the default application
- Send to ChatGPT - Hold Option (⌥) and click any PDF or EPUB to send it to ChatGPT for analysis
- Quit - Use the "Quit" option in the menu to exit
Readbar includes seamless integration with the ChatGPT native app:
- Option + Click on any PDF or EPUB file
- Automatically opens ChatGPT and creates a new chat
- Uploads the selected file for analysis
- Works with files containing spaces and special characters
- Provides fallback options if the primary method fails
Readbar automatically scans these directories for PDF and EPUB files:
- Downloads - Perfect for recently downloaded documents
- Desktop - For files you're actively working with
- iCloud Reading Folder - For your organized reading collection at
~/Library/Mobile Documents/com~apple~CloudDocs/reading
- macOS 10.15+ (Catalina or later)
- Swift 5.0+
- Xcode Command Line Tools (for Swift compilation)
- ChatGPT native app (for ChatGPT integration feature)
- Uses Apple's FSEvents API for efficient real-time file system monitoring
- Automatically detects file creation, modification, and deletion
- Safe handling of concurrent file operations
- Respects system file access permissions
- Scans up to 200 files per directory to balance completeness with performance
- Background scanning to avoid blocking the UI
- Efficient memory usage with automatic cleanup of deleted files
- Native macOS integration for optimal responsiveness
# Clone the repository
git clone <repository-url>
cd readbar
# Run locally for testing
swift readbar.swift
# Run with debug output
swift readbar.swift --debug
readbar.swift
- Main application source codeREADME.md
- This documentation
The application consists of four main components:
- FileMonitor - Handles FSEvents monitoring and file system events
- Readbar - Manages the list of recent files and metadata
- MenuManager - Creates and updates the menubar dropdown interface
- AppDelegate - Coordinates the application lifecycle and initialization
App doesn't appear in menubar
- Check if the app is running:
ps aux | grep readbar
- Try running from terminal to see error messages
Files not appearing
- Verify the monitored directories exist and are accessible
- Check file permissions on the directories
- Ensure files have
.pdf
or.epub
extensions
App crashes when clicking files
- Verify files exist and haven't been moved/deleted
- Check that default applications are properly configured for PDF/EPUB files
Readbar includes comprehensive logging. When running with --debug
, you'll see detailed information about:
- File scanning progress
- Menu updates
- File opening attempts
- FSEvents callback activity
MIT License - See LICENSE file for details
Contributions welcome! Please feel free to submit issues, feature requests, or pull requests.
- Added ChatGPT integration
- Option + Click to send PDF/EPUB files to ChatGPT for analysis
- Automatic ChatGPT app activation and new chat creation
- Support for files with spaces and special characters
- Fallback mechanisms for robust operation
- Initial release
- Real-time file monitoring with FSEvents
- Support for PDF and EPUB files
- Menubar interface with 15 recent files
- Multi-directory monitoring
- One-click file opening
- Smart date sorting (accessed times for reading directory, modified times for others)
- Debug mode support