]> Sergey Matveev's repositories - nnn.git/commitdiff
Add config.def.h
authorsin <sin@2f30.org>
Tue, 21 Oct 2014 10:15:27 +0000 (11:15 +0100)
committersin <sin@2f30.org>
Tue, 21 Oct 2014 10:15:27 +0000 (11:15 +0100)
Makefile
config.def.h [new file with mode: 0644]
noice.c

index 19b52d367c622d7a8f8a6e6b8403d5cc4c83c72d..29ca2b676092b935cd18f1b0b1dd46d2d1532cd1 100644 (file)
--- 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 (file)
index 0000000..cebb942
--- /dev/null
@@ -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 0420cc39c779b8c35a47d66ce13ced786272614f..d78cf5e951858368852c305d38a6c7be994bb718 100644 (file)
--- 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;