waybar: add service status to mail
This commit is contained in:
parent
711c9a31f9
commit
c3035cb45e
1 changed files with 10 additions and 3 deletions
|
@ -2,17 +2,24 @@
|
||||||
|
|
||||||
MAILDIR=$HOME/.mail
|
MAILDIR=$HOME/.mail
|
||||||
ACCOUNTS=(posteo gmail xkonni)
|
ACCOUNTS=(posteo gmail xkonni)
|
||||||
|
SERVICES=(mbsync@ykonni muchsync@ykonni)
|
||||||
|
|
||||||
|
|
||||||
text=""
|
text=""
|
||||||
tooltip=""
|
tooltip="<b>accounts</b>\n"
|
||||||
total=0
|
total=0
|
||||||
for acc in ${ACCOUNTS[@]}; do
|
for acc in ${ACCOUNTS[@]}; do
|
||||||
count=$(notmuch count folder:$acc/Inbox AND tag:unread AND NOT tag:killed)
|
count=$(notmuch count folder:$acc/Inbox AND tag:unread AND NOT tag:killed)
|
||||||
total=$((total+count))
|
total=$((total+count))
|
||||||
tooltip+="$acc: $count"
|
tooltip+=" - $acc: $count\n"
|
||||||
[ ! $acc = ${ACCOUNTS[-1]} ] && tooltip+="\n"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
tooltip+="\n<b>services</b>\n"
|
||||||
|
for service in ${SERVICES[@]}; do
|
||||||
|
tooltip+=" - $service:\n$(systemctl --user status $service | grep -e 'Active' | sed 's/Active:[ ]*//g')\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
alt=$( [ $total -gt 0 ] && echo "unread" || echo "read" )
|
alt=$( [ $total -gt 0 ] && echo "unread" || echo "read" )
|
||||||
text="$total"
|
text="$total"
|
||||||
json="{\"text\": \"$text\", \"tooltip\": \"$tooltip\", \"class\": \"mail\", \"alt\": \"$alt\"}"
|
json="{\"text\": \"$text\", \"tooltip\": \"$tooltip\", \"class\": \"mail\", \"alt\": \"$alt\"}"
|
||||||
|
|
Loading…
Reference in a new issue