[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

The Problem With Linux (or)Getting unread message count from Thunderbird via Ter


Thread replies: 18
Thread images: 3

The Problem With Linux (or)
Getting unread message count from Thunderbird via Terminal

Spent a while figuring this out, maybe it will help someone else.

#!/bin/bash
INBOXFILE=/home/me/.thunderbird/dzrvkij6.default/Mail/pop.gmail.com/Inbox
THRESHOLD=200000
tail -$THRESHOLD $INBOXFILE | grep "X-Mozilla-Status:" | cut -d: -f2 | xargs -iZ bash -c 'echo $((10#Z & 1))' | grep -c 0


Searches through last $THRESHOLD lines of Inbox file for status lines. The least significant bit of the status indicates if the message is read, so we do a bitwise AND with 1, making sure to interpret the status as decimal and not octal (since by default bash interprets numbers starting with 0 as octals).
>>
Thunderbird is a XUL application you fucking twat, there's way better ways to get mail over the terminal.
>>
>>55469488
Well, I couldn't find anything. Anything more specific? Can I get Thunderbird's XUL from terminal?
>>
>>55469508
Yes, it's called not using fucking Thunderbird.
>>
>>55469515
All I wanted was an unread message count in my i3 statusbar :(
>>
File: 1450763534148.png (398KB, 508x685px) Image search: [Google] [Yandex] [Bing]
1450763534148.png
398KB, 508x685px
>>55469391
>Thunderbird, a GUI application, isn't "command line friendly"
>It's the kernel's fault
>>
>>55469529
Fuck off dumb animeposter
>>
>>55469528
use more simple tools for that
>>
>>55469673
go on
>>
>>55469755
There is a new service, they call it google
>>
>>55469856
i spent a ton of time searching for a way to do this, i couldn't find anything (other than getting something like mutt or notmuch).

or do you mean simpler shell commands?
>>
>>55470047
what's wrong with mutt?
Use the limits
http://www.mutt.org/doc/manual/#patterns

like ~O ~N ~U
>>
>>55470224
because I want to use thunderbird to access my e-mail, and didn't want to set up mutt just for getting an unread count.
>>
>>55470243
If you have a gmail account you can access it with curl at
https://mail.google.com/mail/feed/atom
, then filter it with awk, sed commands
>>
>>55470333
For a statusline that updates every few seconds you want me to authorize via OAuth and make a http request? I could keep a local cache of the feed but Thunderbird already does that.

Also, I'm planning on hosting my own mail server at some point in the future.
>>
>>55469755
https://wiki.archlinux.org/index.php/Conky#Display_number_of_new_emails
in general you could use python
>>
>>55471052
It's the same, the OP want thunderbird so...

/thread
>>
>>55469391 (OP)
>>55469529
Anime aside he is right. You are a fucking retard.

Also, what the fuck don't you get about pic related?!

>>>/wsr/
>>>/out/
>>>/reddit/
>>>/kys/
Thread replies: 18
Thread images: 3
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK