dmenu

Mahdi's build of dmenu
git clone git://mahdi.pw/dmenu.git
Log | Files | Refs | README | LICENSE

commit 89f411092eb8f38c9388055312cccbfe1c4b6bae
parent 1600419c32e1bc799b0345f0dc029e75c67d0478
Author: Mahdi Mirzade <[email protected]>
Date:   Sun, 22 May 2022 19:17:09 +0430

Fix issues, other tweaks

Diffstat:
Mconfig.h | 20+++++++++++---------
Mdmenu.c | 37+++++++++++++++++++------------------
Mdmenu_run | 2+-
3 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/config.h b/config.h @@ -21,17 +21,18 @@ static const char worddelimiters[] = " "; static char normfgcolor[] = "#ECEFF4"; static char normbgcolor[] = "#3B4252"; -static char selfgcolor[] = "#E5E9F0"; +static char normhlcolor[] = "#EBCB8B"; +static char selfgcolor[] = "#EBCB8B"; static char selbgcolor[] = "#4C566A"; -static char hlcolor[] = "#EBCB8B"; +static char selhlcolor[] = "#E5E9F0"; static char *colors[SchemeLast][2] = { /* fg bg */ [SchemeNorm] = { normfgcolor, normbgcolor }, [SchemeSel] = { selfgcolor, selbgcolor }, - [SchemeNormHighlight] = { hlcolor, normbgcolor }, - [SchemeSelHighlight] = { hlcolor, selbgcolor }, + [SchemeNormHighlight] = { normhlcolor, normbgcolor }, + [SchemeSelHighlight] = { selhlcolor, selbgcolor }, [SchemeOut] = { "#000000", "#00ffff" }, - [SchemeOutHighlight] = { hlcolor, "#00ffff" }, + [SchemeOutHighlight] = { normhlcolor, "#00ffff" }, }; static const unsigned int alphas[SchemeLast][2] = { @@ -48,11 +49,12 @@ static const unsigned int alphas[SchemeLast][2] = { */ ResourcePref resources[] = { { "font", STRING, &font }, - { "color15", STRING, &normfgcolor }, + { "color12", STRING, &normfgcolor }, { "color0", STRING, &normbgcolor }, - { "color7", STRING, &selfgcolor }, - { "color8", STRING, &selbgcolor }, - { "color3", STRING, &hlcolor }, + { "color11", STRING, &normhlcolor }, + { "color0", STRING, &selfgcolor }, + { "color12", STRING, &selbgcolor }, + { "color8", STRING, &selhlcolor }, { "prompt", STRING, &prompt }, }; diff --git a/dmenu.c b/dmenu.c @@ -197,21 +197,20 @@ drawhighlights(struct item *item, int x, int y, int maxw) static void apply_fribidi(char *str) { - FriBidiStrIndex len = strlen(str); - FriBidiChar logical[BUFSIZ]; - FriBidiChar visual[BUFSIZ]; - FriBidiParType base = FRIBIDI_PAR_ON; - FriBidiCharSet charset; - fribidi_boolean result; - - fribidi_text[0] = 0; - if (len>0) - { - charset = fribidi_parse_charset("UTF-8"); - len = fribidi_charset_to_unicode(charset, str, len, logical); - result = fribidi_log2vis(logical, len, &base, visual, NULL, NULL, NULL); - len = fribidi_unicode_to_charset(charset, visual, len, fribidi_text); - } + FriBidiStrIndex len = strlen(str); + FriBidiChar logical[BUFSIZ]; + FriBidiChar visual[BUFSIZ]; + FriBidiParType base = FRIBIDI_PAR_ON; + FriBidiCharSet charset; + fribidi_boolean result; + + fribidi_text[0] = 0; + if (len > 0) { + charset = fribidi_parse_charset("UTF-8"); + len = fribidi_charset_to_unicode(charset, str, len, logical); + result = fribidi_log2vis(logical, len, &base, visual, NULL, NULL, NULL); + len = fribidi_unicode_to_charset(charset, visual, len, fribidi_text); + } } static int @@ -468,9 +467,11 @@ keypress(XKeyEvent *ev) insert(NULL, nextrune(-1) - cursor); break; case XK_y: /* paste selection */ - case XK_Y: XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY, - utf8, utf8, win, CurrentTime); + utf8, utf8, win, CurrentTime); + return; + case XK_Y: /* paste selection from clipboard */ + XConvertSelection(dpy, clip, utf8, utf8, win, CurrentTime); return; case XK_Left: case XK_KP_Left: @@ -783,7 +784,7 @@ setup(void) #endif /* init appearance */ for (j = 0; j < SchemeLast; j++) - scheme[j] = drw_scm_create(drw, colors[j], alphas[i], 2); + scheme[j] = drw_scm_create(drw, colors[j], alphas[j], 2); clip = XInternAtom(dpy, "CLIPBOARD", False); utf8 = XInternAtom(dpy, "UTF8_STRING", False); diff --git a/dmenu_run b/dmenu_run @@ -23,7 +23,7 @@ awk -v histfile=$historyfile ' x[$0]=1 } } !x[$0]++ ' "$cache" \ - | dmenu "$@" \ + | dmenu -i "$@" \ | awk -v histfile=$historyfile ' BEGIN { FS=OFS="\t"