The Wolfe Pack

@destructatron just before the “$result” part, it would be god to add –, so you would have:

spd-say -Cw -- "$result"

Briefly looking at your code, so long as $result contains something, it should speak. Without the – bit, however, it could potentially think a - was the start of a flag. If that doesn’t fix it, let me know and I’ll check into it more thoroughly.

replies
1
announces
0
likes
0

@destructatron Oh, looking at this more carefully, I think monitoring for new notifications is going to be a blocking process. I fixed the subshell statement for result, and it just hangs. I’ll see what I can do with it and let you know.

@destructatron I have a script for you. I got tired of fighting with the original, here is my rewrite. Currently it says the notification, but it also says “sender-pid” with each one. I’ll try and get that fixed, but I thought it was going to be easy and … not so much.

#!/usr/bin/env bash

dbus-monitor "interface='org.freedesktop.Notifications'" | while read line; do
    grep --line-buffered "string" |
    grep --line-buffered -e method -e ":" -e '""' -e urgency -e notify -v |
    grep --line-buffered '.*(?=string)|(?<=string).*' -oPi |
    grep --line-buffered -v '^\s*$' |
    spd-say -Cw -P important -e
done

If that works for you I will keel that sender-pid thing eventually. Let me know.

@destructatron hopefully. I only tested with notify-send.