setup-cockpit/roles/i3/files/newmail

15 lines
282 B
Bash
Executable file

#!/bin/bash
if [ -z "$MAILBOX_DIR" ]; then
MAILBOX_DIR=~/.local/share/mail/
fi
if [ -z "$LABEL" ]; then
LABEL='New: '
fi
nb_new=$(find "$MAILBOX_DIR" -type d -name new -not -empty -execdir ls '{}' \+ | wc -l)
if [ "$nb_new" -gt 0 ]; then
echo "${LABEL}${nb_new}"
fi