~andreafeletto/cstatus

cc277d700bffc6d5e18008132d044f6d06ea056f — Andrea Feletto 2 months ago 5070a07 0.1.0
version 0.1.0
3 files changed, 15 insertions(+), 14 deletions(-)

M Makefile
M config.mk
M cstatus.c
M Makefile => Makefile +2 -2
@@ 14,10 14,10 @@ cstatus: ${OBJ}
${OBJ}: blocks.h config.h utils.h

install: cstatus
	install -Dm755 cstatus "${DESTDIR}${PREFIX}/bin/"
	install -Dm755 cstatus "${DESTDIR}${PREFIX}/bin/cstatus"

uninstall:
	rm ${DESTDIR}${PREFIX}/bin/${BIN}
	rm -f "${DESTDIR}${PREFIX}/bin/cstatus"

clean:
	rm -f cstatus ${OBJ}

M config.mk => config.mk +4 -2
@@ 1,7 1,9 @@

DESTDIR ?=
PREFIX ?= /usr/share
PREFIX ?= /usr/local

CC = cc
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os

CPPFLAGS = -D_POSIX_C_SOURCE=200112L
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${CPPFLAGS}
LDFLAGS = -lm

M cstatus.c => cstatus.c +9 -10
@@ 1,6 1,4 @@

#define _POSIX_C_SOURCE 2

#include <pwd.h>
#include <signal.h>
#include <stdio.h>


@@ 12,7 10,7 @@

#include "utils.h"

#define VERSION "0.0.2"
#define VERSION "0.1.0"

static char *prgpath, *prgname;
static char prgdir[256], pidpath[256], logpath[256];


@@ 34,16 32,17 @@ typedef void (*Block)(char *);

void
usage() {
	die( "usage: %s OPTION\n"
	fprintf(stderr, "usage: %s OPTION\n"
		"statusbar for dwm.\n\n"
		"options:\n"
		"\t-h, --help, -?   display this help and exit\n"
		"\t-v, --version    output version information\n"
		"\t-r, --refresh    refresh\n"
		"\t-d, --daemon     start in the background\n"
		"\t-s, --stop       stop daemon if one exists\n\n"
		"git repository: <https://git.sr.ht/~andreafeletto/cstatus>",
		"\t-h    display this help and exit\n"
		"\t-v    output version information\n"
		"\t-r    refresh\n"
		"\t-d    start in the background\n"
		"\t-s    stop daemon if one exists\n\n"
		"git repository: <https://git.sr.ht/~andreafeletto/cstatus>\n",
		prgname);
	exit(EXIT_SUCCESS);
}

void