summaryrefslogtreecommitdiff
path: root/.local/bin/dwmbar/dwmb-mail
blob: faa01e6ab092c264101d1a4170a39b762a00b132 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

# Displays number of unread mail and an loading icon if updating.
# When clicked, brings up `neomutt`.

unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/*/new/* -type f | wc -l 2>/dev/null)"

pidof mbsync >/dev/null 2>&1 && icon=" "

[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "  $unread$icon"