samschott / desktop-notifier

Python library for cross-platform desktop notifications
https://desktop-notifier.readthedocs.io
MIT License
81 stars 8 forks source link

Allow user to choose a system sound on macOS #135

Closed michelcrypt4d4mus closed 2 weeks ago

michelcrypt4d4mus commented 3 weeks ago

Allow the user to specify by name one of the sounds that live in /System/Library/Sounds on macOS.

Theoretically according to the documentation this would also allow the user to pick their own custom sound by name as long as they had packaged their python into a signed and sandboxed macOS app but I haven't tested that functionality. System sounds work great though.

Feel free to close this PR if it's not a feature you want. Also happy to make any requested changes as far code or documentation or whatever.


These are the sounds available on macOS as of late. I'm pretty sure they've all been around for a decade or more at this point:

$ ls -l /System/Library/Sounds/

Basso.aiff
Blow.aiff
Bottle.aiff
Frog.aiff
Funk.aiff
Glass.aiff
Hero.aiff
Morse.aiff
Ping.aiff
Pop.aiff
Purr.aiff
Sosumi.aiff
Submarine.aiff
Tink.aiff

Frog.aiff is a personal favorite.

codecov-commenter commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.

Project coverage is 70.80%. Comparing base (32752cb) to head (459ae27). Report is 8 commits behind head on main.

Files Patch % Lines
src/desktop_notifier/base.py 66.66% 2 Missing :warning:
src/desktop_notifier/main.py 50.00% 2 Missing :warning:
src/desktop_notifier/macos.py 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #135 +/- ## ========================================== - Coverage 71.23% 70.80% -0.44% ========================================== Files 8 8 Lines 657 661 +4 ========================================== Hits 468 468 - Misses 189 193 +4 ``` | [Flag](https://app.codecov.io/gh/samschott/desktop-notifier/pull/135/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SamSchott) | Coverage Δ | | |---|---|---| | [pytest](https://app.codecov.io/gh/samschott/desktop-notifier/pull/135/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SamSchott) | `70.80% <72.22%> (-0.44%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SamSchott#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

michelcrypt4d4mus commented 3 weeks ago

Did my best to make the changes as you requested. Let me know if I got it right; happy to change again.