From 2bca6a0fdc8ec8240a4b8530212293a1ee2a3340 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 17 Apr 2024 23:33:21 +0200 Subject: [PATCH] update dmenu configuration --- .gitignore | 1 + build.sh | 8 +++++++- config.h | 47 ++++++++++++++--------------------------------- patches.h | 8 ++++---- 4 files changed, 26 insertions(+), 38 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f5c2fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dmenu-final diff --git a/build.sh b/build.sh index 1345af3..ebc2a8b 100755 --- a/build.sh +++ b/build.sh @@ -2,8 +2,14 @@ cp config.mk patches.h dmenu-flexipatch/ flexipatch-finalizer/flexipatch-finalizer.sh -r -d dmenu-flexipatch -o dmenu-final -git -C st-flexipatch reset --hard HEAD && git -C st-flexipatch clean -fd +git -C dmenu-flexipatch reset --hard HEAD && git -C dmenu-flexipatch clean -fd # for patch in patches/*.diff; do # patch -d dmenu-final <"$patch" # done cp config.h dmenu-final/ +cd dmenu-final || exit 1 +if [ "$1" = "-i" ]; then + sudo make install +else + make +fi diff --git a/config.h b/config.h index 73b83e2..67f0249 100644 --- a/config.h +++ b/config.h @@ -2,48 +2,29 @@ /* Default settings; can be overriden by command line. */ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ -static int opacity = 1; /* -o option; if 0, then alpha is disabled */ 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[] = "FiraCode Nerd Font 12"; static const char *prompt = NULL; /* -p option; prompt to the left of input field */ -static const unsigned int baralpha = OPAQUE; -static const unsigned int borderalpha = OPAQUE; -static const unsigned int alphas[][3] = { - /* fg bg border */ - [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, - [SchemeSel] = { OPAQUE, baralpha, borderalpha }, - [SchemeSelHighlight] = { OPAQUE, baralpha, borderalpha }, - [SchemeNormHighlight] = { OPAQUE, baralpha, borderalpha }, -}; - -#define NOCOLOR "#FF0000" -#define COLOR0 "#15161E" -#define COLOR1 "#f7768e" -#define COLOR2 "#9ece6a" -#define COLOR3 "#e0af68" -#define COLOR4 "#7aa2f7" -#define COLOR5 "#bb9af7" -#define COLOR6 "#7dcfff" -#define COLOR7 "#a9b1d6" -#define COLOR8 "#414868" -#define COLOR9 "#f7768e" -#define COLOR10 "#9ece6a" -#define COLOR11 "#e0af68" -#define COLOR12 "#7aa2f7" -#define COLOR13 "#bb9af7" -#define COLOR14 "#7dcfff" -#define COLOR15 "#c0caf5" +#define BLACK "#15161E" +#define RED "#f7768e" +#define GREEN "#9ece6a" +#define ORANGE "#e0af68" +#define BLUE "#7aa2f7" +#define MAGENTA "#bb9af7" +#define CYAN "#7dcfff" +#define LIGHT_GRAY "#a9b1d6" +#define GRAY "#414868" +#define WHITE "#c0caf5" +#define UNDEFINED "#ff0000" static char *colors[][2] = { /* fg bg */ - [SchemeNorm] = { COLOR7, COLOR0 }, - [SchemeSel] = { COLOR0, COLOR4 }, - [SchemeOut] = { NOCOLOR, NOCOLOR }, - [SchemeNormHighlight] = { COLOR11, COLOR0 }, - [SchemeSelHighlight] = { COLOR0, COLOR4 }, + [SchemeNorm] = { WHITE, BLACK }, + [SchemeSel] = { BLACK, BLUE }, + [SchemeOut] = { UNDEFINED, UNDEFINED }, }; /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ static unsigned int lines = 0; diff --git a/patches.h b/patches.h index 9419e7d..dc0f874 100644 --- a/patches.h +++ b/patches.h @@ -5,7 +5,7 @@ * when including this patch. * https://github.com/bakkeby/patches/blob/master/dmenu/dmenu-alpha-5.0_20210725_523aa08.diff */ -#define ALPHA_PATCH 1 +#define ALPHA_PATCH 0 /* This adds padding for dmenu in similar fashion to the similarly named patch for dwm. The idea * is to have dmenu appear on top of the bar when using said patch in dwm. @@ -61,7 +61,7 @@ * to be used together with the fuzzymatch patch. * https://tools.suckless.org/dmenu/patches/fuzzyhighlight/ */ -#define FUZZYHIGHLIGHT_PATCH 1 +#define FUZZYHIGHLIGHT_PATCH 0 /* This patch adds support for fuzzy-matching to dmenu, allowing users to type non-consecutive * portions of the string to be matched. @@ -192,7 +192,7 @@ /* Adds text which displays the number of matched and total items in the top right corner of dmenu. * https://tools.suckless.org/dmenu/patches/numbers/ */ -#define NUMBERS_PATCH 1 +#define NUMBERS_PATCH 0 /* This patch adds simple markup for dmenu using pango markup. * This depends on the pango library v1.44 or greater. @@ -346,7 +346,7 @@ * * https://tools.suckless.org/dmenu/patches/xresources/ */ -#define XRESOURCES_PATCH 1 +#define XRESOURCES_PATCH 0 /* This patch adds options for specifying dmenu window position and width. * The center patch takes precedence over the XYW patch if enabled.