#!/linuxSucks/Install and setup dmenu

Feb 21, 2021

Install dmenu

Arch Linux

sudo pacman -S dmenu

Debian/Ubuntu

sudo apt install dmenu

Void Linux

sudo xbps-install dmenu

The problem to install dmenu form the official repos is that it will be hard to custom or add patches to it

Install dmenu from source

I think the best way to install dmenu is from source

git clone https://git.suckless.org/dmenu

When git finish to clone it, get into the dmenu directory and then run

sudo make clean install

But that isn’t fun… Let’s change some parameters and add some patches to make it better, this is an example of my config.h

/* See LICENSE file for copyright and license details. */
/* 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 min_width = 500;                    /* minimum width when centered */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {
	"monospace:size=11"
};
static const char *prompt      = NULL;      /* -p  option; prompt to the left of input field */
static const char *colors[SchemeLast][2] = {
	/*     fg         bg       */
	[SchemeNorm] = { "#383A59", "#1E1F29" },
	[SchemeSel]  = { "#FAF9FA", "#383A59" },
	[SchemeOut]  = { "#000000", "#1E1F29" },
};
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines      = 0;
/* -h option; minimum height of a menu line */
static unsigned int lineheight = 22;
static unsigned int min_lineheight = 8;

/*
 * Characters not considered part of a word while deleting words
 * for example: " /?\"&[]"
 */
static const char worddelimiters[] = " ";

/* Size of the window border */
static const unsigned int border_width = 1;

I change the font and size, and add some colors, also before you play with this example you need run some patches

Save this patches in you dmenu directory

Center

wget https://tools.suckless.org/dmenu/patches/center/dmenu-center-4.8.diff

Border

wget https://tools.suckless.org/dmenu/patches/border/dmenu-border-4.9.diff

Mouse support

wget https://tools.suckless.org/dmenu/patches/mouse-support/dmenu-mousesupport-5.0.diff

Now, to apply the patches run

patch -p1 < dmenu-center-4.8.diff
patch -p1 < dmenu-border-4.9.diff
patch -p1 < dmenu-mousesupport-5.0.diff

If everything goes well, you wont see any errors in the terminal, now install your new build of dmenu

sudo make clean install

Now test the new install of dmenu, you need a shortcut or keybindin in your system

For moere information, patches and scripts go to suckless.org

Home  Linux  Notes  Blog Spot