bacon
bacon copied to clipboard
Custom sounds
Currently, we have some sounds hand picked by the authors baked into the compiled executable. It works, but has shortcomings. In Debian particularly, the included sound resources have too many copyright holders: even though they are OK license wise with CC0, we can't reliably attribute each to their respective author(s). I'll have to exclude them, and disable the sound feature for now. Allowing custom sounds won't solve the attribution problem, but does enable the feature.
Currently sounds are referred to by names, e.g. on_success = "play-sound(name=90s-game-ui-6,volume=50)". Presumably we can also refer by paths, e.g. play-sound(path=~/Audio/my-awesome-notification.mp3,volume=42).
We could also allow naming custom sounds, something like this:
# prefs.toml
[sound.collection]
my-awesome-notification = '~/Audio/my-awesome-notification.mp3'
# bacon.toml
[jobs.check]
on_success = 'play-sound(my-awesome-notification,volume=42)'
No objection. If somebody's willing to work on the implementation, they're welcome.
I'll try to throw something together this weekend :>
Submitted a PR. In implementing it, though, I realized bacon.toml is often/sometimes committed to version control. It then poses a problem: if Alice configures a custom sound, then commits the bacon.toml, Bob won't be able to use it. There are various ways to work around that. But ultimately, should that be our concern?
Personally, in most of my projects I've decided it's not a problem and for project where other people need to use it and might run into an issue I copy over any setting that need to be shared to the top of bacon.toml
Nice to know the lifting trick, thanks ;)
Or support includes, but might complicate things a bit too far.