You are not logged in.

#1 2011-12-01 22:52:15

willbprog127
Member
Registered: 2011-11-09
Posts: 59

[SOLVED] Expiration time ignored in libnotify

Greetings everyone.

I'm using LXDE on Arch and wanted to do some custom notifications.  I first installed notification-daemon, visited the Arch Wiki on the subject then tried this in a bash script:

#! /bin/bash

notify-send "New Mail" "From: $1\nSubject: $2" -t 60000

That popped up the notification just fine, but the expire-time parameter (-t 60000) was completely ignored as the notification disappeared after 5 seconds.  Thinking it was just a notify-send problem, I decided to compile the example program (with the addition of notify_notification_set_timeout) in C:

#include <libnotify/notify.h>

void main () {
	notify_init ("Hello world!");
	NotifyNotification * Hello = notify_notification_new ("Hello world", "This is an example notification.", "dialog-information");
	notify_notification_set_timeout(Hello, NOTIFY_EXPIRES_NEVER);
	notify_notification_show (Hello, NULL);
	notify_uninit ();
}

This worked, however the notification bubble is still disappearing after five seconds.  Just for good measure, I even substituted NOTIFY_EXPIRES_NEVER with 60000 and this also was ignored.

I can't seem to find anything on the forums by searching (or through my favorite search engine) about timeout problems.  Can anyone shed some light on this?

Thanks! big_smile

Last edited by willbprog127 (2011-12-01 23:32:42)

Offline

#2 2011-12-01 23:11:43

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,110
Website

Re: [SOLVED] Expiration time ignored in libnotify

This is dependent on the sink that handles notifications, not libnotify itself.

Offline

#3 2011-12-01 23:14:15

willbprog127
Member
Registered: 2011-11-09
Posts: 59

Re: [SOLVED] Expiration time ignored in libnotify

falconindy wrote:

This is dependent on the sink that handles notifications, not libnotify itself.

Thanks for that.  What can I do, then, to change this behavior?  How can I identify what the sink is?

Offline

#4 2011-12-01 23:21:39

Gusar
Member
Registered: 2009-08-25
Posts: 3,604

Re: [SOLVED] Expiration time ignored in libnotify

In your case, notification-daemon is the sink. Though I thought notification-daemon supported timeout, that only notify-osd doesn't. Try with xfce4-notifyd.

Offline

#5 2011-12-01 23:32:25

willbprog127
Member
Registered: 2011-11-09
Posts: 59

Re: [SOLVED] Expiration time ignored in libnotify

Excellent!  Using xfce4-notifyd, my bash script's timeout parameter works properly!  Thank you very very much! big_smile

Offline

Board footer

Powered by FluxBB