Open earboxer opened 1 year ago
Should probably add a "suppress-sound" BOOLEAN criteria... not sure how widely used any of these are.
Dino at least sends sound-name:phone-incoming-call
, so, for mako users, this could be an alternative to https://github.com/dino/dino/pull/1203 (assuming you're okay with binding the action to dismiss it).
To improve the user-experience, maybe there should be an 'on-dismiss' binding, because I want to kill the sound AND close the notification.
(And probably the actions should work with this... not sure if that would be possible to script. maybe I'm asking too much of mako at this point.)
If we implement "truthy/falsey" string comparisons first as in https://github.com/emersion/mako/pull/471, then it will be easier to specify the config:
[sound-file]
on-notify=exec mpv --really-quiet "$(makoctl list | jq -r '.data[0][0]."sound-file".data')"
[sound-name]
on-notify=exec mpv --really-quiet "/usr/share/sounds/freedesktop/stereo/$(makoctl list | jq -r '.data[0][0]."sound-name".data').oga"
#override specific sound
[sound-name="phone-incoming-call"]
on-notify=exec mpv --really-quiet --loop /usr/share/sounds/freedesktop/stereo/phone-incoming-call.oga
on-button-left=exec pkill -9 -f 'mpv .*phone-incoming-call.oga'
on-button-right=exec pkill -9 -f 'mpv .*phone-incoming-call.oga'
on-button-middle=exec pkill -9 -f 'mpv .*phone-incoming-call.oga'
on-touch=exec pkill -9 -f 'mpv .*phone-incoming-call.oga'
Reference: https://specifications.freedesktop.org/notification-spec/latest/ar01s08.html
Added sound-file and sound-name to the data so they'll appear in makoctl list. Also added a criteria for sound-name.
You can use this config to play the sounds:
Closes #424
Testing notes: