On 2010-07-23, He Wen wrote:
> Hi, Every one! 
> 
> I try to use notify-send to send a message to my desktop when a new mail
> arrives, but i find notify-send dosen't work with procmail:
> 
> In my procmailrc, I have:
> 
> # notification
> :0 ic:
> | play /usr/share/sounds/gnome/default/alerts/drip.ogg; notify-send -i
> 'evolution' "New Mail Arrives"
> 
> Only the sound could be heard, but no notifcation popped out. I can't figure 
> out
> what's wrong with it. Could anyone help me? Thank you ^^

I'm not familiar with notify-send, but I imagine that it's an X
application and needs to know the identity of the display on which
to display itself.  The process that runs procmail is not associated
with any display, so notify-send doesn't know what display to use.

You might try executing

    echo $DISPLAY

at the shell prompt of some X terminal, then setting DISPLAY to that
value in the command that invokes notify-send, something like this.

    # notification
    :0 ic:
    | play /usr/share/sounds/gnome/default/alerts/drip.ogg; DISPLAY=:0.0 
notify-send -i 'evolution' "New Mail Arrives"

Unfortunately I don't have a way to test that at the moment.

HTH,
Gary

Reply via email to