commit 4af4c3825fad7381288400ef15944ebe85bb71bf
parent 355136a1ca8fc746633650d982c2022132ebcd9a
Author: Kris Maglione <jg@suckless.org>
Date: Thu, 17 Sep 2009 09:27:11 -0400
Makefile cleanup and other general cleanup.
Diffstat:
11 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/alternative_wmiircs/python/wmiirc.py b/alternative_wmiircs/python/wmiirc.py
@@ -140,7 +140,7 @@ def clickmenu(choices, args):
class Notice(Button):
def __init__(self):
- super(Notice, self).__init__(*noticebar)
+ super(Notice, self).__init__(*noticebar, colors=wmii['normcolors'])
self.timer = None
def tick(self):
diff --git a/cmd/Makefile b/cmd/Makefile
@@ -23,7 +23,7 @@ FILTER = sed "s|CONFPREFIX|$(ETC)|g; \
s|AWKPATH|$(AWKPATH)|g"
LDFLAGS += -lfmt -lutf
-CFLAGS += $(INCX11) -DVERSION=\"$(VERSION)\"
+CFLAGS += $(INCX11)
include $(ROOT)/mk/many.mk
include $(ROOT)/mk/dir.mk
diff --git a/cmd/menu/Makefile b/cmd/menu/Makefile
@@ -16,7 +16,7 @@ PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama
LIB = $(LIBIXP)
LDFLAGS += -lm -lregexp9 -lbio -lfmt -lutf
-CFLAGS += -DVERSION=\"$(VERSION)\" -DIXP_NEEDAPI=86
+CFLAGS += -DIXP_NEEDAPI=86
OBJ = main \
caret \
history \
diff --git a/cmd/menu/fns.h b/cmd/menu/fns.h
@@ -21,6 +21,7 @@ void debug(int, const char*, ...);
Item* filter_list(Item*, char*);
void init_screens(int);
void update_filter(bool);
+void update_input(void);
/* menu.c */
void menu_draw(void);
diff --git a/cmd/menu/main.c b/cmd/menu/main.c
@@ -14,7 +14,7 @@
#include "fns.h"
#define link _link
-static const char version[] = "wimenu-"VERSION", ©2009 Kris Maglione\n";
+static const char version[] = "wimenu-"VERSION", "COPYRIGHT"\n";
static Biobuf* cmplbuf;
static Biobuf* inbuf;
static bool alwaysprint;
@@ -141,6 +141,15 @@ filter_list(Item *i, char *filter) {
}
void
+update_input(void) {
+ if(alwaysprint) {
+ write(1, input.string, input.pos - input.string);
+ write(1, "", 1);
+ write(1, input.pos, input.end - input.pos + 1);
+ }
+}
+
+void
update_filter(bool print) {
char *filter;
@@ -150,11 +159,8 @@ update_filter(bool print) {
matchidx = nil;
matchfirst = matchstart = filter_list(items, filter);
- if(alwaysprint && print) {
- write(1, input.string, input.pos - input.string);
- write(1, "", 1);
- write(1, input.pos, input.end - input.pos + 1);
- }
+ if(print)
+ update_input();
}
/*
@@ -264,6 +270,9 @@ main(int argc, char *argv[]) {
case 's':
screen = strtol(EARGF(usage()), nil, 10);
break;
+ case 'v':
+ print("%s", version);
+ return 0;
default:
usage();
}ARGEND;
diff --git a/cmd/menu/menu.c b/cmd/menu/menu.c
@@ -95,6 +95,7 @@ next:
case BACKWARD:
case FORWARD:
caret_move(op, motion);
+ update_input();
break;
case CMPL_NEXT:
selectitem(matchidx ? matchidx->next : matchfirst);
@@ -298,19 +299,14 @@ kdown_event(Window *w, XKeyEvent *e) {
menu_cmd(BACKWARD, amount);
break;
case LCOMPLETE:
- amount = CMPL_NEXT;
- if(have(LNEXT))
- amount = CMPL_NEXT;
- else if(have(LPREV))
- amount = CMPL_PREV;
- else if(have(LNEXTPAGE))
- amount = CMPL_NEXT_PAGE;
- else if(have(LPREVPAGE))
- amount = CMPL_PREV_PAGE;
- else if(have(LFIRST))
- amount = CMPL_FIRST;
- else if(have(LLAST))
- amount = CMPL_LAST;
+ amount = (
+ have(LNEXT) ? CMPL_NEXT :
+ have(LPREV) ? CMPL_PREV :
+ have(LNEXTPAGE) ? CMPL_NEXT_PAGE :
+ have(LPREVPAGE) ? CMPL_PREV_PAGE :
+ have(LFIRST) ? CMPL_FIRST :
+ have(LLAST) ? CMPL_LAST :
+ CMPL_NEXT);
menu_cmd(amount, 0);
break;
case LFORWARD:
diff --git a/cmd/wmii/Makefile b/cmd/wmii/Makefile
@@ -12,8 +12,7 @@ PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama
LIB = $(LIBIXP)
LDFLAGS += -lm $(LIBICONV) -lregexp9 -lbio -lfmt -lutf
-CFLAGS += $(INCICONV) -DVERSION=\"$(VERSION)\" \
- -DIXP_NEEDAPI=97
+CFLAGS += $(INCICONV) -DIXP_NEEDAPI=97
OBJ = area \
bar \
client \
diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c
@@ -16,7 +16,7 @@
#include "fns.h"
static const char
- version[] = "wmii-"VERSION", ©2009 Kris Maglione\n";
+ version[] = "wmii-"VERSION", "COPYRIGHT"\n";
static char* address;
static char* ns_path;
diff --git a/cmd/wmiir.c b/cmd/wmiir.c
@@ -384,7 +384,7 @@ main(int argc, char *argv[]) {
ARGBEGIN{
case 'v':
- print("%s-" VERSION ", ©2009 Kris Maglione\n", argv0);
+ print("%s-" VERSION ", " COPYRIGHT "\n", argv0);
exit(0);
case 'a':
address = EARGF(usage());
diff --git a/mk/wmii.mk b/mk/wmii.mk
@@ -4,4 +4,6 @@ VERSION = $(VERS)
VERSION := $(shell echo $(VERS))
VERSION != echo $(VERS)
CONFVERSION = -hg
+COPYRIGHT = ©2009 Kris Maglione
+CFLAGS += '-DVERSION=\"$(VERSION)\"' '-DCOPYRIGHT=\"$(COPYRIGHT)\"'
diff --git a/util/compile b/util/compile
@@ -9,7 +9,7 @@ xtmp=/tmp/cc.$$.$USER.out
echo CC $($bin/cleanname ${BASE}$outfile)
[ -n "$noisycc" ] && echo $CC -o $outfile $CFLAGS $@
-$CC -o $outfile $CFLAGS $@ >$xtmp 2>&1
+eval '$CC -o $outfile '"$CFLAGS"' $@ >$xtmp 2>&1'
status=$?
[ $? -eq 0 ] || echo $CC -o $outfile $CFLAGS $@ >&2