Update “mail-count.sh” to use “fd”

This commit is contained in:
Olli 2026-03-15 15:41:09 +01:00
commit f586eaa8a2

View file

@ -1,17 +1,15 @@
#!/bin/sh
# Count the number of unread emails and return the count in the i3/sway bar
# format.
# Count the number of unread emails and return the count in the i3/sway bar format.
# Settings
MAILDIRNEW="$HOME/Dokumente/eMails/*/INBOX/new/"
# Count new mails
MAILNEW="$(find $MAILDIRNEW -type f | wc -l)"
MAILNEW="$(fd -t f -g '*' $MAILDIRNEW | wc -l)"
# Print count in i3/sway bar format
echo $MAILNEW
echo $MAILNEW
[ ${MAILNEW} -ge 1 ] && exit 33
exit 0
if [ $MAILNEW -ge 1 ]
then
echo $MAILNEW
fi