diff --git a/mail-count.bash b/mail-count.bash index 2e7ae76..a6bd394 100755 --- a/mail-count.bash +++ b/mail-count.bash @@ -1,11 +1,15 @@ #!/bin/bash +# 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)" +# Print count in i3/sway bar format echo $MAILNEW echo $MAILNEW [ ${MAILNEW} -ge 1 ] && exit 33 diff --git a/mail-count.sh b/mail-count.sh new file mode 100755 index 0000000..4ff49d1 --- /dev/null +++ b/mail-count.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# 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)" + +# Print count in i3/sway bar format +echo $MAILNEW +echo $MAILNEW +[ ${MAILNEW} -ge 1 ] && exit 33 + +exit 0