[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 fro
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 18
Thread images: 3
File: thunderbird-256.e5af8f2b33f3.png (65 KB, 256x256) Image search: [Google]
thunderbird-256.e5af8f2b33f3.png
65 KB, 256x256
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 (398 KB, 508x685) Image search: [Google]
1450763534148.png
398 KB, 508x685
>>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
>>
File: Screenshot_20160707-004333.png (355 KB, 1440x2560) Image search: [Google]
Screenshot_20160707-004333.png
355 KB, 1440x2560
>>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

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.