Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
/* 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 */
|
2020-05-29 17:01:40 +02:00
|
|
|
#if ALPHA_PATCH
|
2021-07-25 10:09:38 +02:00
|
|
|
static int opacity = 1; /* -o option; if 0, then alpha is disabled */
|
2020-05-29 17:01:40 +02:00
|
|
|
#endif // ALPHA_PATCH
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
#if FUZZYMATCH_PATCH
|
|
|
|
static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */
|
|
|
|
#endif // FUZZYMATCH_PATCH
|
|
|
|
#if INCREMENTAL_PATCH
|
|
|
|
static int incremental = 0; /* -r option; if 1, outputs text each time a key is pressed */
|
|
|
|
#endif // INCREMENTAL_PATCH
|
|
|
|
#if INSTANT_PATCH
|
|
|
|
static int instant = 0; /* -n option; if 1, selects matching item without the need to press enter */
|
|
|
|
#endif // INSTANT_PATCH
|
|
|
|
#if CENTER_PATCH
|
|
|
|
static int center = 1; /* -c option; if 0, dmenu won't be centered on the screen */
|
2020-01-27 09:43:10 +01:00
|
|
|
static int min_width = 500; /* minimum width when centered */
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
#endif // CENTER_PATCH
|
2021-05-17 10:59:48 +02:00
|
|
|
#if RESTRICT_RETURN_PATCH
|
|
|
|
static int restrict_return = 0; /* -1 option; if 1, disables shift-return and ctrl-return */
|
|
|
|
#endif // RESTRICT_RETURN_PATCH
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
/* -fn option overrides fonts[0]; default X11 font or font set */
|
2020-06-13 15:32:41 +02:00
|
|
|
#if PANGO_PATCH
|
|
|
|
static char font[] = "monospace 10";
|
|
|
|
#else
|
2020-03-29 12:45:39 +02:00
|
|
|
#if XRESOURCES_PATCH
|
|
|
|
static char *fonts[] =
|
|
|
|
#else
|
|
|
|
static const char *fonts[] =
|
|
|
|
#endif // XRESOURCES_PATCH
|
|
|
|
{
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
"monospace:size=10"
|
|
|
|
};
|
2020-06-13 15:32:41 +02:00
|
|
|
#endif // PANGO_PATCH
|
2020-08-08 11:28:00 +02:00
|
|
|
#if MANAGED_PATCH
|
|
|
|
static char *prompt = NULL; /* -p option; prompt to the left of input field */
|
|
|
|
#else
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
|
2020-08-08 11:28:00 +02:00
|
|
|
#endif // MANAGED_PATCH
|
2020-08-05 12:27:15 +02:00
|
|
|
#if DYNAMIC_OPTIONS_PATCH
|
|
|
|
static const char *dynamic = NULL; /* -dy option; dynamic command to run on input change */
|
|
|
|
#endif // DYNAMIC_OPTIONS_PATCH
|
2020-08-08 11:07:00 +02:00
|
|
|
#if SYMBOLS_PATCH
|
|
|
|
static const char *symbol_1 = "<";
|
|
|
|
static const char *symbol_2 = ">";
|
|
|
|
#endif // SYMBOLS_PATCH
|
2020-05-29 17:01:40 +02:00
|
|
|
|
|
|
|
#if ALPHA_PATCH
|
|
|
|
static const unsigned int baralpha = 0xd0;
|
|
|
|
static const unsigned int borderalpha = OPAQUE;
|
|
|
|
static const unsigned int alphas[][3] = {
|
|
|
|
/* fg bg border */
|
|
|
|
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
|
2022-03-14 11:26:51 +01:00
|
|
|
#if BORDER_PATCH
|
|
|
|
[SchemeBorder] = { OPAQUE, OPAQUE, OPAQUE },
|
|
|
|
#endif // BORDER_PATCH
|
|
|
|
#if MORECOLOR_PATCH
|
|
|
|
[SchemeMid] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
#endif // MORECOLOR_PATCH
|
|
|
|
#if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
|
|
|
|
[SchemeSelHighlight] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
[SchemeNormHighlight] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
#endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
|
|
|
|
#if HIGHPRIORITY_PATCH
|
|
|
|
[SchemeHp] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
#endif // HIGHPRIORITY_PATCH
|
|
|
|
#if EMOJI_HIGHLIGHT_PATCH
|
|
|
|
[SchemeHover] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
[SchemeGreen] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
[SchemeRed] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
[SchemeYellow] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
[SchemeBlue] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
[SchemePurple] = { OPAQUE, baralpha, borderalpha },
|
|
|
|
#endif // EMOJI_HIGHLIGHT_PATCH
|
2020-05-29 17:01:40 +02:00
|
|
|
};
|
|
|
|
#endif // ALPHA_PATCH
|
|
|
|
|
2021-05-24 13:29:40 +02:00
|
|
|
static
|
|
|
|
#if !XRESOURCES_PATCH
|
|
|
|
const
|
2020-03-29 12:45:39 +02:00
|
|
|
#endif // XRESOURCES_PATCH
|
2021-05-24 13:29:40 +02:00
|
|
|
char *colors[][2] = {
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
/* fg bg */
|
|
|
|
[SchemeNorm] = { "#bbbbbb", "#222222" },
|
|
|
|
[SchemeSel] = { "#eeeeee", "#005577" },
|
|
|
|
[SchemeOut] = { "#000000", "#00ffff" },
|
2022-03-14 11:26:51 +01:00
|
|
|
#if BORDER_PATCH
|
|
|
|
[SchemeBorder] = { "#000000", "#005577" },
|
|
|
|
#endif // BORDER_PATCH
|
2020-08-08 11:57:00 +02:00
|
|
|
#if MORECOLOR_PATCH
|
|
|
|
[SchemeMid] = { "#eeeeee", "#770000" },
|
|
|
|
#endif // MORECOLOR_PATCH
|
2020-08-05 13:19:30 +02:00
|
|
|
#if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
|
2020-04-04 09:58:35 +02:00
|
|
|
[SchemeSelHighlight] = { "#ffc978", "#005577" },
|
|
|
|
[SchemeNormHighlight] = { "#ffc978", "#222222" },
|
2020-08-05 13:19:30 +02:00
|
|
|
#endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
|
2020-08-05 14:54:01 +02:00
|
|
|
#if HIGHPRIORITY_PATCH
|
|
|
|
[SchemeHp] = { "#bbbbbb", "#333333" },
|
|
|
|
#endif // HIGHPRIORITY_PATCH
|
2021-05-24 13:29:40 +02:00
|
|
|
#if EMOJI_HIGHLIGHT_PATCH
|
|
|
|
[SchemeHover] = { "#ffffff", "#353D4B" },
|
|
|
|
[SchemeGreen] = { "#ffffff", "#52E067" },
|
|
|
|
[SchemeRed] = { "#ffffff", "#e05252" },
|
|
|
|
[SchemeYellow] = { "#ffffff", "#e0c452" },
|
|
|
|
[SchemeBlue] = { "#ffffff", "#5280e0" },
|
|
|
|
[SchemePurple] = { "#ffffff", "#9952e0" },
|
|
|
|
#endif // EMOJI_HIGHLIGHT_PATCH
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
};
|
|
|
|
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
|
|
|
|
static unsigned int lines = 0;
|
2020-08-05 11:31:54 +02:00
|
|
|
#if GRID_PATCH
|
|
|
|
/* -g option; if nonzero, dmenu uses a grid comprised of columns and lines */
|
|
|
|
static unsigned int columns = 0;
|
|
|
|
#endif // GRID_PATCH
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
#if LINE_HEIGHT_PATCH
|
|
|
|
static unsigned int lineheight = 0; /* -h option; minimum height of a menu line */
|
2021-05-24 13:29:40 +02:00
|
|
|
static unsigned int min_lineheight = 8;
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
#endif // LINE_HEIGHT_PATCH
|
|
|
|
#if NAVHISTORY_PATCH
|
|
|
|
static unsigned int maxhist = 15;
|
|
|
|
static int histnodup = 1; /* if 0, record repeated histories */
|
|
|
|
#endif // NAVHISTORY_PATCH
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Characters not considered part of a word while deleting words
|
|
|
|
* for example: " /?\"&[]"
|
|
|
|
*/
|
2020-08-08 15:10:00 +02:00
|
|
|
#if PIPEOUT_PATCH
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
static const char startpipe[] = "#";
|
|
|
|
#endif // PIPEOUT_PATCH
|
|
|
|
static const char worddelimiters[] = " ";
|
|
|
|
|
|
|
|
#if BORDER_PATCH
|
|
|
|
/* Size of the window border */
|
2020-02-09 08:48:00 +01:00
|
|
|
static unsigned int border_width = 0;
|
Added border, center, fuzzymatch, incremental, initialtext, instant, line-height, mouse-support, navhistory, non-blocking-stdin, password, pipeout, printinputtext, rejectnomatch, scroll, vertfull, wmtype and xyw patches
2019-09-19 00:33:15 +02:00
|
|
|
#endif // BORDER_PATCH
|
|
|
|
|
|
|
|
#if PREFIXCOMPLETION_PATCH
|
|
|
|
/*
|
|
|
|
* Use prefix matching by default; can be inverted with the -x flag.
|
|
|
|
*/
|
|
|
|
static int use_prefix = 1;
|
|
|
|
#endif // PREFIXCOMPLETION_PATCH
|