From 49718f85165b2e87e655babce853d507a38a5545 Mon Sep 17 00:00:00 2001 From: Tobias Bernard Date: Thu, 20 Jul 2017 20:40:01 +0200 Subject: [PATCH] [add] initial notification stuff and .desktop file --- src/org.gtk.teleportapp.desktop | 6 ++++++ src/teleportapp.c | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100755 src/org.gtk.teleportapp.desktop diff --git a/src/org.gtk.teleportapp.desktop b/src/org.gtk.teleportapp.desktop new file mode 100755 index 0000000..dd4d6ef --- /dev/null +++ b/src/org.gtk.teleportapp.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Teleport +Exec=/home/tobi/code/teleport/src/teleportapp +Icon=utilities-terminal +Type=Application +Categories=GTK;GNOME;Utility; diff --git a/src/teleportapp.c b/src/teleportapp.c index 36248ca..6a67849 100644 --- a/src/teleportapp.c +++ b/src/teleportapp.c @@ -58,6 +58,14 @@ teleport_app_activate (GApplication *app) */ run_avahi_publish_service("Angela's (self)"); run_avahi_service(peerList); + GNotification *notification = g_notification_new ("Hello world!"); + g_notification_set_body (notification, "This is an example notification."); + GIcon *icon = g_themed_icon_new ("dialog-information"); + g_notification_set_icon (notification, icon); + g_notification_add_button (notification, "5 minutes", "app.reply-5-minutes"); + g_application_send_notification (app, NULL, notification); + g_object_unref (icon); + g_object_unref (notification); } static void