diff --git a/Makefile.am b/Makefile.am index 5352166f..7d0ce9c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,10 +59,10 @@ CLEANFILES += defconfig.h BUILT_SOURCES += defconfig.h defconfig.h: awesomerc @echo "generating defconfig.h from awesomerc" - @echo "#define AWESOME_DEFAULT_CONFIG \\" > defconfig.h + @echo "static const char *AWESOME_DEFAULT_CONFIG = " > defconfig.h @echo -n "\"" >> defconfig.h - @$(SED) 's,\\,\\\\,g;s/$$/ \\/;s/"/\\"/g' "awesomerc" >> defconfig.h - @echo "\"" >> defconfig.h + @$(SED) 's,\\,\\\\,g;s/$$/ \\n\\/;s/"/\\"/g' "awesomerc" >> defconfig.h + @echo "\";" >> defconfig.h CLEANFILES += uicbgen.h BUILT_SOURCES += uicbgen.h diff --git a/config.c b/config.c index dcfa0122..3f1549b9 100644 --- a/config.c +++ b/config.c @@ -533,7 +533,7 @@ config_parse(const char *confpatharg) if(defconfig) { - cfg_print(cfg, defconfig); + fwrite(AWESOME_DEFAULT_CONFIG, a_strlen(AWESOME_DEFAULT_CONFIG), 1, defconfig); fclose(defconfig); }