Anachron / i3blocks

Additional/custom blocks which fit my needs
GNU General Public License v3.0
585 stars 106 forks source link

Using 2 [mail] blocklets gives undesired output #19

Closed ghost closed 4 years ago

ghost commented 8 years ago

i3blocks.conf set up as such:

# personal mail
[mail]
color=#F8F8F8
label=Home
instance=~/.scripts/home_unread.config
interval=60

and

# work mail
[mail]
color=#F8F8F8
label=- Work
instance=~/.scripts/work_unread.config
interval=60

Where home_unread.config and work_unread.config are of the style:

MAIL_SERVER='imap.gmail.com:993'
MAIL_USER='mypersonalemail@gmail.com'
MAIL_PASSWORD='mypersonalpassword'
MAIL_FOLDER='INBOX'
ghost commented 8 years ago

I also have unsecure apps turned on within gmail. The problem is, the amount of unread emails either Home or Work will show, never both at the same time. However, if I click on the one which is not showing (to open gmail in the browser) it suddenly switches and shows the number of unread emails:

q9fviuc

If I clicked on 'Home' in the above example, it would suddenly show the amount of unread mails.

What's interesting to me is that by default is shows my separator until I click it and then it shows the unread mails

Anachron commented 8 years ago

Can you put the "- Home" inside " marks and try again?

ghost commented 8 years ago

Same thing, 2016-05-27-170439_226x21_scrot

Then I click on "Home" and it magically shows 0

Anachron commented 8 years ago

@WilkinsPhysics thanks, I will see if I can reproduce on my pc and I'll investigate.

Anachron commented 8 years ago

Sorry for the lack of participation for now, I am using BSPWM right now but I still want to maintain this repo as it grow in popularity quite much. Will try to get to this this weekend!

Anachron commented 8 years ago

I believe it has to do with the script only using one temporary file here: https://github.com/Anachron/i3blocks/blob/master/blocks/mail#L33

I will make use of mktemp (like I should have) and that should fix it. Thanks for your bug report, @WilkinsPhysics !

Anachron commented 7 years ago

Sorry for delayed reply, can you change the intervals of one of them and try again? (something minor such as 59 is ok)