Konstantin Koslowski
2765fdd6cf
style: add fontawesome as fallback mail: add tooltip with details mediaplayer: add tooltip card: add information about card
19 lines
483 B
Bash
Executable file
19 lines
483 B
Bash
Executable file
#!/bin/bash
|
|
|
|
MAILDIR=$HOME/.mail
|
|
ACCOUNTS=(posteo gmail xkonni)
|
|
|
|
text=""
|
|
tooltip=""
|
|
total=0
|
|
for acc in ${ACCOUNTS[@]}; do
|
|
count=$(notmuch count folder:$acc/Inbox AND tag:unread AND NOT tag:killed)
|
|
total=$((total+count))
|
|
tooltip+="$acc: $count"
|
|
[ ! $acc = ${ACCOUNTS[-1]} ] && tooltip+="\n"
|
|
done
|
|
|
|
alt=$( [ $total -gt 0 ] && echo "unread" || echo "read" )
|
|
text="$total"
|
|
json="{\"text\": \"$text\", \"tooltip\": \"$tooltip\", \"class\": \"mail\", \"alt\": \"$alt\"}"
|
|
echo $json
|