Menu ▾ ▴

#451 feat(notifications): choose the notification sound from the OS's own sounds or a file

closed
nobody
None
6 days ago
6 days ago
Anonymous
No

Originally created by: kristofferR

The notification sound was on or off only. People want to choose it, and every OS already ships notification sounds they know from other apps. On Omarchy-style Linux setups the daemon also ignored Carrier's sound hint, so there was no sound at all.

What changed

  • Settings: the switch becomes a picker with Off, System default, the OS's own sounds, sounds you've added, and "Choose file…", plus a Preview button. The list is read fresh each time Settings opens.
  • notification_sound_choice stores the choice by platform and name. The old notification_sound boolean stays in sync (off only when the choice is Off), so the page and older builds keep working. Old settings migrate: true → System default, false → Off. A sound that has disappeared, or was chosen on another platform, plays the default.
  • New src-tauri/src/sound.rs lists sounds, imports chosen files, resolves the choice and plays files where the OS can't. A stored name only matches a sound Carrier listed, so a setting never points at an arbitrary path, and nothing from the page chooses a sound.
  • macOS: sounds from ~/Library/Sounds and /System/Library/Sounds, delivered with UNNotificationSound.soundNamed. Choose file… copies an AIFF, CAF or WAV into ~/Library/Sounds, so Focus still governs it. Preview uses NSSound.
  • Windows: the built-in toast sounds (Instant message, Mail, Reminder, Text message). A chosen WAV means a silent toast with Carrier playing the file itself, only while Windows allows Carrier's notifications.
  • Linux: message sounds the active freedesktop sound theme actually has. When the notification server advertises sound, it gets the sound-name/sound-file hint; otherwise Carrier sends suppress-sound and plays the file through GStreamer. Chosen files can be WAV, OGG or OGA.
  • Snap: System default and Off are unchanged; other sounds need notification portal v2 to silence the desktop's own sound.
  • Chosen files are copied into Carrier's folders (never stored as a path) and created exclusively, so adding a sound never overwrites another one.
  • Unchanged rules: the page's silent flag can only take sound away, and Mute, Pause, calls and Messenger's Do Not Disturb stop a notification before any sound is chosen.

Known limits

  • Where Carrier plays the sound itself, a notification daemon's own Do Not Disturb (or Windows Focus Assist with a chosen file) can hide the banner while the sound still plays.
  • macOS plays only notification sounds under 30 seconds; a longer chosen file falls back to the default sound there.

Testing

  • cargo fmt, clippy -D warnings (Linux, and cross-checked for macOS and Windows), cargo test --lib and bun run check pass. Unit tests cover migration and round trip, the unreadable-value fallback, silent only taking sound away, sound listing and filtering, import never overwriting (including a dangling link), Windows sound names, theme inheritance and path safety, and when Linux leaves the sound to the server.
  • Not yet heard on real hardware: notification sounds and Preview on macOS, Windows and Linux, and a Linux server that plays sound hints (GNOME or KDE).

Ref [#363]
Ref [#446]

Related

Tickets: #363
Tickets: #446

Discussion

  • Anonymous

    Anonymous - 6 days ago

    Originally posted by: chatgpt-codex-connector[bot]

    Codex Review Summary: ✅ Completed This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-08T21:44:21.689802Z">2026-11-08T21:44:21.689802Z</relative-time> | `c2afdc8` | Manual request |
    ℹ️ About Codex in GitHub
    [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
     
  • Anonymous

    Anonymous - 6 days ago

    Originally posted by: chatgpt-codex-connector[bot]

    Codex Review: Didn't find any major issues. More of your lovely PRs please.

    Reviewed commit: 3696627537

    ℹ️ About Codex in GitHub
    [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
     
  • Anonymous

    Anonymous - 6 days ago

    Originally posted by: kristofferR

    @codex review for consequential defects introduced by this PR; do not expand its original scope with unrelated refactors, features, or speculative hardening

     
  • Anonymous

    Anonymous - 6 days ago

    Ticket changed by: kristofferR

    • status: open --> closed
     
  • Anonymous

    Anonymous - 6 days ago

    Originally posted by: chatgpt-codex-connector[bot]

    Codex Review: Didn't find any major issues. Breezy!

    Reviewed commit: c2afdc8212

    ℹ️ About Codex in GitHub
    [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
     

Log in to post a comment.