UNPKG

devpulse

Version:

A powerful terminal-based focus timer with enhanced notifications

268 lines (189 loc) โ€ข 6.15 kB
# ๐Ÿง  DevPulse - Enhanced Terminal Focus Tracker A powerful, terminal-based focus timer with **multiple notification methods** to ensure you never miss when your session completes! ## โœจ Features ### ๐Ÿ”ฅ Core Functionality - **Focus sessions** - Pomodoro-style focused work periods - **Break timers** - Reminder for rest periods - **Session logging** - Track your daily and weekly progress - **Beautiful terminal UI** - Colorful, animated spinner with real-time countdown ### ๐Ÿšจ **Enhanced Notifications** (NEW!) When your timer completes, DevPulse uses **multiple notification methods** for maximum impact: 1. **๐Ÿ”Š System Audio Alerts** - Multiple sound methods (PulseAudio, ALSA, SoX, speaker-test) - Synthetic beep sounds as fallback - Optional voice announcements (espeak/festival) 2. **๐Ÿ–ฅ๏ธ Visual Notifications** - Colorful terminal flash alerts - Desktop notifications (node-notifier) - Full-screen browser popup with animations 3. **๐Ÿ“ฑ Browser Alarm Page** - Animated gradient background - Confetti effects - Multiple audio sources - Auto-closing popup 4. **โšก Terminal Features** - Multiple terminal bells - Vibrant colored alerts - ASCII celebration messages ## ๐Ÿš€ Installation ### **Global Installation (Recommended)** **Install from npm/Bun registry:** ```bash # Using Bun (recommended) bun add -g devpulse # Or using npm npm install -g devpulse ``` **Install from source:** ```bash git clone <repository-url> cd devpulse bun install bun link ``` ### **Local Development** ```bash git clone <repository-url> cd devpulse bun install ``` ## ๐Ÿ“– Usage ### **Global Commands (After Installation)** ```bash # Quick test (1 minute) devpulse focus 1 # Standard sessions devpulse focus 25 # 25-minute Pomodoro devpulse focus 45 # 45-minute extended focus devpulse break 5 # 5-minute break # Check your progress devpulse log # Today's sessions devpulse report # Weekly summary # Get help devpulse --help devpulse --version ``` ### **Local Development Commands** ```bash # Start a 25-minute focus session bun run src/index.ts focus # Start a custom focus session (e.g., 45 minutes) bun run src/index.ts focus 45 # Start a 5-minute break bun run src/index.ts break 5 # View today's sessions bun run src/index.ts log # Weekly summary bun run src/index.ts report ``` ### Testing Notifications ```bash # Test all notification methods bun run test-notifications.ts # Test just the sound alerts bun run test-sound # Quick timer test (6 seconds) bun run test-timer ``` ## ๐Ÿ› ๏ธ Requirements - **Bun runtime** (v1.2.14+) - **Linux desktop environment** (for full notification support) - **Audio system** (PulseAudio/ALSA recommended) - **Web browser** (for enhanced alarm popup) ## ๐Ÿ“ Project Structure ``` devpulse/ โ”œโ”€โ”€ src/index.ts # Main application โ”œโ”€โ”€ alerts/ โ”‚ โ”œโ”€โ”€ alarm.html # Enhanced browser notification โ”‚ โ””โ”€โ”€ play-sound.sh # Multi-method sound script โ”œโ”€โ”€ data/logs.json # Session history โ””โ”€โ”€ test-notifications.ts # Notification test suite ``` ## ๐ŸŽจ Notification Customization The notification system is designed to work across different Linux environments: - **Desktop environments**: Full visual + audio notifications - **Server/headless**: Terminal + audio notifications - **Minimal systems**: Terminal bells + text alerts ## ๐Ÿ”ง Troubleshooting **No sound?** - Check audio system: `speaker-test -t sine -f 800 -l 1` - Install audio tools: `sudo apt install alsa-utils pulseaudio-utils sox` **No desktop notifications?** - Install notification daemon: `sudo apt install notification-daemon` **Browser popup not opening?** - Ensure you have a web browser installed - Check if `xdg-open` works: `xdg-open https://google.com` ## ๐ŸŽฏ **โœ… SIMPLE COMMANDS** ### **๐Ÿš€ Global Commands (After `bun add -g devpulse`):** ```bash # Quick test (1 minute) devpulse focus 1 # Standard sessions devpulse focus 25 # 25-minute Pomodoro focus devpulse focus 45 # 45-minute extended focus devpulse break 5 # 5-minute break # Default sessions devpulse focus # 25-minute focus (default) devpulse break # 25-minute break (default) # Check progress devpulse log # Today's sessions devpulse report # Weekly summary # Help & info devpulse --help devpulse --version ``` ### **๐Ÿš€ Local Development Commands:** ```bash # Quick test (1 minute) bun focus1 # Standard sessions bun focus25 # 25-minute Pomodoro focus bun focus45 # 45-minute extended focus bun break5 # 5-minute break # Default sessions bun focus # 25-minute focus (default) bun break # 25-minute break (default) ``` ### **๐Ÿ“Š Check Your Progress:** ```bash # Global install devpulse log # Today's sessions devpulse report # Weekly summary # Local development bun devlog # Today's sessions bun devreport # Weekly summary ``` ### **๐Ÿงช Quick Testing:** ```bash # Global install devpulse focus 0.1 # 6-second test # Local development bun test # Test all notifications bun test-sound # Test sound alerts only ``` ### **๐Ÿ“ฑ What You Get When Timer Completes:** - ๐ŸŽจ **Colorful terminal alerts** - ๐Ÿ”” **8 terminal bells** (extra loud!) - ๐Ÿ”Š **System beep sound** (1000Hz tone) - ๐Ÿ“ฑ **Desktop notification** (if available) - ๐ŸŒ **Browser alarm popup** (if display available) - โœจ **Celebration messages** ### **๐ŸŽฏ Quick Start:** ```bash # Install globally first bun add -g devpulse # Try this first to test all notifications: devpulse focus 1 ``` ### **๐Ÿ’ก Alternative Commands:** ```bash # If you prefer longer commands or local development: bun run src/index.ts focus 1 # 1-minute test bun run src/index.ts focus 25 # 25-minute focus bun run src/index.ts break 5 # 5-minute break bun run src/index.ts log # Today's sessions bun run src/index.ts report # Weekly summary ``` --- Built with โค๏ธ using [Bun](https://bun.sh) - the fast all-in-one JavaScript runtime.