diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/notification/notification.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/plugins/notification/notification.c b/plugins/notification/notification.c index 91028350..38c68c9a 100644 --- a/plugins/notification/notification.c +++ b/plugins/notification/notification.c @@ -1,18 +1,18 @@ #include "../../deadbeef.h" #include <stdio.h> -#include <libnotify/notify.h> +#include <stdlib.h> static DB_misc_t plugin; static DB_functions_t *deadbeef; -static NotifyNotification *ntf; static void show_notification (const char *summary, const char *body) { - notify_notification_close (ntf, NULL); - notify_notification_update (ntf, summary, body, NULL); - notify_notification_show (ntf, NULL); + char cmd [1024]; + if (!summary) summary = "Unknown track"; + snprintf (cmd, sizeof (cmd), "notify-send '%s' '%s'", summary, body); + system (cmd); } static int @@ -29,17 +29,11 @@ songchanged (DB_event_trackchange_t *ev, uintptr_t data) { static int notification_stop (void) { - notify_notification_close (ntf, NULL); deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (songchanged), 0); } static int notification_start (void) { - notify_init ("deadbeef"); - - ntf = notify_notification_new (NULL, NULL, NULL, NULL); - notify_notification_set_timeout (ntf, NOTIFY_EXPIRES_DEFAULT); - deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (songchanged), 0); return 1; } |