aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--config.def.h9
-rw-r--r--noice.c10
3 files changed, 16 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 19b52d3..29ca2b6 100644
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,14 @@ BIN = noice
all: $(BIN)
-$(BIN): $(OBJ)
+$(BIN): config.h $(OBJ)
$(CC) -o $@ $(OBJ) $(LDLIBS)
-noice.o: noice.c queue.h util.h
+config.h:
+ @echo copying config.def.h to $@
+ @cp config.def.h $@
+
+noice.o: noice.c util.h
$(CC) -c noice.c
strlcpy.o: strlcpy.c util.h
diff --git a/config.def.h b/config.def.h
new file mode 100644
index 0000000..cebb942
--- /dev/null
+++ b/config.def.h
@@ -0,0 +1,9 @@
+/* Configuration */
+struct assoc assocs[] = {
+ { "\\.(avi|mp4|mkv|mp3|ogg)$", "mplayer" },
+ { "\\.(png|jpg|gif)$", "feh" },
+ { "\\.(html|svg)$", "firefox" },
+ { "\\.pdf$", "mupdf" },
+ { "\\.sh$", "sh" },
+ { ".*", "less" },
+};
diff --git a/noice.c b/noice.c
index 0420cc3..d78cf5e 100644
--- a/noice.c
+++ b/noice.c
@@ -43,15 +43,7 @@ struct assoc {
char *bin; /* Program */
};
-/* Configuration */
-struct assoc assocs[] = {
- { "\\.(avi|mp4|mkv|mp3|ogg)$", "mplayer" },
- { "\\.(png|jpg|gif)$", "feh" },
- { "\\.(html|svg)$", "firefox" },
- { "\\.pdf$", "mupdf" },
- { "\\.sh$", "sh" },
- { ".*", "less" },
-};
+#include "config.h"
struct entry {
char *name;