commit b50e82ebf23c14b6d20ebb17069a472496d9a10e
parent b6e8a0491c500d7dd5647ea8b1617ee6f37b2987
Author: Michael Buch <michaelbuch12@gmail.com>
Date: Sat, 2 Feb 2019 15:10:14 +0000
fix broken git refs in open_copied_url patch
Diffstat:
5 files changed, 136 insertions(+), 146 deletions(-)
diff --git a/st.suckless.org/patches/open_copied_url/index.md b/st.suckless.org/patches/open_copied_url/index.md
@@ -23,8 +23,8 @@ to open the contents of the clipboard in the default browser.
Download
--------
-* [st-openclipboard-20180525-2c2500c.diff](st-openclipboard-20180525-2c2500c.diff)
-* [st-openclipboard-20190105-153c5c7.diff](st-openclipboard-20190105-153c5c7.diff)
+* [st-openclipboard-20190202-0.8.1.diff](st-openclipboard-20190202-0.8.1.diff)
+* [st-openclipboard-20190202-3be4cf1.diff](st-openclipboard-20190202-3be4cf1.diff)
Authors
-------
diff --git a/st.suckless.org/patches/open_copied_url/st-openclipboard-20180525-2c2500c.diff b/st.suckless.org/patches/open_copied_url/st-openclipboard-20180525-2c2500c.diff
@@ -1,73 +0,0 @@
-From 2c2500c057433148c49465b9d009193ffcef6432 Mon Sep 17 00:00:00 2001
-From: Michael Buch <michaelbuch12@gmail.com>
-Date: Fri, 25 May 2018 00:02:40 +0100
-Subject: [PATCH] [st patch] Add ability to open clipboard with configured
- program
-
-Lets user define a program to run in config.h and uses contents
-of CLIPBOARD selection to pass as a parameter. This can be bound
-to any key. By default binds Mod+o to opening the default
-browser.
----
- config.def.h | 1 +
- st.h | 1 +
- x.c | 22 ++++++++++++++++++++++
- 3 files changed, 24 insertions(+)
-
-diff --git a/config.def.h b/config.def.h
-index 82b1b09..83627db 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -178,6 +178,7 @@ static Shortcut shortcuts[] = {
- { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
- { TERMMOD, XK_I, iso14755, {.i = 0} },
-+ { MODKEY, XK_o, opencopied, {.v = "xdg-open"} },
- };
-
- /*
-diff --git a/st.h b/st.h
-index dac64d8..773eeb3 100644
---- a/st.h
-+++ b/st.h
-@@ -81,6 +81,7 @@ void redraw(void);
- void draw(void);
-
- void iso14755(const Arg *);
-+void opencopied(const Arg *);
- void printscreen(const Arg *);
- void printsel(const Arg *);
- void sendbreak(const Arg *);
-diff --git a/x.c b/x.c
-index c0bd890..b7edc5e 100644
---- a/x.c
-+++ b/x.c
-@@ -1949,3 +1949,25 @@ run:
-
- return 0;
- }
-+
-+void
-+opencopied(const Arg *arg)
-+{
-+ const size_t max_cmd = 2048;
-+ const char *clip = xsel.clipboard;
-+ if(!clip) {
-+ fprintf(stderr, "Warning: nothing copied to clipboard\n");
-+ return;
-+ }
-+
-+ /* account for space/quote (3) and \0 (1) */
-+ char cmd[max_cmd + strlen(clip) + 4];
-+ strncpy(cmd, (char *)arg->v, max_cmd);
-+ cmd[max_cmd] = '\0';
-+
-+ strcat(cmd, " \"");
-+ strcat(cmd, clip);
-+ strcat(cmd, "\"");
-+
-+ system(cmd);
-+}
---
-2.17.0
-
diff --git a/st.suckless.org/patches/open_copied_url/st-openclipboard-20190105-153c5c7.diff b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190105-153c5c7.diff
@@ -1,71 +0,0 @@
-From 153c5c7667faa273af681efc9a7012b0c09d0e04 Mon Sep 17 00:00:00 2001
-From: Sai Praneeth Reddy <spr.mora04@gmail.com>
-Date: Sat, 5 Jan 2019 18:01:04 +0530
-Subject: [PATCH] Update base patch
-
-to open the external program independently. Otherwise, the terminal
-is rendered unusable until the external program is closed.
----
- config.def.h | 1 +
- st.h | 1 +
- x.c | 23 +++++++++++++++++++++++
- 3 files changed, 25 insertions(+)
-
-diff --git a/config.def.h b/config.def.h
-index 823e79f..fcd0101 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -177,6 +177,7 @@ static Shortcut shortcuts[] = {
- { TERMMOD, XK_V, clippaste, {.i = 0} },
- { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
-+ { MODKEY, XK_o, opencopied, {.v = "xdg-open"} },
- };
-
- /*
-diff --git a/st.h b/st.h
-index 38c61c4..a0d7a83 100644
---- a/st.h
-+++ b/st.h
-@@ -80,6 +80,7 @@ void die(const char *, ...);
- void redraw(void);
- void draw(void);
-
-+void opencopied(const Arg *);
- void printscreen(const Arg *);
- void printsel(const Arg *);
- void sendbreak(const Arg *);
-diff --git a/x.c b/x.c
-index 0422421..6a5ef48 100644
---- a/x.c
-+++ b/x.c
-@@ -1953,3 +1953,26 @@ run:
-
- return 0;
- }
-+
-+void
-+opencopied(const Arg *arg)
-+{
-+ const size_t max_cmd = 2048;
-+ const char *clip = xsel.clipboard;
-+ if(!clip) {
-+ fprintf(stderr, "Warning: nothing copied to clipboard\n");
-+ return;
-+ }
-+
-+ /* account for space/quote (3) and \0 (1) */
-+ char cmd[max_cmd + strlen(clip) + 4];
-+ strncpy(cmd, (char *)arg->v, max_cmd);
-+ cmd[max_cmd] = '\0';
-+
-+ strcat(cmd, " \"");
-+ strcat(cmd, clip);
-+ strcat(cmd, "\"");
-+ strcat(cmd, " &");
-+
-+ system(cmd);
-+}
---
-2.20.1
-
diff --git a/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-0.8.1.diff b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-0.8.1.diff
@@ -0,0 +1,69 @@
+From b57f6899b277265f19b6ec94d8c476991f452bc7 Mon Sep 17 00:00:00 2001
+From: Michael Buch <michaelbuch12@gmail.com>
+Date: Sat, 2 Feb 2019 15:07:21 +0000
+Subject: [PATCH] 0.8.1 port
+
+---
+ config.def.h | 1 +
+ st.h | 1 +
+ x.c | 23 +++++++++++++++++++++++
+ 3 files changed, 25 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 82b1b09..83627db 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -178,6 +178,7 @@ static Shortcut shortcuts[] = {
+ { TERMMOD, XK_Y, selpaste, {.i = 0} },
+ { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
+ { TERMMOD, XK_I, iso14755, {.i = 0} },
++ { MODKEY, XK_o, opencopied, {.v = "xdg-open"} },
+ };
+
+ /*
+diff --git a/st.h b/st.h
+index dac64d8..762938e 100644
+--- a/st.h
++++ b/st.h
+@@ -80,6 +80,7 @@ void die(const char *, ...);
+ void redraw(void);
+ void draw(void);
+
++void opencopied(const Arg *);
+ void iso14755(const Arg *);
+ void printscreen(const Arg *);
+ void printsel(const Arg *);
+diff --git a/x.c b/x.c
+index c343ba2..3dfe122 100644
+--- a/x.c
++++ b/x.c
+@@ -1950,3 +1950,26 @@ run:
+
+ return 0;
+ }
++
++void
++opencopied(const Arg *arg)
++{
++ const size_t max_cmd = 2048;
++ const char *clip = xsel.clipboard;
++ if(!clip) {
++ fprintf(stderr, "Warning: nothing copied to clipboard\n");
++ return;
++ }
++
++ /* account for space/quote (3) and \0 (1) and & (1) */
++ char cmd[max_cmd + strlen(clip) + 5];
++ strncpy(cmd, (char *)arg->v, max_cmd);
++ cmd[max_cmd] = '\0';
++
++ strcat(cmd, " \"");
++ strcat(cmd, clip);
++ strcat(cmd, "\"");
++ strcat(cmd, "&");
++
++ system(cmd);
++}
+--
+2.20.1
+
diff --git a/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-3be4cf1.diff b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-3be4cf1.diff
@@ -0,0 +1,65 @@
+From 8a3e3d9f0de95c55321761e2763cf43666da312d Mon Sep 17 00:00:00 2001
+From: Michael Buch <michaelbuch12@gmail.com>
+Date: Sat, 2 Feb 2019 14:52:56 +0000
+Subject: [PATCH] Add ability to open clipboard with configured program
+
+---
+ config.def.h | 1 +
+ st.h | 1 +
+ x.c | 19 +++++++++++++++++++
+ 3 files changed, 21 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 0e01717..c273252 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -178,6 +178,7 @@ static Shortcut shortcuts[] = {
+ { TERMMOD, XK_Y, selpaste, {.i = 0} },
+ { ShiftMask, XK_Insert, selpaste, {.i = 0} },
+ { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
++ { MODKEY, XK_o, opencopied, {.v = "xdg-open"} },
+ };
+
+ /*
+diff --git a/st.h b/st.h
+index 38c61c4..a0d7a83 100644
+--- a/st.h
++++ b/st.h
+@@ -80,6 +80,7 @@ void die(const char *, ...);
+ void redraw(void);
+ void draw(void);
+
++void opencopied(const Arg *);
+ void printscreen(const Arg *);
+ void printsel(const Arg *);
+ void sendbreak(const Arg *);
+diff --git a/x.c b/x.c
+index 0422421..af75e85 100644
+--- a/x.c
++++ b/x.c
+@@ -1953,3 +1953,22 @@ run:
+
+ return 0;
+ }
++
++void
++opencopied(const Arg *arg)
++{
++ size_t const max_cmd = 2048;
++ char * const clip = xsel.clipboard;
++ if(!clip) {
++ fprintf(stderr, "Warning: nothing copied to clipboard\n");
++ return;
++ }
++
++ /* account for space/quote (3) and \0 (1) and & (1) */
++ /* e.g.: xdg-open "https://st.suckless.org"& */
++ size_t const cmd_size = max_cmd + strlen(clip) + 5;
++ char cmd[cmd_size];
++
++ snprintf(cmd, cmd_size, "%s \"%s\"&", (char *)arg->v, clip);
++ system(cmd);
++}
+--
+2.20.1
+