From fe5e94571f9efaa54dbc1c91f6c84833f81acc40 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 10 Aug 2020 14:15:57 +0200 Subject: Added C-v binding for pasting --- config.h | 23 +++++++++++++++++++++++ dmenu.c | 1 + 2 files changed, 24 insertions(+) create mode 100644 config.h diff --git a/config.h b/config.h new file mode 100644 index 0000000..1edb647 --- /dev/null +++ b/config.h @@ -0,0 +1,23 @@ +/* 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 */ +/* -fn option overrides fonts[0]; default X11 font or font set */ +static const char *fonts[] = { + "monospace:size=10" +}; +static const char *prompt = NULL; /* -p option; prompt to the left of input field */ +static const char *colors[SchemeLast][2] = { + /* fg bg */ + [SchemeNorm] = { "#bbbbbb", "#222222" }, + [SchemeSel] = { "#eeeeee", "#005577" }, + [SchemeOut] = { "#000000", "#00ffff" }, +}; +/* -l option; if nonzero, dmenu uses vertical list with given number of lines */ +static unsigned int lines = 0; + +/* + * Characters not considered part of a word while deleting words + * for example: " /?\"&[]" + */ +static const char worddelimiters[] = " "; diff --git a/dmenu.c b/dmenu.c index 60b2a1c..753a716 100644 --- a/dmenu.c +++ b/dmenu.c @@ -354,6 +354,7 @@ keypress(XKeyEvent *ev) while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)])) insert(NULL, nextrune(-1) - cursor); break; + case XK_v: /* paste selection */ case XK_y: /* paste selection */ case XK_Y: XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY, -- cgit