treat expiry times < current time as timeouts from current instant, convenience for shell scripts
This commit is contained in:
parent
3ab64b8b15
commit
075e6dda7f
|
@ -1,3 +1,7 @@
|
|||
Mon Jul 5 00:12:03 2004 Mike Hearn <mike@navi.cx>
|
||||
* tools/notify-send.c (main): Treat expiry times < current time
|
||||
as timeouts from current instant
|
||||
|
||||
Sun Jul 4 22:54:44 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||
* libnotify/notify.c: Use a direct hash rather than an int hash
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ main(int argc, const char **argv)
|
|||
0, N_("Specifies the urgency level (low, normal, high, critical)"),
|
||||
NULL },
|
||||
{ "expire-time", 't', POPT_ARG_INT | POPT_ARGFLAG_STRIP, &expire_time,
|
||||
0, N_("Specifies the timestamp at which to expire the notification"),
|
||||
0, N_("Specifies the timestamp at which to expire the notification, or if < current time, specifies timeout in seconds from current time"),
|
||||
NULL },
|
||||
{ "sound", 's', POPT_ARG_STRING | POPT_ARGFLAG_STRIP, &sound, 0,
|
||||
N_("Specifies a sound file to play on notification."), NULL },
|
||||
|
@ -127,6 +127,9 @@ main(int argc, const char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
/* if the given time is < current time, treat it as a timeout in seconds (ie 5 seconds) */
|
||||
if (expire_time < time(NULL)) expire_time += time(NULL);
|
||||
|
||||
notify_send_notification(urgency, summary, description, icon,
|
||||
TRUE, expire_time, NULL, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue