I am about building a statusbar for dwm, i want to read out the unread-mail-count via terminal (with grep, sed, or fopen as a file) and get it via fopen/popen.
I am using ubuntu/dwm/thunderbird 16. I Think there is no text-file containing the unread-email count...
Any suggestions?
go to ~/.thunderbird/default/
search in
Imapmail/../INBOX
or in
Mail/../INBOX
for files without any extension.They contain your mails.Do the following
cat
<file>|grep -c X:Mozilla-Status: 0000
This will give you an unread mail count,since your unread mail have X:Mozilla-Status as 0000
For other statuses go through the different X:Mozilla-Statuses
[NOT AN ANSWER]
I dont have enough rep to comment on the bellow answer (Anurag's answer). But grepping/counting for X:Mozilla-Status: 0000 isn't working anymore. I tried that for a conky script. even for unread the status is 0001. i have tested with ubuntu 12.10 and thunderbird 16. Here's the same question asked on getsatisfaction.com (external link).
You can also count "X:Mozilla-Status:" and "X:Mozilla-Status: 0001", both will return the same no matter what is the state of you inbox. It seems X:Mozilla-Status is not being used at all. (Ref.)
* I ran my searches for IMAP inbox. maybe that's the reason. maybe IMAP's info is stored somewhere else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With