--
-+#define WORD_BREAK " "
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-diff --git a/st.c b/st.c
-index 8e0df08..2998468 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -279,6 +279,7 @@ typedef struct {
- } DC;
-
- static void die(const char *, ...);
-+static bool is_word_break(char);
- static void draw(void);
- static void redraw(void);
- static void drawregion(int, int, int, int);
-_AT_@ -813,12 +814,12 @@ brelease(XEvent *e) {
- /* double click to select word */
- sel.bx = sel.ex;
- while(sel.bx > 0 && term.line[sel.ey][sel.bx-1].state & GLYPH_SET &&
-- term.line[sel.ey][sel.bx-1].c[0] != ' ') {
-+ !is_word_break(term.line[sel.ey][sel.bx-1].c[0])) {
- sel.bx--;
- }
- sel.b.x = sel.bx;
- while(sel.ex < term.col-1 && term.line[sel.ey][sel.ex+1].state & GLYPH_SET &&
-- term.line[sel.ey][sel.ex+1].c[0] != ' ') {
-+ !is_word_break(term.line[sel.ey][sel.ex+1].c[0])) {
- sel.ex++;
- }
- sel.e.x = sel.ex;
-_AT_@ -866,6 +867,17 @@ die(const char *errstr, ...) {
- exit(EXIT_FAILURE);
- }
-
-+bool
-+is_word_break(char c) {
-+ static char *word_break = WORD_BREAK;
-+ char *s = word_break;
-+ while(*s) {
-+ if(*s == c) return true;
-+ s++;
-+ }
-+ return false;
-+}
-+
- void
- execsh(void) {
- char **args;
diff --git a/st.suckless.org/patches/st-0.4-wordbreak.diff b/st.suckless.org/patches/st-0.4-wordbreak.diff
deleted file mode 100644
index 578b325..0000000
--- a/st.suckless.org/patches/st-0.4-wordbreak.diff
+++ /dev/null
_AT_@ -1,58 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 693bdbd..cba3754 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -21,7 +21,7 @@ static unsigned int actionfps = 30;
- static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
--
-+#define WORD_BREAK " "
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-diff --git a/st.c b/st.c
-index 8b1fc56..8ed395c 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -294,6 +294,7 @@ typedef struct {
- } DC;
-
- static void die(const char *, ...);
-+static bool is_word_break(char);
- static void draw(void);
- static void redraw(int);
- static void drawregion(int, int, int, int);
-_AT_@ -920,12 +921,12 @@ brelease(XEvent *e) {
- /* double click to select word */
- sel.bx = sel.ex;
- while(sel.bx > 0 && term.line[sel.ey][sel.bx-1].state & GLYPH_SET &&
-- term.line[sel.ey][sel.bx-1].c[0] != ' ') {
-+ !is_word_break(term.line[sel.ey][sel.bx-1].c[0])) {
- sel.bx--;
- }
- sel.b.x = sel.bx;
- while(sel.ex < term.col-1 && term.line[sel.ey][sel.ex+1].state & GLYPH_SET &&
-- term.line[sel.ey][sel.ex+1].c[0] != ' ') {
-+ !is_word_break(term.line[sel.ey][sel.ex+1].c[0])) {
- sel.ex++;
- }
- sel.e.x = sel.ex;
-_AT_@ -974,6 +975,17 @@ die(const char *errstr, ...) {
- exit(EXIT_FAILURE);
- }
-
-+bool
-+is_word_break(char c) {
-+ static char *word_break = WORD_BREAK;
-+ char *s = word_break;
-+ while(*s) {
-+ if(*s == c) return true;
-+ s++;
-+ }
-+ return false;
-+}
-+
- void
- execsh(void) {
- char **args;
diff --git a/st.suckless.org/patches/st-0.4.1-argbbg.diff b/st.suckless.org/patches/st-0.4.1-argbbg.diff
deleted file mode 100644
index fe6b47b..0000000
--- a/st.suckless.org/patches/st-0.4.1-argbbg.diff
+++ /dev/null
_AT_@ -1,171 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index d1c20bd..cc9f34d 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -25,6 +25,8 @@ static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
-
-+/* background opacity */
-+static const int alpha = 0xdd;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-_AT_@ -52,6 +54,7 @@ static const char *colorname[] = {
-
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
-+ "black",
- };
-
-
-_AT_@ -60,7 +63,7 @@ static const char *colorname[] = {
- * foreground, background, cursor
- */
- static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
-+static unsigned int defaultbg = 257;
- static unsigned int defaultcs = 256;
-
- /*
-diff --git a/config.mk b/config.mk
-index 9431de2..0b92bf2 100644
---- a/config.mk
-+++ b/config.mk
-_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
- INCS = -I. -I/usr/include -I${X11INC} \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
-+LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lXrender \
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
-
-diff --git a/st.c b/st.c
-index 686ed5d..de4d0f9 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -60,6 +60,7 @@ char *argv0;
- #define XK_ANY_MOD UINT_MAX
- #define XK_NO_MOD 0
- #define XK_SWITCH_MOD (1<<13)
-+#define OPAQUE 0Xff
-
- #define REDRAW_TIMEOUT (80*1000) /* 80 ms */
-
-_AT_@ -74,6 +75,7 @@ char *argv0;
- #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
- #define IS_SET(flag) ((term.mode & (flag)) != 0)
- #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
-+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
-
- #define VT102ID "[?6c"
-
-_AT_@ -215,6 +217,7 @@ typedef struct {
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
-+ int depth; /* bit depth */
- char state; /* focus, redraw, visible */
- } XWindow;
-
-_AT_@ -2335,8 +2338,7 @@ xresize(int col, int row) {
- xw.th = MAX(1, row * xw.ch);
-
- XFreePixmap(xw.dpy, xw.buf);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
- XftDrawChange(xw.draw, xw.buf);
- xclear(0, 0, xw.w, xw.h);
- }
-_AT_@ -2360,6 +2362,13 @@ xloadcols(void) {
- }
- }
-
-+ /* set alpha value of bg color */
-+ if (USE_ARGB) {
-+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
-+ dc.col[defaultbg].pixel &= 0x00111111;
-+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
-+ }
-+
- /* load colors [16-255] ; same colors as xterm */
- for(i = 16, r = 0; r < 6; r++) {
- for(g = 0; g < 6; g++) {
-_AT_@ -2603,7 +2612,38 @@ xinit(void) {
- if(!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
- xw.scr = XDefaultScreen(xw.dpy);
-- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ xw.depth = (USE_ARGB)? 32: XDefaultDepth(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ else {
-+ XVisualInfo *vis;
-+ XRenderPictFormat *fmt;
-+ int nvi;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = xw.scr,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+
-+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
-+ xw.vis = NULL;
-+ for(i = 0; i < nvi; i ++) {
-+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ xw.vis = vis[i].visual;
-+ break;
-+ }
-+ }
-+
-+ XFree(vis);
-+
-+ if (! xw.vis) {
-+ fprintf(stderr, "Couldn't find ARGB visual.
");
-+ exit(1);
-+ }
-+ }
-
- /* font */
- if(!FcInit())
-_AT_@ -2613,7 +2653,10 @@ xinit(void) {
- xloadfonts(usedfont, 0);
-
- /* colors */
-- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ else
-+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
- xloadcols();
-
- /* adjust fixed window geometry */
-_AT_@ -2647,7 +2690,7 @@ xinit(void) {
- parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
- XRootWindow(xw.dpy, xw.scr);
- xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy,
-- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
-+ xw.w, xw.h, 0, xw.depth, InputOutput,
- xw.vis,
- CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
- | CWColormap,
-_AT_@ -2655,10 +2698,11 @@ xinit(void) {
-
- memset(&gcvalues, 0, sizeof(gcvalues));
- gcvalues.graphics_exposures = False;
-- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
-+ dc.gc = XCreateGC(xw.dpy,
-+ (USE_ARGB)? xw.buf: parent,
-+ GCGraphicsExposures,
- &gcvalues);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
- XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
-
diff --git a/st.suckless.org/patches/st-0.4.1-externalpipe.diff b/st.suckless.org/patches/st-0.4.1-externalpipe.diff
deleted file mode 100644
index 7c9c9e2..0000000
--- a/st.suckless.org/patches/st-0.4.1-externalpipe.diff
+++ /dev/null
_AT_@ -1,109 +0,0 @@
-diff --git a/st.c b/st.c
-index 686ed5d..697cd43 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -249,6 +249,7 @@ typedef union {
- unsigned int ui;
- float f;
- const void *v;
-+ const char *s;
- } Arg;
-
- typedef struct {
-_AT_@ -263,6 +264,7 @@ static void clippaste(const Arg *);
- static void numlock(const Arg *);
- static void selpaste(const Arg *);
- static void xzoom(const Arg *);
-+static void externalpipe(const Arg *);
-
- /* Config.h for applying patches and the configuration. */
- #include "config.h"
-_AT_@ -1024,15 +1026,22 @@ execsh(void) {
- void
- sigchld(int a) {
- int stat = 0;
-+ pid_t r;
-
-- if(waitpid(pid, &stat, 0) < 0)
-- die("Waiting for pid %hd failed: %s
", pid, SERRNO);
-+ r = wait(&stat);
-+ if(r < 0)
-+ die("wait(): %s
", SERRNO);
-
-- if(WIFEXITED(stat)) {
-- exit(WEXITSTATUS(stat));
-- } else {
-- exit(EXIT_FAILURE);
-+ if(r == pid){
-+ /* _the_ sub process */
-+ if(WIFEXITED(stat)) {
-+ exit(WEXITSTATUS(stat));
-+ } else {
-+ exit(EXIT_FAILURE);
-+ }
- }
-+
-+ /* something else we've forked out */
- }
-
- void
-_AT_@ -2593,6 +2602,59 @@ xzoom(const Arg *arg) {
- }
-
- void
-+externalpipe(const Arg *arg)
-+{
-+ int to[2]; /* 0 = read, 1 = write */
-+ pid_t child;
-+ int y, x;
-+ void (*oldsigpipe)(int);
-+
-+ if(pipe(to) == -1)
-+ return;
-+
-+ /* sigchld() handles this */
-+ switch((child = fork())){
-+ case -1:
-+ close(to[0]), close(to[1]);
-+ return;
-+ case 0:
-+ /* child */
-+ close(to[1]);
-+ dup2(to[0], STDIN_FILENO); /* 0<&to */
-+ close(to[0]);
-+ execvp(
-+ "sh",
-+ (char *const []){
-+ "/bin/sh",
-+ "-c",
-+ (char *)arg->s,
-+ 0
-+ });
-+ exit(127);
-+ }
-+
-+ /* parent */
-+ close(to[0]);
-+ /* ignore sigpipe for now, in case child exits early */
-+ oldsigpipe = signal(SIGPIPE, SIG_IGN);
-+
-+ for(y = 0; y < term.row; y++){
-+ for(x = 0; x < term.col; x++){
-+ if(write(to[1], term.line[y][x].c, 1) == -1)
-+ goto done;
-+ }
-+ if(write(to[1], "
", 1) == -1)
-+ break;
-+ }
-+
-+done:
-+ close(to[1]);
-+
-+ /* restore */
-+ signal(SIGPIPE, oldsigpipe);
-+}
-+
-+void
- xinit(void) {
- XSetWindowAttributes attrs;
- XGCValues gcvalues;
diff --git a/st.suckless.org/patches/st-0.4.1-wordbreak.diff b/st.suckless.org/patches/st-0.4.1-wordbreak.diff
deleted file mode 100644
index 6ee66eb..0000000
--- a/st.suckless.org/patches/st-0.4.1-wordbreak.diff
+++ /dev/null
_AT_@ -1,57 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index d1c20bd..d8db06d 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -24,7 +24,7 @@ static unsigned int actionfps = 30;
- static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
--
-+#define WORD_BREAK " "
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-diff --git a/st.c b/st.c
-index 686ed5d..4f5bb05 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -288,6 +288,7 @@ typedef struct {
- } DC;
-
- static void die(const char *, ...);
-+static bool is_word_break(char);
- static void draw(void);
- static void redraw(int);
- static void drawregion(int, int, int, int);
-_AT_@ -933,11 +934,11 @@ brelease(XEvent *e) {
- } else if(TIMEDIFF(now, sel.tclick1) <= doubleclicktimeout) {
- /* double click to select word */
- sel.bx = sel.ex;
-- while(sel.bx > 0 && term.line[sel.ey][sel.bx-1].c[0] != ' ') {
-+ while(sel.bx > 0 && !is_word_break(term.line[sel.ey][sel.bx-1].c[0])) {
- sel.bx--;
- }
- sel.b.x = sel.bx;
-- while(sel.ex < term.col-1 && term.line[sel.ey][sel.ex+1].c[0] != ' ') {
-+ while(sel.ex < term.col-1 && !is_word_break(term.line[sel.ey][sel.ex+1].c[0])) {
- sel.ex++;
- }
- sel.e.x = sel.ex;
-_AT_@ -986,6 +987,17 @@ die(const char *errstr, ...) {
- exit(EXIT_FAILURE);
- }
-
-+bool
-+is_word_break(char c) {
-+ static char *word_break = WORD_BREAK;
-+ char *s = word_break;
-+ while(*s) {
-+ if(*s == c) return true;
-+ s++;
-+ }
-+ return false;
-+}
-+
- void
- execsh(void) {
- char **args;
diff --git a/st.suckless.org/patches/st-0.5-argbbg.diff b/st.suckless.org/patches/st-0.5-argbbg.diff
deleted file mode 100644
index 83cc45a..0000000
--- a/st.suckless.org/patches/st-0.5-argbbg.diff
+++ /dev/null
_AT_@ -1,169 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 58b470e..ce34f55 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -48,6 +48,8 @@ static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
-
-+/* background opacity */
-+static const int alpha = 0xdd;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-_AT_@ -75,6 +77,7 @@ static const char *colorname[] = {
-
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
-+ "black",
- };
-
-
-_AT_@ -83,7 +86,7 @@ static const char *colorname[] = {
- * foreground, background, cursor
- */
- static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
-+static unsigned int defaultbg = 257;
- static unsigned int defaultcs = 256;
-
- /*
-diff --git a/config.mk b/config.mk
-index 97afa2c..18aec14 100644
---- a/config.mk
-+++ b/config.mk
-_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
- INCS = -I. -I/usr/include -I${X11INC} \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
-+LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lXrender \
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
-
-diff --git a/st.c b/st.c
-index 392f12d..5b05a5f 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -65,6 +65,7 @@ char *argv0;
- #define XK_ANY_MOD UINT_MAX
- #define XK_NO_MOD 0
- #define XK_SWITCH_MOD (1<<13)
-+#define OPAQUE 0Xff
-
- #define REDRAW_TIMEOUT (80*1000) /* 80 ms */
-
-_AT_@ -79,6 +80,7 @@ char *argv0;
- #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
- #define IS_SET(flag) ((term.mode & (flag)) != 0)
- #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
-+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
- #define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x))
-
- #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
-_AT_@ -255,6 +257,7 @@ typedef struct {
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
-+ int depth; /* bit depth */
- char state; /* focus, redraw, visible */
- } XWindow;
-
-_AT_@ -2706,8 +2709,7 @@ xresize(int col, int row) {
- xw.th = MAX(1, row * xw.ch);
-
- XFreePixmap(xw.dpy, xw.buf);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
- XftDrawChange(xw.draw, xw.buf);
- xclear(0, 0, xw.w, xw.h);
- }
-_AT_@ -2738,6 +2740,13 @@ xloadcols(void) {
- }
- }
-
-+ /* set alpha value of bg color */
-+ if (USE_ARGB) {
-+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
-+ dc.col[defaultbg].pixel &= 0x00111111;
-+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
-+ }
-+
- /* load colors [16-255] ; same colors as xterm */
- for(i = 16, r = 0; r < 6; r++) {
- for(g = 0; g < 6; g++) {
-_AT_@ -2992,7 +3001,38 @@ xinit(void) {
- if(!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
- xw.scr = XDefaultScreen(xw.dpy);
-- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ xw.depth = (USE_ARGB)? 32: XDefaultDepth(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ else {
-+ XVisualInfo *vis;
-+ XRenderPictFormat *fmt;
-+ int nvi;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = xw.scr,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+
-+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
-+ xw.vis = NULL;
-+ for(i = 0; i < nvi; i ++) {
-+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ xw.vis = vis[i].visual;
-+ break;
-+ }
-+ }
-+
-+ XFree(vis);
-+
-+ if (! xw.vis) {
-+ fprintf(stderr, "Couldn't find ARGB visual.
");
-+ exit(1);
-+ }
-+ }
-
- /* font */
- if(!FcInit())
-_AT_@ -3002,7 +3042,10 @@ xinit(void) {
- xloadfonts(usedfont, 0);
-
- /* colors */
-- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ else
-+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
- xloadcols();
-
- /* adjust fixed window geometry */
-_AT_@ -3036,16 +3079,17 @@ xinit(void) {
- parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
- XRootWindow(xw.dpy, xw.scr);
- xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy,
-- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
-+ xw.w, xw.h, 0, xw.depth, InputOutput,
- xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
- | CWEventMask | CWColormap, &xw.attrs);
-
- memset(&gcvalues, 0, sizeof(gcvalues));
- gcvalues.graphics_exposures = False;
-- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
-+ dc.gc = XCreateGC(xw.dpy,
-+ (USE_ARGB)? xw.buf: parent,
-+ GCGraphicsExposures,
- &gcvalues);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
- XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
-
diff --git a/st.suckless.org/patches/st-0.5-externalpipe.diff b/st.suckless.org/patches/st-0.5-externalpipe.diff
deleted file mode 100644
index 8a1ef05..0000000
--- a/st.suckless.org/patches/st-0.5-externalpipe.diff
+++ /dev/null
_AT_@ -1,109 +0,0 @@
-diff --git a/st.c b/st.c
-index 392f12d..31660c8 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -301,6 +301,7 @@ typedef union {
- unsigned int ui;
- float f;
- const void *v;
-+ const char *s;
- } Arg;
-
- typedef struct {
-_AT_@ -315,6 +316,7 @@ static void clippaste(const Arg *);
- static void numlock(const Arg *);
- static void selpaste(const Arg *);
- static void xzoom(const Arg *);
-+static void externalpipe(const Arg *);
- static void printsel(const Arg *);
- static void printscreen(const Arg *) ;
- static void toggleprinter(const Arg *);
-_AT_@ -1179,15 +1181,22 @@ execsh(void) {
- void
- sigchld(int a) {
- int stat = 0;
-+ pid_t r;
-
-- if(waitpid(pid, &stat, 0) < 0)
-- die("Waiting for pid %hd failed: %s
", pid, SERRNO);
-+ r = wait(&stat);
-+ if(r < 0)
-+ die("wait(): %s
", strerror(errno));
-
-- if(WIFEXITED(stat)) {
-- exit(WEXITSTATUS(stat));
-- } else {
-- exit(EXIT_FAILURE);
-+ if(r == pid){
-+ /* _the_ sub process */
-+ if(WIFEXITED(stat)) {
-+ exit(WEXITSTATUS(stat));
-+ } else {
-+ exit(EXIT_FAILURE);
-+ }
- }
-+
-+ /* something else we've forked out */
- }
-
- void
-_AT_@ -2982,6 +2991,59 @@ xzoom(const Arg *arg) {
- }
-
- void
-+externalpipe(const Arg *arg)
-+{
-+ int to[2]; /* 0 = read, 1 = write */
-+ pid_t child;
-+ int y, x;
-+ void (*oldsigpipe)(int);
-+
-+ if(pipe(to) == -1)
-+ return;
-+
-+ /* sigchld() handles this */
-+ switch((child = fork())){
-+ case -1:
-+ close(to[0]), close(to[1]);
-+ return;
-+ case 0:
-+ /* child */
-+ close(to[1]);
-+ dup2(to[0], STDIN_FILENO); /* 0<&to */
-+ close(to[0]);
-+ execvp(
-+ "sh",
-+ (char *const []){
-+ "/bin/sh",
-+ "-c",
-+ (char *)arg->s,
-+ 0
-+ });
-+ exit(127);
-+ }
-+
-+ /* parent */
-+ close(to[0]);
-+ /* ignore sigpipe for now, in case child exits early */
-+ oldsigpipe = signal(SIGPIPE, SIG_IGN);
-+
-+ for(y = 0; y < term.row; y++){
-+ for(x = 0; x < term.col; x++){
-+ if(write(to[1], term.line[y][x].c, 1) == -1)
-+ goto done;
-+ }
-+ if(write(to[1], "
", 1) == -1)
-+ break;
-+ }
-+
-+done:
-+ close(to[1]);
-+
-+ /* restore */
-+ signal(SIGPIPE, oldsigpipe);
-+}
-+
-+void
- xinit(void) {
- XGCValues gcvalues;
- Cursor cursor;
diff --git a/st.suckless.org/patches/st-0.5-hidecursor.diff b/st.suckless.org/patches/st-0.5-hidecursor.diff
deleted file mode 100644
index 9ddbc4d..0000000
--- a/st.suckless.org/patches/st-0.5-hidecursor.diff
+++ /dev/null
_AT_@ -1,82 +0,0 @@
-diff --git a/st.c b/st.c
-index 392f12d..52deb92 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -248,6 +248,8 @@ typedef struct {
- Draw draw;
- Visual *vis;
- XSetWindowAttributes attrs;
-+ Cursor cursor, bcursor; /* visible and blank cursors */
-+ bool cursorstate; /* is cursor currently visible */
- int scr;
- bool isfixed; /* is fixed geometry? */
- int fx, fy, fw, fh; /* fixed geometry */
-_AT_@ -1112,6 +1114,13 @@ void
- bmotion(XEvent *e) {
- int oldey, oldex, oldsby, oldsey;
-
-+ if(!xw.cursorstate) {
-+ XDefineCursor(xw.dpy, xw.win, xw.cursor);
-+ xw.cursorstate = true;
-+ if(!IS_SET(MODE_MOUSEMANY))
-+ xsetpointermotion(0);
-+ }
-+
- if(IS_SET(MODE_MOUSE)) {
- mousereport(e);
- return;
-_AT_@ -2984,10 +2993,12 @@ xzoom(const Arg *arg) {
- void
- xinit(void) {
- XGCValues gcvalues;
-- Cursor cursor;
- Window parent;
- int sw, sh;
- pid_t thispid = getpid();
-+ XColor xcwhite = {.red = 0xffff, .green = 0xffff, .blue = 0xffff};
-+ XColor xcblack = {.red = 0x0000, .green = 0x0000, .blue = 0x0000};
-+ Pixmap blankpm;
-
- if(!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
-_AT_@ -3071,11 +3082,13 @@ xinit(void) {
- die("XCreateIC failed. Could not obtain input method.
");
-
- /* white cursor, black outline */
-- cursor = XCreateFontCursor(xw.dpy, XC_xterm);
-- XDefineCursor(xw.dpy, xw.win, cursor);
-- XRecolorCursor(xw.dpy, cursor,
-- &(XColor){.red = 0xffff, .green = 0xffff, .blue = 0xffff},
-- &(XColor){.red = 0x0000, .green = 0x0000, .blue = 0x0000});
-+ xw.cursor = XCreateFontCursor(xw.dpy, XC_xterm);
-+ XDefineCursor(xw.dpy, xw.win, xw.cursor);
-+ XRecolorCursor(xw.dpy, xw.cursor, &xcwhite, &xcblack);
-+ xw.cursorstate = true;
-+ blankpm = XCreateBitmapFromData(xw.dpy, xw.win, &(char){0}, 1, 1);
-+ xw.bcursor = XCreatePixmapCursor(xw.dpy, blankpm, blankpm,
-+ &xcblack, &xcblack, 0, 0);
-
- xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
- xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
-_AT_@ -3537,6 +3550,8 @@ unmap(XEvent *ev) {
-
- void
- xsetpointermotion(int set) {
-+ if(!set && !xw.cursorstate)
-+ return;
- MODBIT(xw.attrs.event_mask, set, PointerMotionMask);
- XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs);
- }
-_AT_@ -3630,6 +3645,12 @@ kpress(XEvent *ev) {
- Status status;
- Shortcut *bp;
-
-+ if(xw.cursorstate) {
-+ XDefineCursor(xw.dpy, xw.win, xw.bcursor);
-+ xsetpointermotion(1);
-+ xw.cursorstate = false;
-+ }
-+
- if(IS_SET(MODE_KBDLOCK))
- return;
-
diff --git a/st.suckless.org/patches/st-0.5-no-bold-colors.diff b/st.suckless.org/patches/st-0.5-no-bold-colors.diff
deleted file mode 100644
index 4f8814f..0000000
--- a/st.suckless.org/patches/st-0.5-no-bold-colors.diff
+++ /dev/null
_AT_@ -1,13 +0,0 @@
-diff --git a/st.c b/st.c
-index 392f12d..f893147 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -3152,7 +3152,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
- if(base.mode & ATTR_BOLD) {
- if(BETWEEN(base.fg, 0, 7)) {
- /* basic system colors */
-- fg = &dc.col[base.fg + 8];
-+ fg = &dc.col[base.fg];
- } else if(BETWEEN(base.fg, 16, 195)) {
- /* 256 colors */
- fg = &dc.col[base.fg + 36];
diff --git a/st.suckless.org/patches/st-0.5-solarized-dark.diff b/st.suckless.org/patches/st-0.5-solarized-dark.diff
deleted file mode 100644
index 6c6d0bd..0000000
--- a/st.suckless.org/patches/st-0.5-solarized-dark.diff
+++ /dev/null
_AT_@ -1,65 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 58b470e..f1c5ed1 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -51,30 +51,23 @@ static unsigned int tabspaces = 8;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-- /* 8 normal colors */
-- "black",
-- "red3",
-- "green3",
-- "yellow3",
-- "blue2",
-- "magenta3",
-- "cyan3",
-- "gray90",
--
-- /* 8 bright colors */
-- "gray50",
-- "red",
-- "green",
-- "yellow",
-- "#5c5cff",
-- "magenta",
-- "cyan",
-- "white",
--
-- [255] = 0,
--
-- /* more colors can be added after 255 to use with DefaultXX */
-- "#cccccc",
-+ /* solarized dark */
-+ "#073642", /* 0: black */
-+ "#dc322f", /* 1: red */
-+ "#859900", /* 2: green */
-+ "#b58900", /* 3: yellow */
-+ "#268bd2", /* 4: blue */
-+ "#d33682", /* 5: magenta */
-+ "#2aa198", /* 6: cyan */
-+ "#eee8d5", /* 7: white */
-+ "#002b36", /* 8: brblack */
-+ "#cb4b16", /* 9: brred */
-+ "#586e75", /* 10: brgreen */
-+ "#657b83", /* 11: bryellow */
-+ "#839496", /* 12: brblue */
-+ "#6c71c4", /* 13: brmagenta*/
-+ "#93a1a1", /* 14: brcyan */
-+ "#fdf6e3", /* 15: brwhite */
- };
-
-
-_AT_@ -82,9 +75,9 @@ static const char *colorname[] = {
- * Default colors (colorname index)
- * foreground, background, cursor
- */
--static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
--static unsigned int defaultcs = 256;
-+static unsigned int defaultfg = 12;
-+static unsigned int defaultbg = 8;
-+static unsigned int defaultcs = 14;
-
- /*
- * Colors used, when the specific fg == defaultfg. So in reverse mode this
diff --git a/st.suckless.org/patches/st-0.5-solarized-light.diff b/st.suckless.org/patches/st-0.5-solarized-light.diff
deleted file mode 100644
index 422a02a..0000000
--- a/st.suckless.org/patches/st-0.5-solarized-light.diff
+++ /dev/null
_AT_@ -1,65 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 58b470e..ec39cca 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -51,30 +51,23 @@ static unsigned int tabspaces = 8;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-- /* 8 normal colors */
-- "black",
-- "red3",
-- "green3",
-- "yellow3",
-- "blue2",
-- "magenta3",
-- "cyan3",
-- "gray90",
--
-- /* 8 bright colors */
-- "gray50",
-- "red",
-- "green",
-- "yellow",
-- "#5c5cff",
-- "magenta",
-- "cyan",
-- "white",
--
-- [255] = 0,
--
-- /* more colors can be added after 255 to use with DefaultXX */
-- "#cccccc",
-+ /* solarized light */
-+ "#eee8d5", /* 0: black */
-+ "#dc322f", /* 1: red */
-+ "#859900", /* 2: green */
-+ "#b58900", /* 3: yellow */
-+ "#268bd2", /* 4: blue */
-+ "#d33682", /* 5: magenta */
-+ "#2aa198", /* 6: cyan */
-+ "#073642", /* 7: white */
-+ "#fdf6e3", /* 8: brblack */
-+ "#cb4b16", /* 9: brred */
-+ "#93a1a1", /* 10: brgreen */
-+ "#839496", /* 11: bryellow */
-+ "#657b83", /* 12: brblue */
-+ "#6c71c4", /* 13: brmagenta*/
-+ "#586e75", /* 14: brcyan */
-+ "#002b36", /* 15: brwhite */
- };
-
-
-_AT_@ -82,9 +75,9 @@ static const char *colorname[] = {
- * Default colors (colorname index)
- * foreground, background, cursor
- */
--static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
--static unsigned int defaultcs = 256;
-+static unsigned int defaultfg = 12;
-+static unsigned int defaultbg = 8;
-+static unsigned int defaultcs = 14;
-
- /*
- * Colors used, when the specific fg == defaultfg. So in reverse mode this
diff --git a/st.suckless.org/patches/st-0.5-wordbreak.diff b/st.suckless.org/patches/st-0.5-wordbreak.diff
deleted file mode 100644
index f30155e..0000000
--- a/st.suckless.org/patches/st-0.5-wordbreak.diff
+++ /dev/null
_AT_@ -1,52 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 58b470e..8a8d968 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -47,7 +47,7 @@ static int bellvolume = 0;
- static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
--
-+#define WORD_BREAK " "
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-diff --git a/st.c b/st.c
-index 392f12d..6a32d03 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -343,6 +343,7 @@ typedef struct {
- } DC;
-
- static void die(const char *, ...);
-+static bool is_word_break(char);
- static void draw(void);
- static void redraw(int);
- static void drawregion(int, int, int, int);
-_AT_@ -751,7 +752,7 @@ selsnap(int mode, int *x, int *y, int direction) {
- */
- if(direction > 0) {
- i = term.col;
-- while(--i > 0 && term.line[*y][i].c[0] == ' ')
-+ while(--i > 0 && is_word_break(term.line[*y][i].c[0]))
- /* nothing */;
- if(i > 0 && i < *x)
- *x = term.col - 1;
-_AT_@ -1141,6 +1142,17 @@ die(const char *errstr, ...) {
- exit(EXIT_FAILURE);
- }
-
-+bool
-+is_word_break(char c) {
-+ static char *word_break = WORD_BREAK;
-+ char *s = word_break;
-+ while(*s) {
-+ if(*s == c) return true;
-+ s++;
-+ }
-+ return false;
-+}
-+
- void
- execsh(void) {
- char **args;
diff --git a/st.suckless.org/patches/st-0.6-argbbg.diff b/st.suckless.org/patches/st-0.6-argbbg.diff
deleted file mode 100644
index 4db4442..0000000
--- a/st.suckless.org/patches/st-0.6-argbbg.diff
+++ /dev/null
_AT_@ -1,170 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 64e75b8..9a27c14 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -58,6 +58,8 @@ static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
-
-+/* bg opacity */
-+static const int alpha = 0xdd;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-_AT_@ -85,6 +87,7 @@ static const char *colorname[] = {
-
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
-+ "black",
- };
-
-
-_AT_@ -93,7 +96,7 @@ static const char *colorname[] = {
- * foreground, background, cursor
- */
- static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
-+static unsigned int defaultbg = 257;
- static unsigned int defaultcs = 256;
-
- /*
-diff --git a/config.mk b/config.mk
-index 67844dc..005b1c6 100644
---- a/config.mk
-+++ b/config.mk
-_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
- INCS = -I. -I/usr/include -I${X11INC} \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft \
-+LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft -lXrender\
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
-
-diff --git a/st.c b/st.c
-index b89d094..d212134 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -61,6 +61,7 @@ char *argv0;
- #define XK_ANY_MOD UINT_MAX
- #define XK_NO_MOD 0
- #define XK_SWITCH_MOD (1<<13)
-+#define OPAQUE 0Xff
-
- /* macros */
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
-_AT_@ -77,6 +78,7 @@ char *argv0;
- #define IS_SET(flag) ((term.mode & (flag)) != 0)
- #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_nsec-t2.tv_nsec)/1E6)
- #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
-+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
-
- #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
- #define IS_TRUECOL(x) (1 << 24 & (x))
-_AT_@ -265,6 +267,7 @@ typedef struct {
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
-+ int depth; /* bit depth */
- char state; /* focus, redraw, visible */
- int cursor; /* cursor style */
- } XWindow;
-_AT_@ -2895,8 +2898,7 @@ xresize(int col, int row) {
- xw.th = MAX(1, row * xw.ch);
-
- XFreePixmap(xw.dpy, xw.buf);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
- XftDrawChange(xw.draw, xw.buf);
- xclear(0, 0, xw.w, xw.h);
- }
-_AT_@ -2946,6 +2948,14 @@ xloadcols(void) {
- else
- die("Could not allocate color %d
", i);
- }
-+
-+ /* set alpha value of bg color */
-+ if (USE_ARGB) {
-+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
-+ dc.col[defaultbg].pixel &= 0x00111111;
-+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
-+ }
-+
- loaded = true;
- }
-
-_AT_@ -3189,7 +3199,38 @@ xinit(void) {
- if(!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
- xw.scr = XDefaultScreen(xw.dpy);
-- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ else {
-+ XVisualInfo *vis;
-+ XRenderPictFormat *fmt;
-+ int nvi;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = xw.scr,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+
-+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
-+ xw.vis = NULL;
-+ for(i = 0; i < nvi; i ++) {
-+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ xw.vis = vis[i].visual;
-+ break;
-+ }
-+ }
-+
-+ XFree(vis);
-+
-+ if (! xw.vis) {
-+ fprintf(stderr, "Couldn't find ARGB visual.
");
-+ exit(1);
-+ }
-+ }
-
- /* font */
- if(!FcInit())
-_AT_@ -3199,7 +3240,10 @@ xinit(void) {
- xloadfonts(usedfont, 0);
-
- /* colors */
-- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ else
-+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
- xloadcols();
-
- /* adjust fixed window geometry */
-_AT_@ -3222,16 +3266,17 @@ xinit(void) {
- if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
- parent = XRootWindow(xw.dpy, xw.scr);
- xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
-- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
-+ xw.w, xw.h, 0, xw.depth, InputOutput,
- xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
- | CWEventMask | CWColormap, &xw.attrs);
-
- memset(&gcvalues, 0, sizeof(gcvalues));
- gcvalues.graphics_exposures = False;
-- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
-+ dc.gc = XCreateGC(xw.dpy,
-+ (USE_ARGB)? xw.buf: parent,
-+ GCGraphicsExposures,
- &gcvalues);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
- XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
-
diff --git a/st.suckless.org/patches/st-0.6-clipboard.diff b/st.suckless.org/patches/st-0.6-clipboard.diff
deleted file mode 100644
index 25e6a2a..0000000
--- a/st.suckless.org/patches/st-0.6-clipboard.diff
+++ /dev/null
_AT_@ -1,13 +0,0 @@
-diff --git a/st.c b/st.c
-index b89d094..6658e6a 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -1155,6 +1155,8 @@ xsetsel(char *str, Time t) {
- XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
- if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
- selclear(0);
-+
-+ clipcopy(NULL);
- }
-
- void
diff --git a/st.suckless.org/patches/st-0.6-copyurl.diff b/st.suckless.org/patches/st-0.6-copyurl.diff
deleted file mode 100644
index 2415f46..0000000
--- a/st.suckless.org/patches/st-0.6-copyurl.diff
+++ /dev/null
_AT_@ -1,88 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 64e75b8..c3d4e88 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -128,6 +128,7 @@ static Shortcut shortcuts[] = {
- { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} },
- { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} },
- { MODKEY, XK_Num_Lock, numlock, {.i = 0} },
-+ { MODKEY, XK_l, copyurl, {.i = 0} },
- };
-
- /*
-diff --git a/st.c b/st.c
-index b89d094..dafd5ba 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -332,6 +332,7 @@ static void xzoomreset(const Arg *);
- static void printsel(const Arg *);
- static void printscreen(const Arg *) ;
- static void toggleprinter(const Arg *);
-+static void copyurl(const Arg *);
-
- /* Config.h for applying patches and the configuration. */
- #include "config.h"
-_AT_@ -4080,3 +4081,63 @@ run:
- return 0;
- }
-
-+/* select and copy the previous url on screen (do nothing if there's no url).
-+ * known bug: doesn't handle urls that span multiple lines (wontfix)
-+ * known bug: only finds first url on line (mightfix)
-+ */
-+void
-+copyurl(const Arg *arg) {
-+ /* () and [] can appear in urls, but excluding them here will reduce false
-+ * positives when figuring out where a given url ends.
-+ */
-+ static char URLCHARS[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-+ "abcdefghijklmnopqrstuvwxyz"
-+ "0123456789-._~:/?#_AT_!$&'*+,;=%";
-+
-+ int i, row, startrow;
-+ char *linestr = calloc(sizeof(char), term.col+1); /* assume ascii */
-+ char *c, *match = NULL;
-+
-+ row = (sel.ob.x >= 0 && sel.nb.y > 0) ? sel.nb.y-1 : term.bot;
-+ LIMIT(row, term.top, term.bot);
-+ startrow = row;
-+
-+ /* find the start of the last url before selection */
-+ do {
-+ for (i = 0; i < term.col; ++i) {
-+ if (term.line[row][i].u > 127) /* assume ascii */
-+ continue;
-+ linestr[i] = term.line[row][i].u;
-+ }
-+ linestr[term.col] = '
Received on Wed Jun 15 2016 - 14:06:45 CEST
This archive was generated by hypermail 2.3.0 : Wed Jun 15 2016 - 14:12:14 CEST