[wiki] [sites] Add clipboardpaste patch || singpolyma

From: <hg_AT_suckless.org>
Date: Tue, 6 Nov 2012 20:35:22 +0100 (CET)

changeset: 998:f7b313fb6c80
user: singpolyma_AT_singpolyma.net
date: Tue Nov 06 14:19:27 2012 -0500
files: st.suckless.org/patches/clipboardpaste.md st.suckless.org/patches/st-0.3-clipboardpaste.diff
description:
Add clipboardpaste patch


diff -r bf5678a95107 -r f7b313fb6c80 st.suckless.org/patches/clipboardpaste.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/st.suckless.org/patches/clipboardpaste.md Tue Nov 06 14:19:27 2012 -0500
_AT_@ -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 -r bf5678a95107 -r f7b313fb6c80 st.suckless.org/patches/st-0.3-clipboardpaste.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/st.suckless.org/patches/st-0.3-clipboardpaste.diff Tue Nov 06 14:19:27 2012 -0500
_AT_@ -0,0 +1,38 @@
+--- a/st.c
++++ b/st.c
+_AT_@ -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 *);
+_AT_@ -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;
+_AT_@ -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)
Received on Tue Nov 06 2012 - 20:35:22 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 06 2012 - 20:36:06 CET