From ab48cac19b47d116e8cac05824232668d8c4e6cc Mon Sep 17 00:00:00 2001 From: Ashish Kumar Yadav Date: Wed, 10 Feb 2021 21:19:05 +0530 Subject: [PATCH] Reorganization --- .gitignore | 6 +++--- GNUmakefile | 16 ++++++++-------- config.h | 2 +- daemons/pulse_daemon.sh | 1 + block.h => dwmblocks/block.h | 0 dwmblocks.c => dwmblocks/dwmblocks.c | 2 +- sigdwmblocks.c => sigdwmblocks/sigdwmblocks.c | 0 xgetrootname.c => xgetrootname/xgetrootname.c | 0 8 files changed, 14 insertions(+), 13 deletions(-) rename block.h => dwmblocks/block.h (100%) rename dwmblocks.c => dwmblocks/dwmblocks.c (99%) rename sigdwmblocks.c => sigdwmblocks/sigdwmblocks.c (100%) rename xgetrootname.c => xgetrootname/xgetrootname.c (100%) diff --git a/.gitignore b/.gitignore index 2f27b1b..cf0ad39 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -dwmblocks -sigdwmblocks -xgetrootname +dwmblocks/dwmblocks +sigdwmblocks/sigdwmblocks +xgetrootname/xgetrootname diff --git a/GNUmakefile b/GNUmakefile index e6fdda3..656f39f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -6,25 +6,25 @@ CFLAGS := -O3 -Wall -Wextra X11CFLAGS := $(shell pkg-config --cflags x11) X11LIBS := $(shell pkg-config --libs x11) -all: dwmblocks sigdwmblocks xgetrootname +all: dwmblocks/dwmblocks sigdwmblocks/sigdwmblocks xgetrootname/xgetrootname -dwmblocks: dwmblocks.c config.h block.h +dwmblocks/dwmblocks: dwmblocks/dwmblocks.c config.h dwmblocks/block.h ${CC} -o $@ -Wno-missing-field-initializers -Wno-unused-parameter ${CFLAGS} ${X11CFLAGS} $< ${X11LIBS} -sigdwmblocks: sigdwmblocks.c +sigdwmblocks/sigdwmblocks: sigdwmblocks/sigdwmblocks.c ${CC} -o $@ ${CFLAGS} $< -xgetrootname: xgetrootname.c +xgetrootname/xgetrootname: xgetrootname/xgetrootname.c ${CC} -o $@ ${CFLAGS} ${X11CFLAGS} $< ${X11LIBS} clean: - rm -f dwmblocks sigdwmblocks xgetrootname + rm -f dwmblocks/dwmblocks sigdwmblocks/sigdwmblocks xgetrootname/xgetrootname install: all mkdir -p ${DESTDIR}${PREFIX}/bin - install -m 0755 dwmblocks ${DESTDIR}${PREFIX}/bin/dwmblocks - install -m 0755 sigdwmblocks ${DESTDIR}${PREFIX}/bin/sigdwmblocks - install -m 0755 xgetrootname ${DESTDIR}${PREFIX}/bin/xgetrootname + install -m 0755 dwmblocks/dwmblocks ${DESTDIR}${PREFIX}/bin/dwmblocks + install -m 0755 sigdwmblocks/sigdwmblocks ${DESTDIR}${PREFIX}/bin/sigdwmblocks + install -m 0755 xgetrootname/xgetrootname ${DESTDIR}${PREFIX}/bin/xgetrootname uninstall: rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks ${DESTDIR}${PREFIX}/bin/sigdwmblocks ${DESTDIR}${PREFIX}/bin/xgetrootname diff --git a/config.h b/config.h index 66faa25..f8c173b 100644 --- a/config.h +++ b/config.h @@ -22,7 +22,7 @@ * don't remove DELIMITERENDCHAR at the end */ static const char delimiter[] = { ' ', ' ', ' ', DELIMITERENDCHAR }; -#include "block.h" +#include "dwmblocks/block.h" /* If interval of a block is set to 0, the block will only be updated once at startup. diff --git a/daemons/pulse_daemon.sh b/daemons/pulse_daemon.sh index 1db448d..b26cf69 100755 --- a/daemons/pulse_daemon.sh +++ b/daemons/pulse_daemon.sh @@ -1,4 +1,5 @@ #!/bin/sh +# autostart this on startup for volume block to work pactl subscribe | while read -r output ; do case $output in diff --git a/block.h b/dwmblocks/block.h similarity index 100% rename from block.h rename to dwmblocks/block.h diff --git a/dwmblocks.c b/dwmblocks/dwmblocks.c similarity index 99% rename from dwmblocks.c rename to dwmblocks/dwmblocks.c index 89e19da..087f7d3 100644 --- a/dwmblocks.c +++ b/dwmblocks/dwmblocks.c @@ -14,7 +14,7 @@ #define DELIMITERLENGTH sizeof delimiter -#include "config.h" +#include "../config.h" static void buttonhandler(int sig, siginfo_t *info, void *ucontext); static void cleanup(); diff --git a/sigdwmblocks.c b/sigdwmblocks/sigdwmblocks.c similarity index 100% rename from sigdwmblocks.c rename to sigdwmblocks/sigdwmblocks.c diff --git a/xgetrootname.c b/xgetrootname/xgetrootname.c similarity index 100% rename from xgetrootname.c rename to xgetrootname/xgetrootname.c