mostly fixes
[distro-setup] / prof-notify
diff --git a/prof-notify b/prof-notify
new file mode 100644 (file)
index 0000000..7c550b1
--- /dev/null
@@ -0,0 +1,10 @@
+#!/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