From 8f8e1aedbd2a5e231099d4e619a79696a7d911f7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 19 Sep 2023 11:06:37 -0400 Subject: [PATCH] create config file for centered layout This commit creates a config.h file for a nice default centered dmenu. In addition to enabling the centered setting, it configures a vertical list using a grid configuration. It also configures XResources to use the color naming scheme I use in other applications and removes settings that I won't ever want XResources to touch. --- config.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 config.h diff --git a/config.h b/config.h new file mode 100644 index 0000000..4f56204 --- /dev/null +++ b/config.h @@ -0,0 +1,58 @@ +/* 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 = 1; /* -c option; centers dmenu on screen */ +static int min_width = 500; /* -cw option; minimum width when centered */ +static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */ + +/* -fn option overrides fonts[0]; default X11 font or font set */ +static char font[] = "monospace:size=10"; +static const char *fonts[] = { + font, + "monospace:size=10", +}; + +static char *prompt = NULL; /* -p option; prompt to the left of input field */ + +static char normfgcolor[] = "#bbbbbb"; +static char normbgcolor[] = "#222222"; +static char normhlcolor[] = "#ffc978"; +static char selfgcolor[] = "#eeeeee"; +static char selbgcolor[] = "#005577"; +static char selhlcolor[] = "#ffc978"; +static char *colors[SchemeLast][2] = { + /* fg bg */ + [SchemeNorm] = { normfgcolor, normbgcolor }, + [SchemeNormHighlight] = { normhlcolor, normbgcolor }, + [SchemeSel] = { selfgcolor, selbgcolor }, + [SchemeSelHighlight] = { normhlcolor, selbgcolor }, + [SchemeOut] = { "#000000", "#00ffff" }, +}; +/* -l and -g options; controls number of lines and columns in grid if > 0 */ +static unsigned int lines = 8; +static unsigned int columns = 1; + +/* + * Characters not considered part of a word while deleting words + * for example: " /?\"&[]" + */ +static const char worddelimiters[] = " "; + +/* Size of the window border */ +static unsigned int borderpx = 0; + +/* + * Xresources preferences to load at startup + */ +ResourcePref resources[] = { + { "font", STRING, &font }, + { "foreground", STRING, &normfgcolor }, + { "background", STRING, &normbgcolor }, + { "highlightColor", STRING, &normhlcolor }, + { "foreground", STRING, &selfgcolor }, + { "accentColor", STRING, &selbgcolor }, + { "highlightColor", STRING, &selhlcolor }, + { "min_width", INTEGER, &min_width }, + { "borderpx", INTEGER, &borderpx }, +};