Open kovetskiy opened 4 years ago
that is sometimes up to the desktop environment how it handles this. I think I've seen this before. there are two ways of "updating" a notification:
I can't take any guarantees that xfce4-notifyd does what you want, but you could try out if it does when you update the notification using option 2. like in this example: https://github.com/hoodie/notify-rust/blob/master/examples/update.rs#L71
On the other hand, it works well with notify-desktop and xfce4-notifyd
#!/bin/bash
notify() {
file=/tmp/notify-id
id=$(cat $file 2>/dev/null)
notify-desktop -r "$id" -t 3000 "$@" | tee "$file"
}
notify "$(date)"
sleep 1
notify "$(date)"
sleep 1
notify "$(date)"
sleep 1
notify "$(date)"
(notification will be replaced)
🤔 interesting
thanks for the reproducer - can you tell if dbus-monitor "interface=org.freedesktop.Notifications"
shows any difference?
I can't say there are some real differences like some flags are different, but notify-desktop outputs a new id if current id can't be replaced. Toastify doesn't output a new id.
I've tried reusing notify-desktop's id and pass id to toastify but it leads to an interesting result — toastify freezes completely.
Reproducer:
#!/bin/bash
notify() {
file=/tmp/notify-id
id=$(cat $file 2>/dev/null)
notify-desktop -r "$id" -t 3000 "$@" | tee "$file"
}
toastify() {
toastify send -t 3000 --debug --id "$(cat /tmp/notify-id)" "$@"
}
notify "$(date)"
sleep 1
toastify "$(date)"
It seems like xfce4-notifyd ignores toastify's
--id
option:will show two notifications.
toastify-git v0.3.0.r14.gb81b6a0-1 xfce4-notifyd v0.6.1