commit 044f85d3e614de7c31e52d2fbd423ba38a06cd92
parent 1b82f3af307734c0be05241d35751bc0593c339d
Author: singpolyma@singpolyma.net <unknown>
Date: Tue, 6 Nov 2012 14:19:27 -0500
Add clipboardpaste patch
Diffstat:
2 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/st.suckless.org/patches/clipboardpaste.md b/st.suckless.org/patches/clipboardpaste.md
@@ -0,0 +1,19 @@
+clipboardpaste
+==============
+
+Description
+-----------
+
+This is a patch to allow pasting the contents of CLIPBOARD into st
+using Alt+Shift+Ins (Shift+Ins still pastes PRIMARY).
+
+Download
+--------
+* [st-0.3-clipboardpaste.diff][0]
+
+[0]: st-0.3-clipboardpaste.diff
+
+Author
+------
+
+ * Stephen Paul Weber - singpolyma
diff --git a/st.suckless.org/patches/st-0.3-clipboardpaste.diff b/st.suckless.org/patches/st-0.3-clipboardpaste.diff
@@ -0,0 +1,38 @@
+--- a/st.c
++++ b/st.c
+@@ -353,6 +353,7 @@ static void selinit(void);
+ static inline bool selected(int, int);
+ static void selcopy(void);
+ static void selpaste(void);
++static void clipboardpaste(void);
+ static void selscroll(int, int);
+
+ static int utf8decode(char *, long *);
+@@ -751,6 +752,12 @@ void selclear(XEvent *e) {
+ }
+
+ void
++clipboardpaste() {
++ Atom clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
++ XConvertSelection(xw.dpy, clipboard, sel.xtarget, XA_PRIMARY, xw.win, CurrentTime);
++}
++
++void
+ selrequest(XEvent *e) {
+ XSelectionRequestEvent *xsre;
+ XSelectionEvent xev;
+@@ -2690,8 +2697,12 @@ kpress(XEvent *ev) {
+ ttywrite(buf, 3);
+ break;
+ case XK_Insert:
+- if(shift)
+- selpaste();
++ if(shift) {
++ if(meta)
++ clipboardpaste();
++ else
++ selpaste();
++ }
+ break;
+ case XK_Return:
+ if(meta)