27 #include <libnotify/notify.h>
39 const gchar *title = gtk_window_get_title((GtkWindow*) data);
51 g_message(
"lnNotifs: constructor");
68 g_message(
"lnNotifs: Initializing");
70 GList* wlist = gtk_window_list_toplevels();
75 if (!notify_init(
"nightingale"))
76 return NS_ERROR_NOT_INITIALIZED;
78 GKeyFile *keyFile = g_key_file_new ();
80 gchar *desktopFilePath = g_build_filename (
"/usr/share/applications",
"nightingale.desktop", NULL);
82 if (g_key_file_load_from_file (keyFile, desktopFilePath, G_KEY_FILE_NONE, NULL))
84 playerIcon = g_key_file_get_string (keyFile,
"Desktop Entry",
"Icon", NULL);
105 const char *coverFilePath,
112 gchar *summary = g_strdup_printf(
"%s", title);
113 gchar *body = g_strdup_printf(
"%s - %s", artist, album);
114 const char *image = (!coverFilePath) ?
playerIcon : coverFilePath;
116 notify_notification_update(
notification, summary, body, image);
static gchar * playerIcon
NS_IMPL_ISUPPORTS1(sbDeviceCapabilitiesUtils, sbIDeviceCapabilitiesUtils) sbDeviceCapabilitiesUtils
void checkWindowTitle(gpointer data, gpointer user_data)
var getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('Songbird SBProperties artist
static GtkWindow * playerGtkWindow
void EnableNotifications(in PRBool enable)
void TrackChangeNotify(in string title, in string artist, in string album, in string coverFilePath, in PRInt32 timeout)
void InitNotifs(in string windowTitle)
NotifyNotification * notification