dmenu

[fork] X11 menuing
Log | Files | Refs | README | LICENSE

commit 506bff1a89961b657a6fc6638fbae317d59f1d85
parent 38f2f2537e1c5edc28e830108ff705b9ad0c2adf
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Thu, 26 Dec 2019 12:20:05 +0000

..

Diffstat:
Mconfig.def.h | 2+-
Mconfig.h | 6++++--
Mdmenu.c | 7++++---
Mdmenu_run | 5++---
4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -11,7 +11,7 @@ static const char *fonts[] = { static const char *prompt = NULL; /* -p option; prompt to the left of input field */ static const char *colors[SchemeLast][2] = { /* fg bg */ - [SchemeNorm] = { "#ffffff", "#090711" }, + [SchemeNorm] = { "#ffffff", "#0c0a14" }, [SchemeSel] = { "#ffffff", "#0a3439" }, [SchemeOut] = { "#000000", "#00ffff" }, [SchemeMid] = { "#ffffff", "#141726" }, diff --git a/config.h b/config.h @@ -2,8 +2,10 @@ /* Default settings; can be overriden by command line. */ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ -static int centered = 0; /* -c option; centers dmenu on screen */ +static int centered = 1; /* -c option; centers dmenu on screen */ static int fuzzy = 1; +static int lineheight = 20; +static unsigned int dmw = 1000; /* -fn option overrides fonts[0]; default X11 font or font set */ static const char *fonts[] = { "monospace:size=8" @@ -11,7 +13,7 @@ static const char *fonts[] = { static const char *prompt = NULL; /* -p option; prompt to the left of input field */ static const char *colors[SchemeLast][2] = { /* fg bg */ - [SchemeNorm] = { "#ffffff", "#090711" }, + [SchemeNorm] = { "#ffffff", "#0c0a14" }, [SchemeSel] = { "#ffffff", "#0a3439" }, [SchemeOut] = { "#000000", "#00ffff" }, [SchemeMid] = { "#ffffff", "#090711" }, diff --git a/dmenu.c b/dmenu.c @@ -42,7 +42,6 @@ static char numbers[NUMBERSBUFSIZE] = ""; static char text[BUFSIZ] = ""; static char *embed; static int bh, mw, mh; -static unsigned int dmw = 0; static int inputw = 0, promptw, passwd = 0; static int lrpad; /* sum of left and right padding */ static size_t cursor; @@ -50,7 +49,6 @@ static struct item *items = NULL; static struct item *matches, *matchend; static struct item *prev, *curr, *next, *sel; static int mon = -1, screen; -static unsigned int lineheight = 0; static Atom clip, utf8; static Display *dpy; @@ -194,6 +192,9 @@ drawmenu(void) if (lines > 0) { /* draw vertical list */ for (item = curr; item != next; item = item->right) { + if (passwd) { + /* please add */ + } drawitem(item, x, y += bh, mw - x); } } else if (matches) { @@ -338,7 +339,7 @@ static void match(void) { /* Couldn't evaluate (fuzzy) for some reason, instead set to always true */ - if ((0<1)) { + if (fuzzy) { fuzzymatch(); return; } diff --git a/dmenu_run b/dmenu_run @@ -1,4 +1,3 @@ #!/bin/bash -. $HOME/.dmenurc -dir=$(echo $PATH | tr ":" " ") -find $dir -maxdepth 1 -executable -not -type d -printf "%f\n" | sort | $dmenu "$@" | ${SHELL:-"/bin/bash"} & +dir=$(echo $PATH | tr ":" " " | sed 's/\.$//g') +find $dir -maxdepth 1 -executable -not -type d -printf "%f\n" | sort | dmenu "$@" | ${SHELL:-"/bin/bash"}