Add test for (gnome?) notifications

This commit is contained in:
hjp 2016-07-05 19:19:06 +00:00
parent 5a638ec8fd
commit a5b3940dfe
1 changed files with 25 additions and 0 deletions

25
notify/test-basic.c Normal file
View File

@ -0,0 +1,25 @@
#include <libnotify/notify.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char * argv[] )
{
NotifyNotification *n;
notify_init("Basics");
n = notify_notification_new ("Summary",
"This is the message that we want to display",
NULL, NULL);
notify_notification_set_timeout (n, 5000); // 5 seconds
if (!notify_notification_show (n, NULL))
{
fprintf(stderr, "failed to send notification\n");
return 1;
}
g_object_unref(G_OBJECT(n));
return 0;
}