I ended up using the answer in Ask Ubuntu:
https://askubuntu.com/a/871207/307523

The basic concept is you link your message to the last message you sent
with an extra line:

     -h string:x-canonical-private-synchronous:anything

Where 'anything' is the string/text grouping your spamming bubbles
together so fast repeating one replaces the one before (in that same
group).

Code snippet from within larger while loop:

    GetVolume
    CurrVolume="$?"
    # echo CurrVolume: $CurrVolume LastVolume: $LastVolume

    if [[ "$CurrVolume" != "$LastVolume" ]] ; then
        # Ask Ubuntu: https://askubuntu.com/a/871207/307523
        notify-send --urgency=critical "tvpowered" \
            -h string:x-canonical-private-synchronous:volume \
            --icon=/usr/share/icons/gnome/48x48/devices/audio-speakers.png \
            "Volume: $CurrVolume"
        LastVolume=$CurrVolume
        VolumeCnt=10
        # TODO: Process VolumeCnt internally in loop instead of larger loop
    fi

    if [[ $VolumeCnt > 0 ]]; then
        (( VolumeCnt-- ))
        SleepTime=.01
    else
        SleepTime=2.5
    fi

    sleep $SleepTime

In the link comments point out how this only works in Ubuntu and not in
Gnome. It works fine in Ubuntu 16.04.7 LTS with Unity desktop but I
haven't tried it on other desktops yet

SleepTime of '0.01' is too small for real time but the bash script has
overhead of communicating to TV over WiFi which gives it about the '0.5'
seconds lag.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/257135

Title:
  notify-send(1) can't replace an existing notification

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/257135/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to