diff options
author | Christian Hesse <mail@eworm.de> | 2013-07-25 09:13:15 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-07-25 09:13:15 +0200 |
commit | 389c123beb48dab2c8a179b86e4f697b6bbd6c4d (patch) | |
tree | ce78363bdd6a0c297b6c6d3a8de0ebc7e0bd55fe | |
parent | 376da7534b1065febfd878a40a14ba6d981ea35b (diff) | |
download | mpd-notification-389c123beb48dab2c8a179b86e4f697b6bbd6c4d.tar.gz mpd-notification-389c123beb48dab2c8a179b86e4f697b6bbd6c4d.tar.zst |
introduce config.h
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | config.def.h | 11 | ||||
-rw-r--r-- | mpd-notification.c | 10 |
4 files changed, 19 insertions, 9 deletions
@@ -1,4 +1,5 @@ *~ *.o +config.h mpd-notification README.html @@ -3,6 +3,7 @@ CC := gcc MD := markdown INSTALL := install +CP := cp RM := rm CFLAGS += -O2 -Wall -Werror CFLAGS += $(shell pkg-config --cflags --libs libmpdclient) \ @@ -11,10 +12,13 @@ VERSION = $(shell git describe --tags --long) all: mpd-notification README.html -mpd-notification: mpd-notification.c +mpd-notification: mpd-notification.c config.h $(CC) $(CFLAGS) -o mpd-notification mpd-notification.c \ -DVERSION="\"$(VERSION)\"" +config.h: + $(CP) config.def.h config.h + README.html: README.md $(MD) README.md > README.html diff --git a/config.def.h b/config.def.h new file mode 100644 index 0000000..0047f7d --- /dev/null +++ b/config.def.h @@ -0,0 +1,11 @@ +/* name of the icon used for notifications */ +#define ICON_SOUND "sound" + +/* strings used to display notification messages + * TEXT_PLAY needs to include three '%s', in order: + * title, artist, album */ +#define TEXT_TOPIC "MPD Notification" +#define TEXT_PLAY "Playing <b>%s</b>\nby <i>%s</i>\nfrom <i>%s</i>" +#define TEXT_PAUSE "Paused playback" +#define TEXT_STOP "Stopped playback" +#define TEXT_UNKNOWN "(unknown)" diff --git a/mpd-notification.c b/mpd-notification.c index 6baa627..6ce248b 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -14,6 +14,8 @@ #include <stdlib.h> #include <string.h> +#include "config.h" + #define PROGNAME "mpd-notification" #define NOTIFICATION_TIMEOUT 10000 @@ -21,14 +23,6 @@ #define DEBUG 0 #endif -#define ICON_SOUND "sound" - -#define TEXT_TOPIC "MPD Notification" -#define TEXT_PLAY "Playing <b>%s</b>\nby <i>%s</i>\nfrom <i>%s</i>" -#define TEXT_PAUSE "Paused playback" -#define TEXT_STOP "Stopped playback" -#define TEXT_UNKNOWN "(unknown)" - int main(int argc, char ** argv) { char * album = NULL, * artist = NULL, * notifystr = NULL, * title = NULL; GError * error = NULL; |