aboutsummaryrefslogtreecommitdiff
path: root/i3blocks/i3mailbox.sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-05-22 10:24:27 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2019-05-22 10:24:27 +0200
commitccc0247b0d25a7cfc1747ceca369d4386bdfbb21 (patch)
tree8515f32d972baa9e58f1053e67c10bd0031b5709 /i3blocks/i3mailbox.sh
parent339e3dac53099fecd2e54b9f557b15e2530618c3 (diff)
downloadscripts-ccc0247b0d25a7cfc1747ceca369d4386bdfbb21.tar.gz
scripts-ccc0247b0d25a7cfc1747ceca369d4386bdfbb21.zip
Renamed mailbox and moon scripts and added click to moon.
Diffstat (limited to 'i3blocks/i3mailbox.sh')
-rwxr-xr-xi3blocks/i3mailbox.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/i3blocks/i3mailbox.sh b/i3blocks/i3mailbox.sh
new file mode 100755
index 0000000..89fb49a
--- /dev/null
+++ b/i3blocks/i3mailbox.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"