From 105436ca4a5de47c87f7bb7e31896878dc4ae97b Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 4 Jun 2008 23:28:54 +0200 Subject: [PATCH] notify_desktop plugin: Renamed the desktop_notification plugin. This way it's more consistent with the notify_email plugin. --- configure.in | 4 +- src/Makefile.am | 18 ++++---- src/collectd.conf.pod | 52 ++++++++++++------------ src/{desktop_notification.c => notify_desktop.c} | 22 +++++----- 4 files changed, 48 insertions(+), 48 deletions(-) rename src/{desktop_notification.c => notify_desktop.c} (85%) diff --git a/configure.in b/configure.in index 856aa827..13228c15 100644 --- a/configure.in +++ b/configure.in @@ -2512,7 +2512,7 @@ AC_PLUGIN([battery], [$plugin_battery], [Battery statistics]) AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics]) AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics]) AC_PLUGIN([csv], [yes], [CSV output plugin]) -AC_PLUGIN([desktop_notification], [$with_libnotify], [Desktop notifications]) +AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications]) AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics]) AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics]) AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis]) @@ -2674,7 +2674,6 @@ Configuration: cpu . . . . . . . . . $enable_cpu cpufreq . . . . . . . $enable_cpufreq csv . . . . . . . . . $enable_csv - desktop_notification $enable_desktop_notification df . . . . . . . . . $enable_df disk . . . . . . . . $enable_disk dns . . . . . . . . . $enable_dns @@ -2699,6 +2698,7 @@ Configuration: network . . . . . . . $enable_network nfs . . . . . . . . . $enable_nfs nginx . . . . . . . . $enable_nginx + notify_desktop . . . $enable_notify_desktop notify_email . . . . $enable_notify_email ntpd . . . . . . . . $enable_ntpd nut . . . . . . . . . $enable_nut diff --git a/src/Makefile.am b/src/Makefile.am index 149ecb32..efbe0d73 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -182,15 +182,6 @@ collectd_LDADD += "-dlopen" csv.la collectd_DEPENDENCIES += csv.la endif -if BUILD_PLUGIN_DESKTOP_NOTIFICATION -pkglib_LTLIBRARIES += desktop_notification.la -desktop_notification_la_SOURCES = desktop_notification.c -desktop_notification_la_CFLAGS = $(LIBNOTIFY_CFLAGS) -desktop_notification_la_LDFLAGS = -module -avoid-version $(LIBNOTIFY_LIBS) -collectd_LDADD += "-dlopen" desktop_notification.la -collectd_DEPENDENCIES += desktop_notification.la -endif - if BUILD_PLUGIN_DF pkglib_LTLIBRARIES += df.la df_la_SOURCES = df.c @@ -478,6 +469,15 @@ collectd_LDADD += "-dlopen" nginx.la collectd_DEPENDENCIES += nginx.la endif +if BUILD_PLUGIN_NOTIFY_DESKTOP +pkglib_LTLIBRARIES += notify_desktop.la +notify_desktop_la_SOURCES = notify_desktop.c +notify_desktop_la_CFLAGS = $(LIBNOTIFY_CFLAGS) +notify_desktop_la_LDFLAGS = -module -avoid-version $(LIBNOTIFY_LIBS) +collectd_LDADD += "-dlopen" notify_desktop.la +collectd_DEPENDENCIES += notify_desktop.la +endif + if BUILD_PLUGIN_NOTIFY_EMAIL pkglib_LTLIBRARIES += notify_email.la notify_email_la_SOURCES = notify_email.c diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 2b3dedf7..df5f2423 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -278,32 +278,6 @@ number. =back -=head2 Plugin C - -This plugin sends a desktop notification to a notification daemon, as defined -in the Desktop Notification Specification. To actually display the -notifications, B is required and B has to be -able to access the X server. - -The Desktop Notification Specification can be found at -L. - -=over 4 - -=item B I - -=item B I - -=item B I - -Set the I, in milliseconds, after which to expire the notification -for C, C and C severities respectively. If zero has -been specified, the displayed notification will not be closed at all - the -user has to do so herself. These options default to 5000. If a negative number -has been specified, the default is used as well. - -=back - =head2 Plugin C =over 4 @@ -896,6 +870,32 @@ and are checked by default depends on the distribution you use. =back +=head2 Plugin C + +This plugin sends a desktop notification to a notification daemon, as defined +in the Desktop Notification Specification. To actually display the +notifications, B is required and B has to be +able to access the X server. + +The Desktop Notification Specification can be found at +L. + +=over 4 + +=item B I + +=item B I + +=item B I + +Set the I, in milliseconds, after which to expire the notification +for C, C and C severities respectively. If zero has +been specified, the displayed notification will not be closed at all - the +user has to do so herself. These options default to 5000. If a negative number +has been specified, the default is used as well. + +=back + =head2 Plugin C =over 4 diff --git a/src/desktop_notification.c b/src/notify_desktop.c similarity index 85% rename from src/desktop_notification.c rename to src/notify_desktop.c index 3b6af07f..822b5066 100644 --- a/src/desktop_notification.c +++ b/src/notify_desktop.c @@ -1,5 +1,5 @@ /** - * collectd - src/desktop_notification.c + * collectd - src/notify_desktop.c * Copyright (C) 2008 Sebastian Harl * * This program is free software; you can redistribute it and/or modify it @@ -30,9 +30,9 @@ #include #include -#define log_info(...) INFO ("desktop_notification: " __VA_ARGS__) -#define log_warn(...) WARNING ("desktop_notification: " __VA_ARGS__) -#define log_err(...) ERROR ("desktop_notification: " __VA_ARGS__) +#define log_info(...) INFO ("notify_desktop: " __VA_ARGS__) +#define log_warn(...) WARNING ("notify_desktop: " __VA_ARGS__) +#define log_err(...) ERROR ("notify_desktop: " __VA_ARGS__) #define DEFAULT_TIMEOUT 5000 @@ -111,9 +111,9 @@ static int c_notify (const notification_t *n) static int c_notify_shutdown (void) { - plugin_unregister_init ("desktop_notification"); - plugin_unregister_notification ("desktop_notification"); - plugin_unregister_shutdown ("desktop_notification"); + plugin_unregister_init ("notify_desktop"); + plugin_unregister_notification ("notify_desktop"); + plugin_unregister_shutdown ("notify_desktop"); if (notify_is_initted ()) notify_uninit (); @@ -144,15 +144,15 @@ static int c_notify_init (void) free (spec_version); } - plugin_register_notification ("desktop_notification", c_notify); - plugin_register_shutdown ("desktop_notification", c_notify_shutdown); + plugin_register_notification ("notify_desktop", c_notify); + plugin_register_shutdown ("notify_desktop", c_notify_shutdown); return 0; } /* c_notify_init */ void module_register (void) { - plugin_register_complex_config ("desktop_notification", c_notify_config); - plugin_register_init ("desktop_notification", c_notify_init); + plugin_register_complex_config ("notify_desktop", c_notify_config); + plugin_register_init ("notify_desktop", c_notify_init); return; } /* module_register */ -- 2.11.0