summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <craigmartinjennings@gmail.com>2023-07-23 13:58:48 -0500
committerCraig Jennings <craigmartinjennings@gmail.com>2023-07-23 13:58:48 -0500
commitfa525c95680b7eb16c2885b339a19e9a686ab1fb (patch)
tree0f6ce482901e8207dc1cf83244e863fc9c799ec6
parent4a5342edc5981032ad3f0dfb131467c586b547d2 (diff)
one clipboard patch applied
-rw-r--r--config.def.h6
-rw-r--r--patches_applied/st-clipboard-0.8.3.diff12
-rw-r--r--todo.org12
-rw-r--r--x.c1
4 files changed, 28 insertions, 3 deletions
diff --git a/config.def.h b/config.def.h
index cfda658..fee00f9 100644
--- a/config.def.h
+++ b/config.def.h
@@ -178,7 +178,7 @@ static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, /* !alt */ -1 },
{ XK_ANY_MOD, Button5, kscrolldown, {.i = 1}, 0, /* !alt */ -1 },
- { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
@@ -200,8 +200,8 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
- { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { ShiftMask, XK_Insert, selpaste, {.i = 0} },
+ { TERMMOD, XK_Y, clippaste, {.i = 0} },
+ { ShiftMask, XK_Insert, clippaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
{ ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
diff --git a/patches_applied/st-clipboard-0.8.3.diff b/patches_applied/st-clipboard-0.8.3.diff
new file mode 100644
index 0000000..c1e0e9e
--- /dev/null
+++ b/patches_applied/st-clipboard-0.8.3.diff
@@ -0,0 +1,12 @@
+diff --git a/x.c b/x.c
+index e5f1737..5cabd60 100644
+--- a/x.c
++++ b/x.c
+@@ -673,6 +673,7 @@ setsel(char *str, Time t)
+ XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
+ if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
+ selclear();
++ clipcopy(NULL);
+ }
+
+ void
diff --git a/todo.org b/todo.org
index b276d00..cc7c5d1 100644
--- a/todo.org
+++ b/todo.org
@@ -1,6 +1,18 @@
ST Patches
* ST Patches Open Work
** TODO [#A] prefers system (browser) clipboard instead of terminal clipboard
+*** 2023-07-23 @ 13:56:02 -0500 patch applied successfully w/o issue
+*** Description and URL
+The Freedesktop standard requires you to remember which clipboard you are keeping selections in. If you switch between a terminal and browser, you may find this UX jarring.
+Description
+
+This trivial patch sets CLIPBOARD on selection, the same as your browser.
+
+You may want to replace selpaste with clippaste in your config.h bindings to complete the effect.
+https://st.suckless.org/patches/clipboard/
+https://st.suckless.org/patches/clipboard/st-clipboard-0.8.3.diff
+
+
st-clipboard-0.8.3.diff
** TODO [#A] allows alpha transparency
st-alpha-osc11-20220222-0.8.5.diff
diff --git a/x.c b/x.c
index fba89f3..66ccab0 100644
--- a/x.c
+++ b/x.c
@@ -688,6 +688,7 @@ setsel(char *str, Time t)
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
selclear();
+ clipcopy(NULL);
}
void