Hi guys!
First of all, don't kill me if the patch isn't perfect, because I'm not really
a coder (but use suckless software nevertheless)! But this patch is trivial
enough. Actually it's the first time ever that I provide a patch! :)
I discovered that for selected text st uses the CLIPBOARD selection. Me coming
from rxvt-unicode, I was used to PRIMARY selection in this case and frankly, I
think it makes more sense. I think this should be configurable with the
config.h. That's what my patch changes.
Best
Army
diff --git a/config.def.h b/config.def.h
index 34884c0..fe24d24 100644
--- a/config.def.h
+++ b/config.def.h
@@ -20,6 +20,9 @@ static unsigned int actionfps = 30;
/* TERM value */
static char termname[] = "st-256color";
+/* CLIPBOARD */
+static char clipboard_selection[] = "PRIMARY"; // or CLIPBOARD
+
static unsigned int tabspaces = 8;
diff --git a/st.c b/st.c
index 0923cec..2259311 100644
--- a/st.c
+++ b/st.c
@@ -834,7 +834,7 @@ void
clippaste(const Arg *dummy) {
Atom clipboard;
- clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
+ clipboard = XInternAtom(xw.dpy, clipboard_selection, 0);
XConvertSelection(xw.dpy, clipboard, sel.xtarget, XA_PRIMARY,
xw.win, CurrentTime);
}
@@ -892,7 +892,7 @@ xsetsel(char *str) {
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, CurrentTime);
- clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
+ clipboard = XInternAtom(xw.dpy, clipboard_selection, 0);
XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime);
}