From 5b9ff2c334a3a85c25b11bc17009f211eec51575 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Tue, 3 Jun 2025 20:12:49 +0200 Subject: update --- pw-biff | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 pw-biff (limited to 'pw-biff') diff --git a/pw-biff b/pw-biff new file mode 100755 index 0000000..40265e4 --- /dev/null +++ b/pw-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 -- cgit v1.2.3