summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNPScript <nathan@reinerweb.ch>2022-06-11 09:38:19 +0200
committerNPScript <nathan@reinerweb.ch>2022-06-11 09:38:19 +0200
commit51c35640d632fbc0ae5a9eecb7e40fa995ae8ee8 (patch)
treee5ac9eb75d56617fde509ee9ae31647bab9a6237
parentd5636d58a5441def8f4c2223fdf4419e442858bf (diff)
changes
-rw-r--r--Makefile9
-rw-r--r--config.h2
-rw-r--r--dmenu.c11
-rwxr-xr-xstestbin17744 -> 21536 bytes
4 files changed, 11 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index a03a95c..a3aa70c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
include config.mk
-SRC = drw.c dmenu.c stest.c util.c
+SRC = drw.c dmenu.c
OBJ = $(SRC:.c=.o)
all: options dmenu stest
@@ -29,12 +29,12 @@ stest: stest.o
$(CC) -o $@ stest.o $(LDFLAGS)
clean:
- rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
+ rm -f dmenu $(OBJ) dmenu-$(VERSION).tar.gz
dist: clean
mkdir -p dmenu-$(VERSION)
cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
- drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
+ drw.h util.h dmenu_path dmenu_run $(SRC)\
dmenu-$(VERSION)
tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
gzip dmenu-$(VERSION).tar
@@ -44,9 +44,9 @@ install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
+ chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
- chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
@@ -57,7 +57,6 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
$(DESTDIR)$(PREFIX)/bin/dmenu_path\
$(DESTDIR)$(PREFIX)/bin/dmenu_run\
- $(DESTDIR)$(PREFIX)/bin/stest\
$(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
$(DESTDIR)$(MANPREFIX)/man1/stest.1
diff --git a/config.h b/config.h
index 6bd4312..7745597 100644
--- a/config.h
+++ b/config.h
@@ -16,7 +16,7 @@ static const char *colors[SchemeLast][2] = {
};
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 20;
-static unsigned int gapxx = 10;
+static unsigned int gapxx = 0;
static unsigned int border = 10;
static unsigned int borderline = 1;
diff --git a/dmenu.c b/dmenu.c
index 8463b4c..446ff0e 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -116,6 +116,7 @@ cistrstr(const char *s, const char *sub)
static int
drawitem(struct item *item, int x, int y, int w)
{
+ int zl = lines == 0;
if (item == sel)
drw_setscheme(drw, scheme[SchemeSel]);
else if (item->out)
@@ -123,7 +124,7 @@ drawitem(struct item *item, int x, int y, int w)
else
drw_setscheme(drw, scheme[SchemeNorm]);
- return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
+ return drw_text(drw, x, y + (borderline) * zl, w, bh + (border - borderline) * zl, lrpad / 2, item->text, 0);
}
static void
@@ -157,7 +158,7 @@ drawmenu(void)
drw_rect(drw, x + curpos + border + 2, border, 2, bh - border / 2 - 4, 1, 0);
}
- if (lines > 0) {
+ if (lines > 0 && matches) {
/* draw vertical list */
y += 2 * border;
for (item = curr; item != next; item = item->right)
@@ -168,7 +169,7 @@ drawmenu(void)
w = TEXTW("<");
if (curr->left) {
drw_setscheme(drw, scheme[SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, "<", 0);
+ drw_text(drw, x, 0, w, bh + border, lrpad / 2, "<", 0);
}
x += w;
for (item = curr; item != next; item = item->right)
@@ -176,7 +177,7 @@ drawmenu(void)
if (next) {
w = TEXTW(">");
drw_setscheme(drw, scheme[SchemeNorm]);
- drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0);
+ drw_text(drw, mw - w, 0, w, bh + border, lrpad / 2, ">", 0);
}
}
drw_map(drw, win, 0, 0, mw, mh);
@@ -617,7 +618,7 @@ setup(void)
/* calculate menu geometry */
bh = drw->fonts->h + 2 * border / 2;
lines = MAX(lines, 0);
- mh = (lines + 1) * bh + 3 * border;
+ mh = (lines + 1) * bh + border * (1 + 2 * (lines > 0));
#ifdef XINERAMA
i = 0;
if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
diff --git a/stest b/stest
index c93eed0..bb439ef 100755
--- a/stest
+++ b/stest
Binary files differ