sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dmenu-listfullwidth-5.0.diff (1492B)


      1 From 7a045242afac6db70a4aee6e3ac0146cdb264277 Mon Sep 17 00:00:00 2001
      2 From: Alex Cole <ajzcole@airmail.cc>
      3 Date: Sun, 4 Oct 2020 19:58:32 +1300
      4 Subject: [PATCH] listfullwidth patch changes
      5 
      6 ---
      7  config.def.h | 1 +
      8  dmenu.c      | 5 +++--
      9  2 files changed, 4 insertions(+), 2 deletions(-)
     10 
     11 diff --git a/config.def.h b/config.def.h
     12 index 1edb647..221db00 100644
     13 --- a/config.def.h
     14 +++ b/config.def.h
     15 @@ -2,6 +2,7 @@
     16  /* Default settings; can be overriden by command line. */
     17  
     18  static int topbar = 1;                      /* -b  option; if 0, dmenu appears at bottom     */
     19 +static int colorprompt = 1;                /* -p  option; if 1, prompt uses SchemeSel, otherwise SchemeNorm */
     20  /* -fn option overrides fonts[0]; default X11 font or font set */
     21  static const char *fonts[] = {
     22  	"monospace:size=10"
     23 diff --git a/dmenu.c b/dmenu.c
     24 index 65f25ce..f73f299 100644
     25 --- a/dmenu.c
     26 +++ b/dmenu.c
     27 @@ -137,7 +137,8 @@ drawmenu(void)
     28  	drw_rect(drw, 0, 0, mw, mh, 1, 1);
     29  
     30  	if (prompt && *prompt) {
     31 -		drw_setscheme(drw, scheme[SchemeSel]);
     32 +		if (colorprompt)
     33 +			drw_setscheme(drw, scheme[SchemeSel]);
     34  		x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0);
     35  	}
     36  	/* draw input field */
     37 @@ -154,7 +155,7 @@ drawmenu(void)
     38  	if (lines > 0) {
     39  		/* draw vertical list */
     40  		for (item = curr; item != next; item = item->right)
     41 -			drawitem(item, x, y += bh, mw - x);
     42 +			drawitem(item, 0, y += bh, mw - x);
     43  	} else if (matches) {
     44  		/* draw horizontal list */
     45  		x += inputw;
     46 -- 
     47 2.28.0
     48