Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Fix sound setting ignored in send_macos_notification#25

Merged
mylee04 merged 1 commit intomylee04:mainfrom
daturkel:fix/sound-setting-ignored
Mar 5, 2026
Merged

Fix sound setting ignored in send_macos_notification#25
mylee04 merged 1 commit intomylee04:mainfrom
daturkel:fix/sound-setting-ignored

Conversation

@daturkel
Copy link
Contributor

@daturkel daturkel commented Mar 4, 2026

Problem

cn sound off has no effect on macOS. The send_macos_notification function always passes -sound "$SOUND" to terminal-notifier, which unconditionally plays a sound. The existing should_play_sound check only gated a separate play_sound call, not the sound embedded in the notification itself.

The same issue exists in the osascript fallback path.

Fix

Gate the -sound argument on should_play_sound() for both terminal-notifier and osascript paths, matching the pattern already used for the standalone play_sound call.

Testing

  • cn sound off then trigger a notification → silent ✅
  • cn sound on then trigger a notification → plays sound ✅

terminal-notifier always plays a sound when -sound is passed, so cn sound off had no effect. Gate the -sound arg on should_play_sound, same as the existing play_sound call. Apply the same fix to the osascript fallback path.
@mylee04 mylee04 merged commit 13f85d8 into mylee04:main Mar 5, 2026
2 checks passed
@mylee04 mylee04 self-requested a review March 5, 2026 15:19
@mylee04
Copy link
Owner

mylee04 commented Mar 5, 2026

@daturkel thank you so much, your finding and change will be really helpful for other users!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants