diff --git a/Makefile b/Makefile index c81b28d..0e4f604 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,9 @@ config.h: config.def.h @echo creating $@ from $< @cp $< $@ -dunst: ${OBJ} +dunst: ${OBJ} main.o @echo "${CC} ${CFLAGS} -o $@ ${OBJ} ${LDFLAGS}" - @${CC} ${CFLAGS} -o $@ ${OBJ} ${LDFLAGS} + @${CC} ${CFLAGS} -o $@ ${OBJ} main.o ${LDFLAGS} dunstify: @${CC} ${CFLAGS} -o $@ dunstify.c -std=c99 $(shell pkg-config --libs --cflags glib-2.0 libnotify) @@ -45,7 +45,7 @@ debug: ${OBJ} @${CC} ${CFLAGS} -O0 -o dunst ${OBJ} ${LDFLAGS} clean-dunst: - rm -f dunst ${OBJ} + rm -f dunst ${OBJ} main.o rm -f org.knopwob.dunst.service clean-dunstify: diff --git a/main.c b/main.c new file mode 100644 index 0000000..e31b420 --- /dev/null +++ b/main.c @@ -0,0 +1,7 @@ +#include "src/dunst.h" + +int main(int argc, char *argv[]) +{ + return dunst_main(argc, argv); +} +/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/dunst.c b/src/dunst.c index a0debc0..11d347b 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -313,7 +313,7 @@ static void teardown(void) x_free(); } -int main(int argc, char *argv[]) +int dunst_main(int argc, char *argv[]) { history = g_queue_new(); diff --git a/src/dunst.h b/src/dunst.h index 805cb50..b2bc025 100644 --- a/src/dunst.h +++ b/src/dunst.h @@ -35,6 +35,8 @@ extern const char *color_strings[3][3]; gboolean run(void *data); void wake_up(void); +int dunst_main(int argc, char *argv[]); + void check_timeouts(void); void history_pop(void); void history_push(notification *n);