mail-count: Add sh version
Add POSIX compliant sh version of the mail-count script. Additionally add comments to the bash version.
This commit is contained in:
parent
e0421cdecd
commit
68319d2b55
|
@ -1,11 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Count the number of unread emails and return the count in the i3/sway bar
|
||||||
|
# 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="$(find $MAILDIRNEW -type f | wc -l)"
|
||||||
|
|
||||||
|
# Print count in i3/sway bar format
|
||||||
echo $MAILNEW
|
echo $MAILNEW
|
||||||
echo $MAILNEW
|
echo $MAILNEW
|
||||||
[ ${MAILNEW} -ge 1 ] && exit 33
|
[ ${MAILNEW} -ge 1 ] && exit 33
|
||||||
|
|
17
mail-count.sh
Executable file
17
mail-count.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue