Use CLIPBOARD instead of PRIMARY - st - 💻 personal variant of st
(HTM) git clone https://git.drkhsh.at/st.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit bf0277f5e3e7c1b045a4544aa6d6c0362d08a500
(DIR) parent c46b95ae08503054c6325330d630c08ed55f2501
(HTM) Author: drkhsh <me@drkhsh.at>
Date: Wed, 10 Jan 2024 10:11:05 +0100
Use CLIPBOARD instead of PRIMARY
This trivial patch sets CLIPBOARD on selection, and pastes from it
instead of PRIMARY (as suggested).
https://st.suckless.org/patches/clipboard/
Diffstat:
M config.def.h | 2 +-
M x.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/config.def.h b/config.def.h
@@ -176,7 +176,7 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
- { 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~"} },
(DIR) diff --git a/x.c b/x.c
@@ -686,6 +686,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