diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2020-12-25 08:02:50 -0500 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2020-12-25 08:02:50 -0500 |
| commit | 2619a88fcd94cbd4b2caa719ba926ae0013fb4ec (patch) | |
| tree | acb240c6afee6a3ee15cf64c9788b5ed053ebe97 /.local/bin/statusbar/sb-mailbox | |
| parent | 741e9298bd7b0dabeea26dfe039274afca572f6d (diff) | |
| download | eibhear-2619a88fcd94cbd4b2caa719ba926ae0013fb4ec.tar.gz eibhear-2619a88fcd94cbd4b2caa719ba926ae0013fb4ec.tar.zst eibhear-2619a88fcd94cbd4b2caa719ba926ae0013fb4ec.zip | |
statusbar scripts now with sb- to avoid conflicts
update dwmblocks build to avoid errors
Diffstat (limited to '.local/bin/statusbar/sb-mailbox')
| -rwxr-xr-x | .local/bin/statusbar/sb-mailbox | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox new file mode 100755 index 0000000..5a67428 --- /dev/null +++ b/.local/bin/statusbar/sb-mailbox @@ -0,0 +1,20 @@ +#!/bin/sh + +# Displays number of unread mail and an loading icon if updating. +# When clicked, brings up `neomutt`. + +case $BLOCK_BUTTON in + 1) setsid -f "$TERMINAL" -e neomutt ;; + 2) setsid -f mw sync >/dev/null ;; + 3) notify-send "📬 Mail module" "\- Shows unread mail +- Shows 🔃 if syncing mail +- Left click opens neomutt +- Middle click syncs mail" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" + +pidof mbsync >/dev/null 2>&1 && icon="🔃" + +[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬$unread$icon" |
