summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD6
-rw-r--r--README.md4
-rw-r--r--config.def.h2
-rw-r--r--config.h3
-rw-r--r--patches/st-clipboard-0.8.3.diff.112
-rw-r--r--patches/st-scrollback-mouse-20191024-a2c479c.diff13
-rw-r--r--patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff63
-rw-r--r--st.c5
-rw-r--r--st.h1
-rw-r--r--x.c3
10 files changed, 106 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 67747c7..b76c518 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -28,12 +28,12 @@ md5sums=(
'04c3ca13a702147c62db90f556c5b3ca'
'77af8e227f0414b2493fdb67456a7342'
'bafec1da6c9f80fffd25dd5a85004b42'
- '3bab876dff65da4d985f0fdb95017b7a'
+ '1ffe72cdbf0e02dc7335cba542ef7b9c'
'5138d530a714b4b162e2ce3f547877f5'
- '4f18ec6173a6312651a54787395dade2'
+ '6aaf137da9e2822f2336e2fc18466276'
'0cbfe790d927cce15ae8e658de03f8aa'
'600d948f6320be2ce99361b397bb4cfb'
- 'ed59c415b5b033d23519f18b87842a7e'
+ '5fb6aee07b223c284acac295caa8f4fc'
)
build() {
diff --git a/README.md b/README.md
index 05e4393..4c53e29 100644
--- a/README.md
+++ b/README.md
@@ -8,4 +8,6 @@ Installed patches:
* [Desktop Entry](https://st.suckless.org/patches/desktopentry/)
* [Grubvox Dark](https://st.suckless.org/patches/gruvbox/)
* [Scrollback](https://st.suckless.org/patches/scrollback/)
-
+ * scrollback-mouse
+ * scrollback-mouse-altscreen
+* [oneclipboard](https://st.suckless.org/patches/clipboard/)
diff --git a/config.def.h b/config.def.h
index 9a6876a..2b5ea87 100644
--- a/config.def.h
+++ b/config.def.h
@@ -168,6 +168,8 @@ static uint forcemousemod = ShiftMask;
*/
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 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
diff --git a/config.h b/config.h
index 1b8c196..e695599 100644
--- a/config.h
+++ b/config.h
@@ -168,7 +168,8 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
- { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { 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 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
diff --git a/patches/st-clipboard-0.8.3.diff.1 b/patches/st-clipboard-0.8.3.diff.1
new file mode 100644
index 0000000..c1e0e9e
--- /dev/null
+++ b/patches/st-clipboard-0.8.3.diff.1
@@ -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/patches/st-scrollback-mouse-20191024-a2c479c.diff b/patches/st-scrollback-mouse-20191024-a2c479c.diff
new file mode 100644
index 0000000..49eba8e
--- /dev/null
+++ b/patches/st-scrollback-mouse-20191024-a2c479c.diff
@@ -0,0 +1,13 @@
+diff --git a/config.def.h b/config.def.h
+index ec1b576..4b3bf15 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -163,6 +163,8 @@ static uint forcemousemod = ShiftMask;
+ */
+ static MouseShortcut mshortcuts[] = {
+ /* mask button function argument release */
++ { ShiftMask, Button4, kscrollup, {.i = 1} },
++ { ShiftMask, Button5, kscrolldown, {.i = 1} },
+ { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
+ { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
diff --git a/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff b/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff
new file mode 100644
index 0000000..fbade29
--- /dev/null
+++ b/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff
@@ -0,0 +1,63 @@
+diff --git a/config.def.h b/config.def.h
+index 4b3bf15..1986316 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -163,8 +163,8 @@ static uint forcemousemod = ShiftMask;
+ */
+ static MouseShortcut mshortcuts[] = {
+ /* mask button function argument release */
+- { ShiftMask, Button4, kscrollup, {.i = 1} },
+- { ShiftMask, Button5, kscrolldown, {.i = 1} },
++ { 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, Button4, ttysend, {.s = "\031"} },
+ { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
+diff --git a/st.c b/st.c
+index f8b6f67..dd4cb31 100644
+--- st.c
++++ st.c
+@@ -1045,6 +1045,11 @@ tnew(int col, int row)
+ treset();
+ }
+
++int tisaltscr(void)
++{
++ return IS_SET(MODE_ALTSCREEN);
++}
++
+ void
+ tswapscreen(void)
+ {
+diff --git a/st.h b/st.h
+index 1332cf1..f9ad815 100644
+--- st.h
++++ st.h
+@@ -89,6 +89,7 @@ void sendbreak(const Arg *);
+ void toggleprinter(const Arg *);
+
+ int tattrset(int);
++int tisaltscr(void);
+ void tnew(int, int);
+ void tresize(int, int);
+ void tsetdirtattr(int);
+diff --git a/x.c b/x.c
+index e5f1737..b8fbd7b 100644
+--- x.c
++++ x.c
+@@ -34,6 +34,7 @@ typedef struct {
+ void (*func)(const Arg *);
+ const Arg arg;
+ uint release;
++ int altscrn; /* 0: don't care, -1: not alt screen, 1: alt screen */
+ } MouseShortcut;
+
+ typedef struct {
+@@ -446,6 +447,7 @@ mouseaction(XEvent *e, uint release)
+ for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
+ if (ms->release == release &&
+ ms->button == e->xbutton.button &&
++ (!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) &&
+ (match(ms->mod, state) || /* exact or forced */
+ match(ms->mod, state & ~forcemousemod))) {
+ ms->func(&(ms->arg));
diff --git a/st.c b/st.c
index edec064..166f037 100644
--- a/st.c
+++ b/st.c
@@ -1057,6 +1057,11 @@ tnew(int col, int row)
treset();
}
+int tisaltscr(void)
+{
+ return IS_SET(MODE_ALTSCREEN);
+}
+
void
tswapscreen(void)
{
diff --git a/st.h b/st.h
index f44e1d3..36cdb65 100644
--- a/st.h
+++ b/st.h
@@ -89,6 +89,7 @@ void sendbreak(const Arg *);
void toggleprinter(const Arg *);
int tattrset(int);
+int tisaltscr(void);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
diff --git a/x.c b/x.c
index 083b202..2f0e3fc 100644
--- a/x.c
+++ b/x.c
@@ -34,6 +34,7 @@ typedef struct {
void (*func)(const Arg *);
const Arg arg;
uint release;
+ int altscrn; /* 0: don't care, -1: not alt screen, 1: alt screen */
} MouseShortcut;
typedef struct {
@@ -447,6 +448,7 @@ mouseaction(XEvent *e, uint release)
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
if (ms->release == release &&
ms->button == e->xbutton.button &&
+ (!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) &&
(match(ms->mod, state) || /* exact or forced */
match(ms->mod, state & ~forcemousemod))) {
ms->func(&(ms->arg));
@@ -674,7 +676,6 @@ 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