-
Notifications
You must be signed in to change notification settings - Fork 8
Add Linux support with mpg123 for MP3 playback #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ubuntupunk
wants to merge
7
commits into
pinkpixel-dev:main
Choose a base branch
from
ubuntupunk:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Implement aplay command in src/index.ts for Linux platform detection - Update CHANGELOG.md with Linux support in cross-platform audio playback - Modify README.md and OVERVIEW.md to include Linux in platform support badges/docs - Maintain bundled sound assets and NPX compatibility for consistent cross-platform behavior This adds native Linux audio playback using aplay while keeping existing Windows (start) and macOS (afplay) implementations, and updates all documentation to reflect the expanded platform support.
- Replace aplay with mpg123 in Linux platform handling for MP3 compatibility - Add random sound selection via MCP_NOTIFICATION_SOUND=random environment variable - Bundle MP3 sound assets in npm package for cross-platform out-of-the-box use - Enable NPX compatibility with bundled sounds - Add MIT license to package-lock.json - Bump version to 0.1.2 This change ensures Linux users can play bundled MP3 notifications using mpg123, which supports MP3 natively unlike aplay. The random sound option enhances user experience by providing variability in notifications.
|
If you would like me to review this PR, either tag me in a comment or check this box:
You can disable automatic comments on my settings page |
- Add visual desktop notifications via notify-send (Linux), osascript (macOS), PowerShell (Windows) - Enhance play_notification tool with show_visual, title, and audio_only parameters - Maintain backward compatibility with existing audio-only functionality - Support visual-only notifications for headless environments - Update documentation with new parameters and cross-platform support
- Detect Qubes OS environment via /proc/xen and qrexec tools - Implement fallback notification chain: qrexec -> notify-send -> log file - Add multiple audio methods for Qubes: paplay -> mpg123 -> ffplay - Handle headless/restricted environments gracefully - Add audio_only parameter for visual-only notifications
- Add comprehensive styling parameters: urgency, timeout, icon - Implement Qubes OS detection and multiple fallback mechanisms - Enhanced notify-send with urgency levels, custom timeouts, and icons - Graceful error handling for headless and restricted environments - Multiple audio player fallbacks for Qubes (paplay, mpg123, ffplay, aplay) - Improved logging and console output for debugging - Update documentation with new styling capabilities
- Replace nested try-catch with clean fallback array pattern for audio - Add graceful error handling for visual notifications - Implement Qubes-aware error handling (log but don't fail) - Enhanced response messaging with urgency levels and Qubes detection - Ensure notifications work even when individual methods fail - Maintain user experience with informative success messages
Introduce modular templates for backup, build, deploy, error, info, success, test, and warning notifications. Each template defines default title, message, urgency, timeout, icon, and sound. Update `src/index.ts` to import and apply these templates, adding a `template` parameter with enum support to the notification request handler. This enables consistent, reusable notification configurations with action-specific audio/visual cues.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🐧 Add Linux Support
Changes
statement for better maintainability and extensibility
mpg123 -qcommand for Linux systems(specifically designed for MP3 files)
platforms
to reflect Linux support
Technical Details
startcommand (built-in)afplaycommand (built-in)mpg123 -qcommand (requiressudo apt-get install mpg123)Why mpg123 instead of aplay?
aplayis designed for WAV/raw audio files, not MP3mpg123is specifically built for MP3 playbook-qflag provides clean, quiet operationPlatform Support Matrix
Fixes the issue where Linux users would get
afplaycommand not found errors.Testing
Tested platform detection logic and MP3 playback functionality. Linux user will need to install mpg123:
Commits included:
46085c3- Switch Linux to mpg123 for MP3 support and add random sound option8c32379- Add Linux support via aplay and update documentation