dmenu-dmenupadding-20250627-b1e217b.diff - sites - public wiki contents of suckless.org
 (HTM) git clone git://git.suckless.org/sites
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       dmenu-dmenupadding-20250627-b1e217b.diff (1522B)
       ---
            1 From 64b8bbdc00a0fea6af5855bd56c7b92589cdfdcd Mon Sep 17 00:00:00 2001
            2 From: lorcan <lorcantodea@gmail.com>
            3 Date: Fri, 27 Jun 2025 19:58:45 -0400
            4 Subject: [PATCH] port of the dwm statuspadding patch for dmenu
            5 
            6 ---
            7  config.def.h | 2 ++
            8  dmenu.c      | 4 ++--
            9  2 files changed, 4 insertions(+), 2 deletions(-)
           10 
           11 diff --git a/config.def.h b/config.def.h
           12 index 1edb647..a8258e6 100644
           13 --- a/config.def.h
           14 +++ b/config.def.h
           15 @@ -2,6 +2,8 @@
           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 horizpadbar = 2;                 /* horizontal padding */
           20 +static int vertpadbar = 0;                  /* vertical padding */
           21  /* -fn option overrides fonts[0]; default X11 font or font set */
           22  static const char *fonts[] = {
           23          "monospace:size=10"
           24 diff --git a/dmenu.c b/dmenu.c
           25 index fd49549..6bc6d78 100644
           26 --- a/dmenu.c
           27 +++ b/dmenu.c
           28 @@ -633,7 +633,7 @@ setup(void)
           29          utf8 = XInternAtom(dpy, "UTF8_STRING", False);
           30  
           31          /* calculate menu geometry */
           32 -        bh = drw->fonts->h + 2;
           33 +        bh = drw->fonts->h + vertpadbar;
           34          lines = MAX(lines, 0);
           35          mh = (lines + 1) * bh;
           36  #ifdef XINERAMA
           37 @@ -774,7 +774,7 @@ main(int argc, char *argv[])
           38          drw = drw_create(dpy, screen, root, wa.width, wa.height);
           39          if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
           40                  die("no fonts could be loaded.");
           41 -        lrpad = drw->fonts->h;
           42 +        lrpad = drw->fonts->h + horizpadbar;
           43  
           44  #ifdef __OpenBSD__
           45          if (pledge("stdio rpath", NULL) == -1)
           46 -- 
           47 2.50.0
           48