Update “mail-count.sh” to use “fd”
This commit is contained in:
parent
d983206785
commit
f586eaa8a2
1 changed files with 6 additions and 8 deletions
|
|
@ -1,17 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Count the number of unread emails and return the count in the i3/sway bar
|
# Count the number of unread emails and return the count in the i3/sway bar format.
|
||||||
# format.
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
MAILDIRNEW="$HOME/Dokumente/eMails/*/INBOX/new/"
|
MAILDIRNEW="$HOME/Dokumente/eMails/*/INBOX/new/"
|
||||||
|
|
||||||
# Count new mails
|
# 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
|
# Print count in i3/sway bar format
|
||||||
|
if [ $MAILNEW -ge 1 ]
|
||||||
|
then
|
||||||
echo $MAILNEW
|
echo $MAILNEW
|
||||||
echo $MAILNEW
|
fi
|
||||||
[ ${MAILNEW} -ge 1 ] && exit 33
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue