Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* gcc -Wall $(pkg-config --cflags --libs hildon-notify glib-2.0) notify.c -o notify */
- #include <stdlib.h>
- #include <string.h>
- #include <libintl.h>
- #include <locale.h>
- #include <hildon/hildon-notification.h>
- #include <glib.h>
- int main (int argc, char *argv[])
- {
- if ( argc != 5 ) /* argc should be 5 for correct execution */
- {
- printf("Usage: %s <title> <subtitle> <icon> <timeout (ms)> <category (optional)> \n", argv[0]);
- return 1;
- } else {
- const gchar *title = argv[1];
- const gchar *subTitle = argv[2];
- const gchar *icon = argv[3];
- /* ===================== FIX THIS OR HARDCODE LIMIT ============================= */
- const gint timeout = argv[4];
- /* ============================================================================== */
- const gchar *category = argv[5];
- if (category == NULL)
- category = "misc";
- HildonNotification *notification;
- g_type_init ();
- notify_init ("notification");
- notification = hildon_notification_new(title, subTitle, icon, category);
- notify_notification_set_timeout (NOTIFY_NOTIFICATION(notification), timeout);
- notify_notification_show(NOTIFY_NOTIFICATION(notification), NULL);
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement