notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Add support for sound-name and suppress-sound hints

Open bluesabre opened this issue 3 years ago • 8 comments

The notification specification defines some additional hints for sounds.

  • sound-file
  • sound-name
  • suppress-sound

This PR adds support for sound-name and suppress-sound. Supporting sound-file may be a bit more involved since Canberra doesn't seem to natively support files.

Testing sound-name (and category to verify no breakage) can be done with notify-send:

# category
notify-send --category=email test test
notify-send --category=im.received test test

# sound-name
notify-send --hint=string:sound-name:message-new-instant test test
notify-send --hint=string:sound-name:service-login test test

Testing suppress-sound is trickier since notify-send doesn't support boolean hints.

gdbus call --session \
    --dest org.freedesktop.Notifications \
    --object-path /org/freedesktop/Notifications \
    --method org.freedesktop.Notifications.Notify \
    "test" "42" "dialog-information" "test" "test" \
    '[]' '{"suppress-sound":<true>}' "5000"

bluesabre avatar May 23 '21 07:05 bluesabre