From b353b2dae9c794ea0af1f3cc7b104e351438ccc2 Mon Sep 17 00:00:00 2001 From: Dawid Potocki Date: Mon, 1 Mar 2021 22:28:48 +1300 Subject: Apply few personal changes --- Makefile | 23 ++++++++++++++--------- blocks.def.h | 11 ----------- config.h | 18 ++++++++++++++++++ dwmblocks.c | 2 +- 4 files changed, 33 insertions(+), 21 deletions(-) delete mode 100644 blocks.def.h create mode 100644 config.h 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]; -- cgit v1.2.3-54-g00ecf