diff --git a/mail-count.sh b/mail-count.sh index 4ff49d1..2823d58 100755 --- a/mail-count.sh +++ b/mail-count.sh @@ -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