Rework Makefile, add config.def.h as default config
authorSamuel Dudik <redacted>
Wed, 19 Aug 2020 19:02:01 +0000 (21:02 +0200)
committerSamuel Dudik <redacted>
Wed, 19 Aug 2020 19:02:01 +0000 (21:02 +0200)
Makefile [new file with mode: 0644]
config.def.h [new file with mode: 0644]
config.h
makefile [deleted file]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..240f4fa
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+CFLAGS = -Wall -Wextra -pedantic -lX11 -lXft -I/usr/include/freetype2 -lm -pthread
+
+PREFIX ?= /usr/local
+CC ?= cc
+
+all: herbe
+
+config.h: config.def.h
+       cp config.def.h config.h
+
+herbe: herbe.c config.h
+       $(CC) herbe.c $(CFLAGS) -o herbe
+
+install: herbe
+       mkdir -p ${DESTDIR}${PREFIX}/bin
+       cp -f herbe ${DESTDIR}${PREFIX}/bin
+
+uninstall:
+       rm -f ${DESTDIR}${PREFIX}/bin/herbe
+
+clean:
+       rm -f herbe
+
+.PHONY: all install uninstall clean
diff --git a/config.def.h b/config.def.h
new file mode 100644 (file)
index 0000000..a30c1e4
--- /dev/null
@@ -0,0 +1,19 @@
+static const char *background_color = "#3e3e3e";
+static const char *border_color = "#ececec";
+static const char *font_color = "#ececec";
+static const char *font_pattern = "Inconsolata:style=Medium:size=12";
+static const unsigned line_spacing = 5;
+static const unsigned int padding = 15;
+
+static const unsigned int width = 450;
+static const unsigned int border_size = 2;
+static const unsigned int pos_x = 30;
+static const unsigned int pos_y = 60;
+
+enum corners { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT };
+enum corners corner = TOP_RIGHT;
+
+static const unsigned int duration = 5; /* in seconds */
+
+#define DISMISS_BUTTON Button1
+#define ACTION_BUTTON Button3
index a27fb681815e1dc992df0feb24c17d7c8945eeb4..3d5d051984f09493a033ae65c08e5597f496be60 100644 (file)
--- a/config.h
+++ b/config.h
@@ -1,4 +1,4 @@
-static const char *background_color = "#3e3e3e";
+static const char *background_color = "#0000FF";
 static const char *border_color = "#ececec";
 static const char *font_color = "#ececec";
 static const char *font_pattern = "Inconsolata:style=Medium:size=12";
@@ -16,4 +16,4 @@ enum corners corner = TOP_RIGHT;
 static const unsigned int duration = 5; /* in seconds */
 
 #define DISMISS_BUTTON Button1
-#define ACTION_BUTTON Button3
\ No newline at end of file
+#define ACTION_BUTTON Button3
diff --git a/makefile b/makefile
deleted file mode 100644 (file)
index dcc5639..0000000
--- a/makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-default:
-       gcc herbe.c -Wall -Wextra -pedantic -lX11 -lXft -I/usr/include/freetype2 -lm -pthread -o herbe
-
-install: default
-       cp herbe /usr/local/bin
-
-uninstall:
-       rm /usr/local/bin/herbe
-
-clean:
-       rm -f herbe