summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-08-10 14:15:57 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-08-10 14:15:57 +0200
commitfe5e94571f9efaa54dbc1c91f6c84833f81acc40 (patch)
tree8e1dc7f6acec733d4e75dadd038fa86b4e5aa309
parent5b707cea9131b1a459b9b8aeb7f73ee7492ff8dd (diff)
downloaddmenu-fe5e94571f9efaa54dbc1c91f6c84833f81acc40.tar.gz
dmenu-fe5e94571f9efaa54dbc1c91f6c84833f81acc40.tar.bz2
dmenu-fe5e94571f9efaa54dbc1c91f6c84833f81acc40.zip
Added C-v binding for pasting
-rw-r--r--config.h23
-rw-r--r--dmenu.c1
2 files changed, 24 insertions, 0 deletions
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,