dotfiles/mutt/.mutt/mailnotify.sh
Sanchayan Maity 2de0addc61 Switch to asymptotic
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-07-23 20:20:48 +05:30

17 lines
588 B
Bash
Executable file

#!/bin/bash
imapfilter -c ~/.imapfilter/config.lua
mbsync -a
notmuch new
export DISPLAY=:0
let inbox=`ls /home/core/Gmail/sanchayan/Inbox/new/|wc -l`
let asymptotic_inbox=`ls /home/core/Gmail/asymptotic/Inbox/new/|wc -l`
if [ "$inbox" -gt 0 ]; then
sudo -u core DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have $inbox new mails in inbox"
fi
if [ "$asymptotic_inbox" -gt 0 ]; then
sudo -u core DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have $asymptotic_inbox new mails in asymptotic inbox"
fi