From 7877ae71cb890fb458afa68b71e9ba10abf52392 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Mon, 22 Apr 2019 18:28:49 +0200 Subject: Created scripts to handle mail. --- i3blocks/mailbox.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 i3blocks/mailbox.sh (limited to 'i3blocks') diff --git a/i3blocks/mailbox.sh b/i3blocks/mailbox.sh new file mode 100755 index 0000000..89fb49a --- /dev/null +++ b/i3blocks/mailbox.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# i3blocks mail module. +# Displays number of unread mail and an loading icon if updating. +# When clicked, brings up `neomutt`. + +case $BLOCK_BUTTON in + 1) "$TERMINAL" -e mail.sh ;; + 2) setsid "$HOME/scripts/floats/urxvtFloat.sh" 66 3 syncMail.sh >/dev/null & ;; + 3) pgrep -x dunst >/dev/null && dunstify "📬 Mail module" "\- Shows unread mail +- Shows 🔃 if syncing mail +- Left click opens neomutt +- Middle click syncs mail" ;; +esac + +gmailN="$(du -a ~/.mail/gmail/INBOX/new/* 2>/dev/null | sed -n '$=')" +[ "$gmailN" ] || gmailN="0" +unioviN="$(du -a ~/.mail/uniovi/INBOX/new/* 2>/dev/null | sed -n '$=')" +[ "$unioviN" ] || unioviN="0" +echo "$(cat /tmp/imapsyncicon) Gmail: $gmailN uniovi: $unioviN" -- cgit v1.2.1