aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Potocki <dawid@dawidpotocki.com>2021-03-01 22:28:48 +1300
committerDawid Potocki <dawid@dawidpotocki.com>2021-03-01 22:28:48 +1300
commitb353b2dae9c794ea0af1f3cc7b104e351438ccc2 (patch)
tree80775b92357c1dfce092e69ce2936713ffe9022c
parent96cbb453e5373c05372fd4bf3faacfa53e409067 (diff)
Apply few personal changesHEADmaster
-rw-r--r--Makefile23
-rw-r--r--blocks.def.h11
-rw-r--r--config.h18
-rw-r--r--dwmblocks.c2
4 files changed, 33 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index ef43ef4..90fb1a4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,22 @@
-PREFIX ?= /usr/local
-CC ?= cc
-LDFLAGS = -lX11
+.POSIX:
-output: dwmblocks.c blocks.def.h blocks.h
- ${CC} dwmblocks.c $(LDFLAGS) -o dwmblocks
-blocks.h:
- cp blocks.def.h $@
+PREFIX = /usr/local
+CC = cc
+dwmblocks: dwmblocks.o
+ $(CC) dwmblocks.o -lX11 -o dwmblocks
+dwmblocks.o: dwmblocks.c config.h
+ $(CC) -c dwmblocks.c
clean:
rm -f *.o *.gch dwmblocks
-install: output
+
+install: dwmblocks
mkdir -p $(DESTDIR)$(PREFIX)/bin
- install -m 0755 dwmblocks $(DESTDIR)$(PREFIX)/bin/dwmblocks
+ cp -f dwmblocks $(DESTDIR)$(PREFIX)/bin
+ chmod 755 $(DESTDIR)$(PREFIX)/bin/dwmblocks
+
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks
+
+.PHONY: clean install uninstall
diff --git a/blocks.def.h b/blocks.def.h
deleted file mode 100644
index 9c22d68..0000000
--- a/blocks.def.h
+++ /dev/null
@@ -1,11 +0,0 @@
-//Modify this file to change what commands output to your statusbar, and recompile using the make command.
-static const Block blocks[] = {
- /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
- {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
-
- {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
-};
-
-//sets delimeter between status commands. NULL character ('\0') means no delimeter.
-static char delim[] = " | ";
-static unsigned int delimLen = 5;
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..f8b2e3b
--- /dev/null
+++ b/config.h
@@ -0,0 +1,18 @@
+/* Modify this file to change what commands output to your statusbar, and
+ * recompile using the make command. */
+static const Block blocks[] = {
+ /* icon command interval update signal */
+ { "", "bar-covid-19", 3600, 19 },
+ { "", "bar-networking", 10, 0 },
+ { "", "bar-audio", 2, 1 },
+ { "", "bar-battery", 10, 0 },
+ { "", "bar-time", 1, 0 },
+};
+
+/* Sets delimeter between status commands. NULL character ('\0') means no
+ * delimeter. */
+static char delim[] = " | ";
+static unsigned int delimLen = 5;
+
+/* vim: ft=c
+ */
diff --git a/dwmblocks.c b/dwmblocks.c
index ded717c..667a8e4 100644
--- a/dwmblocks.c
+++ b/dwmblocks.c
@@ -48,7 +48,7 @@ static void (*writestatus) () = pstdout;
#endif
-#include "blocks.h"
+#include "config.h"
static char statusbar[LENGTH(blocks)][CMDLENGTH] = {0};
static char statusstr[2][STATUSLENGTH];