aboutsummaryrefslogtreecommitdiff
path: root/pb-biff
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-05-28 09:03:08 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-05-28 09:03:08 +0200
commit97a70c5573f70a2b638bd50c1f6c0c8b88296fa1 (patch)
treeb5c899d13ae5234eee6e351faee405cef7379211 /pb-biff
parent4e777b956bb3fa0efdadc38e319220edb1e1d6dc (diff)
downloadscripts-97a70c5573f70a2b638bd50c1f6c0c8b88296fa1.tar.gz
scripts-97a70c5573f70a2b638bd50c1f6c0c8b88296fa1.tar.bz2
scripts-97a70c5573f70a2b638bd50c1f6c0c8b88296fa1.zip
update
Diffstat (limited to 'pb-biff')
-rwxr-xr-xpb-biff25
1 files changed, 25 insertions, 0 deletions
diff --git a/pb-biff b/pb-biff
new file mode 100755
index 0000000..40265e4
--- /dev/null
+++ b/pb-biff
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+# run from cron
+
+if [ -z $1 ]; then
+ exit
+fi
+
+export DISPLAY=:0.0
+export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
+
+maildir="$HOME/.mail/$1/Inbox/new/"
+
+mailcount=$(find $maildir -type f | wc -l)
+
+if (("$mailcount" > 0)); then
+
+ /usr/local/bin/dunstify \
+ -t 5000 \
+ -a "You have mail" \
+ -u normal \
+ -i internet-mail-symbolic \
+ -h string:x-dunst-stack-tag:Mail "$1 has mail: $mailcount messages"
+
+fi