You are not logged in.

#1 2013-08-28 16:42:48

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

[Awesome] Mail notify mutt

How to script a new mail alert, I'm using Mutt MUA ?

Now, I've this in my rc.lua but I'm not on gmail.
-- Gmail widget
mygmail = wibox.widget.textbox()
gmail_t = awful.tooltip({ objects = { mygmail },})
mygmailimg = wibox.widget.imagebox(beautiful.widget_gmail)
vicious.register(mygmail, vicious.widgets.gmail,
                function (widget, args)
                    gmail_t:set_text(args["{subject}"])
                    gmail_t:add_to_object(mygmailimg)
                    return args["{count}"]
                 end, 10)
mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end)))

Offline

#2 2013-08-28 16:44:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,547
Website

Re: [Awesome] Mail notify mutt

You are not using gmail, so you can't use a gmail specific tool.  You tell us your client (mutt), but that is irrelevant.  Your mail *server* or provider is what is relevant.

If you use something like offlineimap to sync a local maildir then this is as simple as checking the number of files in /path/to/mail/inbox/new/

Edit: here is a github gist with a slightly modified excerpt from my status line tool (for a different WM).

Edit2: a quick google lead to this solution for imap.

Last edited by Trilby (2013-08-28 17:04:19)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2013-08-28 16:49:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Awesome] Mail notify mutt

There is also something in "Community Contributions" that is a wrapper around offlineimap that will actually send real notifications.  But of course you would have to be using offlineimap.  Otherwise, mutt itself actually sends EWMH notifications, so if you get new mail the terminal will me marked as "urgent" or your WM's equivalent.

... oh, I just reread your post, and it seems that you are actually trying to have your Awesome panel display these notifications, yes?  In that case, I'll reiterate what Trilby said: You need to be more specific about what you are trying to do and actually provide real relevant details.

Offline

#4 2013-08-28 16:57:36

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

Thanks for answer.
I would like a mail notify like this https://github-camo.global.ssl.fastly.n … 382e6a7067
A mail counter

Offline

#5 2013-08-28 17:01:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,547
Website

Re: [Awesome] Mail notify mutt

Again, you need to tell us what type of mail setup you have.  There is no generic way of doing this - it depends on your mail service.

Is it imap, is it pop, is it a local mail dir, is it delivered by homing pigeon?  These will all lead to different solutions - a local maildir is (again) by far the easiest (IMHO).

Last edited by Trilby (2013-08-28 17:05:20)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2013-08-28 17:10:05

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

I've a mail account in mailoo.org, I use IMAP, but Mutt creates a new file when new mail in the INBOX folder.

Offline

#7 2013-08-28 17:10:58

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [Awesome] Mail notify mutt

Again, have you checked the awesome wiki?
http://awesome.naquadah.org/wiki/Email_ … ntegration

Offline

#8 2013-08-28 17:14:50

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

Yeah, but I'm a biginner, I've just change the path where my imaps mail arrived.
It's was not working.

Offline

#9 2013-08-28 17:30:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,547
Website

Re: [Awesome] Mail notify mutt

NeanderMarcl wrote:

Yeah, but I'm a biginner, I've just change the path where my imaps mail arrived.

What does this mean?  imap mail doesn't have a "path".  2MG, correct me if I'm wrong, but it looks like that lua code is for maildir only.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2013-08-28 17:33:50

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

I've tried to use the script, I only modified the 

maildir = "/home/user/Mail",

by

maildir = "/home/$USER/.mutt/cache/imaps:mail.mailoo.org/INBOX"

Is that correct ?

Last edited by NeanderMarcl (2013-08-28 17:34:45)

Offline

#11 2013-08-28 17:57:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,547
Website

Re: [Awesome] Mail notify mutt

I don't know, as you haven't yet answered my repeated question of whether you have a local maildir.

Does that directory exist, if so, are there three sub directories named cur, new, and tmp, the first two of which may contain files with long names?

At the very least, I suspect you'd have to at least also modify the accounts variable.  And this is still assuming you have such a local maildir.

Last edited by Trilby (2013-08-28 17:58:17)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2013-08-28 18:15:18

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

I have a local mail dir.

This directory exists but there is not cur, new and tmps in it, the files in INBOX dir are named like that "1471590186-107"

Yeah I've modified the variable.

Offline

#13 2013-08-28 18:35:59

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

I tried 

mboxwidget = widget({ type = "textbox" })
 vicious.register(mboxwidget, vicious.widgets.mbox, "$1", 5, "/home/julien/.mutt/cache/imaps:@mailoo.org@mail.mailoo.org:993/INBOX")

the error is

attempt to call global 'widget' a nil value

How can I fix it ?

Last edited by NeanderMarcl (2013-08-28 18:36:31)

Offline

#14 2013-08-28 20:05:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,547
Website

Re: [Awesome] Mail notify mutt

NeanderMarcl wrote:

I have a local mail dir.

This directory exists but there is not cur, new and tmps in it

Then it is not a maildir.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2013-08-28 20:16:24

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

Okay, but it's the only folder I have in the .mutt

Offline

#16 2013-08-28 20:29:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,547
Website

Re: [Awesome] Mail notify mutt

What makes you think you should point that to anything in ~/.mutt?

It looks like you have mutt configured to read from an imap server and you don't have a local maildir (questions I asked at the very beginning of this thread).  So you either need to set up something like offlineimap to sync a local maildir, or you need to find a tool that will query imap servers, like the one I linked to in my first response in this thread.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#17 2013-08-28 20:58:53

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

I've read in the Arch wiki

set folder=imaps://imap.gmail.com/
 

I replace it by the mailoo and when I search in my .mutt, I've seen the imaps folder.

Offline

#18 2013-08-28 21:27:24

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

I tried delightful.widget.imap but without success..

Last edited by NeanderMarcl (2013-08-28 21:27:34)

Offline

#19 2013-08-31 19:07:08

NeanderMarcl
Member
Registered: 2013-06-04
Posts: 74

Re: [Awesome] Mail notify mutt

I try to modify the .offlineimapr as in the Arch wiki

~/.offlineimaprc
[mbnames]
enabled = yes
filename = /home/julien/.mutt/cache/imaps:@mailoo.org@mail.mailoo.org:993/INBO
header = "mailboxes "
peritem = "+%(accountname)s/%(foldername)s"
sep = " "
footer = "\n"

It's not working.

Offline

#20 2013-08-31 20:41:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Awesome] Mail notify mutt

NeanderMarcl wrote:

t's not working.

This is not an error message. Please read How To Ask Questions The Smart Way and try
and make your posts more meaningful and less like help vampirism.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB