Skip to content
Discussion options

You must be logged in to vote

Noticed that this discussion is still open, the following script worked for me and plays sounds corresponding to the urgency of the notification, any hints or the application sending the notification.

#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

HAS_NOTIFICATION_SOUND=("Discord" "Thunderbird" "vesktop")

SOUNDFILE="/run/current-system/sw/share/sounds/freedesktop/stereo/suspend-error.oga" 

[[ "$SWAYNC_URGENCY" != "Critical" ]] && {
    # Got any sound files?
    if [[ -z "${SWAYNC_HINT_SOUND_FILE-}" ]] || [[ ! -f "${SWAYNC_HINT_SOUND_FILE//\'}" ]]; then
      SOUNDFILE="/run/current-system/sw/share/sounds/freedesktop/stereo/message.oga"
    else
      SOUNDFILE="${…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LazyStability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant