--- /dev/null
+#!/bin/bash
+set -e; . /usr/local/lib/err; set +e
+
+while read -r line; do
+ # check that the profanity window is not focused
+ if ! i3-msg -t get_tree | jq -e '.nodes[].nodes[].nodes[].nodes[] | select(.focused==true and .name=="profanity — Konsole") |.name' &>/dev/null; then
+ # the profanity tag makes it so new notification replaces old.
+ dunstify -h string:x-dunst-stack-tag:profanity $line
+ fi
+done