dmenu Configuration^

As with many tools from Suckless, dmenu derives its configuration at compile-time from a config.h header file. If you want to modify the default configuration, you can either update the config.h and recompile, or run dmenu with overrides specified by certain command-line options.

Default Configuration^

The config.h header file used to configure dmenu does not exist in the repository you clone from upstream. Instead, the repository ships with a config.def.h, which is the definitions file that specifies the default configuration.

If you run a build and config.h does not exist, the Make process generates config.h from config.def.h. From this point, you can modify config.h to add your own bespoke features to dmenu.

Configuration Header^

This section provides a high-level overview of the default dmenu configuration. It notes the given overrides and hopefully provides you with some ideas on how to modify its configuration to build it out to suit your own personal needs.

Top Bar Setting^

The topbar setting is a static integer that controls the placement of the dmenu bar on your screen.

0

Sets dmenu to appear at the bottom of the screen.

1

Sets dmenu to appear at the top of the screen.

You can override the compile-time setting at runtime using the -b option.

static int topbar = 1;

Font Setting^

The dmenu font setting defaults to the default X11 font or font set. In cases where this is undesirable, you can modify the configuration using the fonts static string.

You can override the compile-time setting at runtime using the -fn option.

static const char *fonts[] = {
     "monospace:size=10"
};

Prompt Setting^

The prompt setting specifies a static string constant that appears to the left of the input field. It is disabled by default (with a NULL value), but you can use it to introduce stylistic or functional aspects to your dmenu experience.

You can override the compile-time setting at runtime using the -p option.

static const char *prompt      = NULL;

Color Settings^

The colors string array specifies the scheme dmenu uses to color the types of entries it shows to the user.

SchemeNorm

The input field.

SchemeSel

A selected entry.

SchemeOut

An unselected entry.

Each entry takes an array that contains two entries: a foreground color and a background color.

You cannot override the color scheme at runtime.

static const char *colors[SchemeLast][2] = {
     //               fg           bg
     [SchemeNorm] = { "#bbbbbb",   "#222222" },
     [SchemeSel]  = { "#eeeeee",   "#005577" },
     [SchemeOut]  = { "#000000",   "#00ffff" },
};

Line Setting^

The line settings controls whether dmenu presents its options on a single line or with a vertical list. If lines is set to 0, dmenu returns all entries on a single line. If set to another unsigned integer, dmenu displays its return values as a vertical list of the given number of lines.

You can override the compile-time setting at runtime with the -l option.

static unsigned int lines      = 0;

Delimiter Setting^

The delimiter setting controls the character dmenu uses to delimit entries. That is, whether it should use whitespace or some other value to determine what content is a delimiter and what content is a word to select.

static const char worddelimiters[] = " ";

Generally, the space is a reasonable default.

Modify Configuration^

Any time you make a change to config.h, you need to rebuild dmenu and reinstall it in order to make the updated code available.

$ make
$ sudo make install
$ make clean
dmenu Source Build dwm: The Dynamic Window Manager