diff options
| author | yuzu-eva <stevenhu@web.de> | 2022-12-16 01:29:25 +0100 |
|---|---|---|
| committer | yuzu-eva <stevenhu@web.de> | 2022-12-16 01:29:25 +0100 |
| commit | c2eeef84fdfa3cb9a40d00d0aa0f35aa09438d99 (patch) | |
| tree | 19e163e727b9e51cbcf45546247a4eb53e53ee98 /patches | |
| parent | d09d571d89ec32e81904bfcc230a0fbb1628bd9a (diff) | |
removed duplicate folder
Diffstat (limited to 'patches')
| -rw-r--r-- | patches/st-externalpipe-0.8.4.diff | 92 | ||||
| -rw-r--r-- | patches/st-font2-0.8.5.diff | 163 |
2 files changed, 0 insertions, 255 deletions
diff --git a/patches/st-externalpipe-0.8.4.diff b/patches/st-externalpipe-0.8.4.diff deleted file mode 100644 index 297d746..0000000 --- a/patches/st-externalpipe-0.8.4.diff +++ /dev/null @@ -1,92 +0,0 @@ -diff --git a/st.c b/st.c -index 76b7e0d..0e9a614 100644 ---- a/st.c -+++ b/st.c -@@ -723,8 +723,14 @@ sigchld(int a) - if ((p = waitpid(pid, &stat, WNOHANG)) < 0) - die("waiting for pid %hd failed: %s\n", pid, strerror(errno)); - -- if (pid != p) -+ if (pid != p) { -+ if (p == 0 && wait(&stat) < 0) -+ die("wait: %s\n", strerror(errno)); -+ -+ /* reinstall sigchld handler */ -+ signal(SIGCHLD, sigchld); - return; -+ } - - if (WIFEXITED(stat) && WEXITSTATUS(stat)) - die("child exited with status %d\n", WEXITSTATUS(stat)); -@@ -1926,6 +1932,59 @@ strparse(void) - } - } - -+void -+externalpipe(const Arg *arg) -+{ -+ int to[2]; -+ char buf[UTF_SIZ]; -+ void (*oldsigpipe)(int); -+ Glyph *bp, *end; -+ int lastpos, n, newline; -+ -+ if (pipe(to) == -1) -+ return; -+ -+ switch (fork()) { -+ case -1: -+ close(to[0]); -+ close(to[1]); -+ return; -+ case 0: -+ dup2(to[0], STDIN_FILENO); -+ close(to[0]); -+ close(to[1]); -+ execvp(((char **)arg->v)[0], (char **)arg->v); -+ fprintf(stderr, "st: execvp %s\n", ((char **)arg->v)[0]); -+ perror("failed"); -+ exit(0); -+ } -+ -+ close(to[0]); -+ /* ignore sigpipe for now, in case child exists early */ -+ oldsigpipe = signal(SIGPIPE, SIG_IGN); -+ newline = 0; -+ for (n = 0; n < term.row; n++) { -+ bp = term.line[n]; -+ lastpos = MIN(tlinelen(n) + 1, term.col) - 1; -+ if (lastpos < 0) -+ break; -+ end = &bp[lastpos + 1]; -+ for (; bp < end; ++bp) -+ if (xwrite(to[1], buf, utf8encode(bp->u, buf)) < 0) -+ break; -+ if ((newline = term.line[n][lastpos].mode & ATTR_WRAP)) -+ continue; -+ if (xwrite(to[1], "\n", 1) < 0) -+ break; -+ newline = 0; -+ } -+ if (newline) -+ (void)xwrite(to[1], "\n", 1); -+ close(to[1]); -+ /* restore */ -+ signal(SIGPIPE, oldsigpipe); -+} -+ - void - strdump(void) - { -diff --git a/st.h b/st.h -index 3d351b6..392b64e 100644 ---- a/st.h -+++ b/st.h -@@ -81,6 +81,7 @@ void die(const char *, ...); - void redraw(void); - void draw(void); - -+void externalpipe(const Arg *); - void printscreen(const Arg *); - void printsel(const Arg *); - void sendbreak(const Arg *); diff --git a/patches/st-font2-0.8.5.diff b/patches/st-font2-0.8.5.diff deleted file mode 100644 index 9b22b8a..0000000 --- a/patches/st-font2-0.8.5.diff +++ /dev/null @@ -1,163 +0,0 @@ -From 1635e04d3643dd4caa0c7c2043b585c6d7e4705f Mon Sep 17 00:00:00 2001 -From: Rizqi Nur Assyaufi <bandithijo@gmail.com> -Date: Mon, 18 Jul 2022 01:15:45 +0800 -Subject: [PATCH] [st][patch][font2] Add patch for st-0.8.5 - ---- - config.def.h | 6 +++ - x.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 107 insertions(+) - -diff --git a/config.def.h b/config.def.h -index 91ab8ca..717b2f0 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -6,6 +6,12 @@ - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ - static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; -+/* Spare fonts */ -+static char *font2[] = { -+/* "Inconsolata for Powerline:pixelsize=12:antialias=true:autohint=true", */ -+/* "Hack Nerd Font Mono:pixelsize=11:antialias=true:autohint=true", */ -+}; -+ - static int borderpx = 2; - - /* -diff --git a/x.c b/x.c -index 8a16faa..220fc4f 100644 ---- a/x.c -+++ b/x.c -@@ -157,6 +157,8 @@ static void xhints(void); - static int xloadcolor(int, const char *, Color *); - static int xloadfont(Font *, FcPattern *); - static void xloadfonts(const char *, double); -+static int xloadsparefont(FcPattern *, int); -+static void xloadsparefonts(void); - static void xunloadfont(Font *); - static void xunloadfonts(void); - static void xsetenv(void); -@@ -306,6 +308,7 @@ zoomabs(const Arg *arg) - { - xunloadfonts(); - xloadfonts(usedfont, arg->f); -+ xloadsparefonts(); - cresize(0, 0); - redraw(); - xhints(); -@@ -1034,6 +1037,101 @@ xloadfonts(const char *fontstr, double fontsize) - FcPatternDestroy(pattern); - } - -+int -+xloadsparefont(FcPattern *pattern, int flags) -+{ -+ FcPattern *match; -+ FcResult result; -+ -+ match = FcFontMatch(NULL, pattern, &result); -+ if (!match) { -+ return 1; -+ } -+ -+ if (!(frc[frclen].font = XftFontOpenPattern(xw.dpy, match))) { -+ FcPatternDestroy(match); -+ return 1; -+ } -+ -+ frc[frclen].flags = flags; -+ /* Believe U+0000 glyph will present in each default font */ -+ frc[frclen].unicodep = 0; -+ frclen++; -+ -+ return 0; -+} -+ -+void -+xloadsparefonts(void) -+{ -+ FcPattern *pattern; -+ double sizeshift, fontval; -+ int fc; -+ char **fp; -+ -+ if (frclen != 0) -+ die("can't embed spare fonts. cache isn't empty"); -+ -+ /* Calculate count of spare fonts */ -+ fc = sizeof(font2) / sizeof(*font2); -+ if (fc == 0) -+ return; -+ -+ /* Allocate memory for cache entries. */ -+ if (frccap < 4 * fc) { -+ frccap += 4 * fc - frccap; -+ frc = xrealloc(frc, frccap * sizeof(Fontcache)); -+ } -+ -+ for (fp = font2; fp - font2 < fc; ++fp) { -+ -+ if (**fp == '-') -+ pattern = XftXlfdParse(*fp, False, False); -+ else -+ pattern = FcNameParse((FcChar8 *)*fp); -+ -+ if (!pattern) -+ die("can't open spare font %s\n", *fp); -+ -+ if (defaultfontsize > 0) { -+ sizeshift = usedfontsize - defaultfontsize; -+ if (sizeshift != 0 && -+ FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == -+ FcResultMatch) { -+ fontval += sizeshift; -+ FcPatternDel(pattern, FC_PIXEL_SIZE); -+ FcPatternDel(pattern, FC_SIZE); -+ FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval); -+ } -+ } -+ -+ FcPatternAddBool(pattern, FC_SCALABLE, 1); -+ -+ FcConfigSubstitute(NULL, pattern, FcMatchPattern); -+ XftDefaultSubstitute(xw.dpy, xw.scr, pattern); -+ -+ if (xloadsparefont(pattern, FRC_NORMAL)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_SLANT); -+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); -+ if (xloadsparefont(pattern, FRC_ITALIC)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_WEIGHT); -+ FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); -+ if (xloadsparefont(pattern, FRC_ITALICBOLD)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_SLANT); -+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); -+ if (xloadsparefont(pattern, FRC_BOLD)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDestroy(pattern); -+ } -+} -+ - void - xunloadfont(Font *f) - { -@@ -1131,6 +1229,9 @@ xinit(int cols, int rows) - usedfont = (opt_font == NULL)? font : opt_font; - xloadfonts(usedfont, 0); - -+ /* spare fonts */ -+ xloadsparefonts(); -+ - /* colors */ - xw.cmap = XDefaultColormap(xw.dpy, xw.scr); - xloadcols(); --- -2.37.1 - |
