aboutsummaryrefslogtreecommitdiff
path: root/pb-biff
blob: 40265e40eaa5ba2393b88ac04e47ec2128c96e2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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