Updates patches for st version 0.9
This commit is contained in:
parent
604b0c6f10
commit
7ea7533f91
|
@ -1,17 +1,17 @@
|
|||
From 7979ecf01c6d68f8a6593e3f338c77b8d7526931 Mon Sep 17 00:00:00 2001
|
||||
From 307b030a02f8bfda47600acc881fdd4876767204 Mon Sep 17 00:00:00 2001
|
||||
From: Shourai <10200748+Shourai@users.noreply.github.com>
|
||||
Date: Sat, 18 Jul 2020 12:48:15 +0200
|
||||
Subject: [PATCH 1/5] Apply alpha
|
||||
Date: Tue, 8 Nov 2022 19:30:52 +0100
|
||||
Subject: Apply alpha on st version 0.9
|
||||
|
||||
---
|
||||
config.def.h | 13 ++++++++-----
|
||||
config.def.h | 3 +++
|
||||
config.mk | 2 +-
|
||||
st.h | 1 +
|
||||
x.c | 40 ++++++++++++++++++++++++++++++----------
|
||||
4 files changed, 40 insertions(+), 16 deletions(-)
|
||||
4 files changed, 35 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 6f05dce..53b93ab 100644
|
||||
index 91ab8ca..38e5154 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -93,6 +93,9 @@ char *termname = "st-256color";
|
||||
|
@ -19,37 +19,13 @@ index 6f05dce..53b93ab 100644
|
|||
unsigned int tabspaces = 8;
|
||||
|
||||
+/* bg opacity */
|
||||
+float alpha = 0.70;
|
||||
+float alpha = 0.7;
|
||||
+
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
/* 8 normal colors */
|
||||
@@ -118,8 +121,8 @@ static const char *colorname[] = {
|
||||
[255] = 0,
|
||||
|
||||
/* more colors can be added after 255 to use with DefaultXX */
|
||||
- "#cccccc",
|
||||
- "#555555",
|
||||
+ "#272727",
|
||||
+ "#ffffff",
|
||||
};
|
||||
|
||||
|
||||
@@ -127,9 +130,9 @@ static const char *colorname[] = {
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
-unsigned int defaultfg = 7;
|
||||
-unsigned int defaultbg = 0;
|
||||
-static unsigned int defaultcs = 256;
|
||||
+unsigned int defaultfg = 257;
|
||||
+unsigned int defaultbg = 256;
|
||||
+static unsigned int defaultcs = 257;
|
||||
static unsigned int defaultrcs = 257;
|
||||
|
||||
/*
|
||||
diff --git a/config.mk b/config.mk
|
||||
index c070a4a..aaa54ff 100644
|
||||
index 1e306f8..47c615e 100644
|
||||
--- a/config.mk
|
||||
+++ b/config.mk
|
||||
@@ -16,7 +16,7 @@ PKG_CONFIG = pkg-config
|
||||
|
@ -62,16 +38,16 @@ index c070a4a..aaa54ff 100644
|
|||
`$(PKG_CONFIG) --libs freetype2`
|
||||
|
||||
diff --git a/st.h b/st.h
|
||||
index 3d351b6..9f11a6a 100644
|
||||
index fd3b0d8..9f91e2a 100644
|
||||
--- a/st.h
|
||||
+++ b/st.h
|
||||
@@ -123,3 +123,4 @@ extern char *termname;
|
||||
extern unsigned int tabspaces;
|
||||
@@ -124,3 +124,4 @@ extern unsigned int tabspaces;
|
||||
extern unsigned int defaultfg;
|
||||
extern unsigned int defaultbg;
|
||||
extern unsigned int defaultcs;
|
||||
+extern float alpha;
|
||||
diff --git a/x.c b/x.c
|
||||
index 210f184..73545d8 100644
|
||||
index aa09997..8a65792 100644
|
||||
--- a/x.c
|
||||
+++ b/x.c
|
||||
@@ -105,6 +105,7 @@ typedef struct {
|
||||
|
@ -90,7 +66,7 @@ index 210f184..73545d8 100644
|
|||
static char *opt_class = NULL;
|
||||
static char **opt_cmd = NULL;
|
||||
static char *opt_embed = NULL;
|
||||
@@ -734,7 +736,7 @@ xresize(int col, int row)
|
||||
@@ -752,7 +754,7 @@ xresize(int col, int row)
|
||||
|
||||
XFreePixmap(xw.dpy, xw.buf);
|
||||
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
|
||||
|
@ -99,7 +75,7 @@ index 210f184..73545d8 100644
|
|||
XftDrawChange(xw.draw, xw.buf);
|
||||
xclear(0, 0, win.w, win.h);
|
||||
|
||||
@@ -794,6 +796,13 @@ xloadcols(void)
|
||||
@@ -812,6 +814,13 @@ xloadcols(void)
|
||||
else
|
||||
die("could not allocate color %d\n", i);
|
||||
}
|
||||
|
@ -113,7 +89,7 @@ index 210f184..73545d8 100644
|
|||
loaded = 1;
|
||||
}
|
||||
|
||||
@@ -1103,11 +1112,23 @@ xinit(int cols, int rows)
|
||||
@@ -1134,11 +1143,23 @@ xinit(int cols, int rows)
|
||||
Window parent;
|
||||
pid_t thispid = getpid();
|
||||
XColor xmousefg, xmousebg;
|
||||
|
@ -138,7 +114,7 @@ index 210f184..73545d8 100644
|
|||
|
||||
/* font */
|
||||
if (!FcInit())
|
||||
@@ -1117,7 +1138,7 @@ xinit(int cols, int rows)
|
||||
@@ -1148,7 +1169,7 @@ xinit(int cols, int rows)
|
||||
xloadfonts(usedfont, 0);
|
||||
|
||||
/* colors */
|
||||
|
@ -147,7 +123,7 @@ index 210f184..73545d8 100644
|
|||
xloadcols();
|
||||
|
||||
/* adjust fixed window geometry */
|
||||
@@ -1137,19 +1158,15 @@ xinit(int cols, int rows)
|
||||
@@ -1168,19 +1189,15 @@ xinit(int cols, int rows)
|
||||
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
|
||||
xw.attrs.colormap = xw.cmap;
|
||||
|
||||
|
@ -170,7 +146,7 @@ index 210f184..73545d8 100644
|
|||
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
|
||||
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
|
||||
|
||||
@@ -1988,6 +2005,9 @@ main(int argc, char *argv[])
|
||||
@@ -2038,6 +2055,9 @@ main(int argc, char *argv[])
|
||||
case 'a':
|
||||
allowaltscreen = 0;
|
||||
break;
|
||||
|
@ -181,5 +157,5 @@ index 210f184..73545d8 100644
|
|||
opt_class = EARGF(usage());
|
||||
break;
|
||||
--
|
||||
2.27.0
|
||||
2.38.1
|
||||
|
|
@ -1,29 +1,15 @@
|
|||
From ff4fd8469be355ae8fe9e8a0feee46a734b68e74 Mon Sep 17 00:00:00 2001
|
||||
From 2898f59f9b446b9ca748e544e61407e832ce5361 Mon Sep 17 00:00:00 2001
|
||||
From: Shourai <10200748+Shourai@users.noreply.github.com>
|
||||
Date: Sat, 18 Jul 2020 12:48:28 +0200
|
||||
Subject: [PATCH 2/5] Apply font2
|
||||
Date: Tue, 8 Nov 2022 19:35:52 +0100
|
||||
Subject: Apply font2 on st version 0.9
|
||||
|
||||
---
|
||||
Makefile | 2 +-
|
||||
config.def.h | 10 ++++-
|
||||
x.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 111 insertions(+), 2 deletions(-)
|
||||
2 files changed, 110 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 470ac86..4d49649 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -30,7 +30,7 @@ st: $(OBJ)
|
||||
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
|
||||
|
||||
clean:
|
||||
- rm -f st $(OBJ) st-$(VERSION).tar.gz
|
||||
+ rm -f st $(OBJ) st-$(VERSION).tar.gz config.h
|
||||
|
||||
dist: clean
|
||||
mkdir -p st-$(VERSION)
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 53b93ab..984158d 100644
|
||||
index 38e5154..2ac0781 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -5,7 +5,15 @@
|
||||
|
@ -34,23 +20,23 @@ index 53b93ab..984158d 100644
|
|||
+static char *font = "Jetbrains Mono:pixelsize=14:antialias=true:autohint=true";
|
||||
+/* Spare fonts */
|
||||
+static char *font2[] = {
|
||||
+ "Droid Sans Mono:style=Regular:pixelsize=14:antialias=true:autohint=true",
|
||||
+ "Menlo:style=Regular:pixelsize=14:antialias=true:autohint=true",
|
||||
+ "Inconsolata for Powerline:pixelsize=14:antialias=true:autohint=true",
|
||||
+ "Hack Nerd Font Mono:pixelsize=14:antialias=true:autohint=true",
|
||||
+ "Droid Sans Mono:style=Regular:pixelsize=14:antialias=true:autohint=true",
|
||||
+ "Menlo:style=Regular:pixelsize=14:antialias=true:autohint=true",
|
||||
+ "Inconsolata for Powerline:pixelsize=14:antialias=true:autohint=true",
|
||||
+ "Hack Nerd Font Mono:pixelsize=14:antialias=true:autohint=true",
|
||||
+};
|
||||
+
|
||||
static int borderpx = 2;
|
||||
|
||||
/*
|
||||
diff --git a/x.c b/x.c
|
||||
index 73545d8..a729880 100644
|
||||
index 8a65792..db17dcf 100644
|
||||
--- a/x.c
|
||||
+++ b/x.c
|
||||
@@ -158,6 +158,8 @@ static void xhints(void);
|
||||
static int xloadcolor(int, const char *, Color *);
|
||||
static int xloadfont(Font *, FcPattern *);
|
||||
static void xloadfonts(char *, double);
|
||||
static void xloadfonts(const char *, double);
|
||||
+static int xloadsparefont(FcPattern *, int);
|
||||
+static void xloadsparefonts(void);
|
||||
static void xunloadfont(Font *);
|
||||
|
@ -64,7 +50,7 @@ index 73545d8..a729880 100644
|
|||
cresize(0, 0);
|
||||
redraw();
|
||||
xhints();
|
||||
@@ -1028,6 +1031,101 @@ xloadfonts(char *fontstr, double fontsize)
|
||||
@@ -1059,6 +1062,101 @@ xloadfonts(const char *fontstr, double fontsize)
|
||||
FcPatternDestroy(pattern);
|
||||
}
|
||||
|
||||
|
@ -73,7 +59,7 @@ index 73545d8..a729880 100644
|
|||
+{
|
||||
+ FcPattern *match;
|
||||
+ FcResult result;
|
||||
+
|
||||
+
|
||||
+ match = FcFontMatch(NULL, pattern, &result);
|
||||
+ if (!match) {
|
||||
+ return 1;
|
||||
|
@ -115,50 +101,50 @@ index 73545d8..a729880 100644
|
|||
+ }
|
||||
+
|
||||
+ 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) {
|
||||
+ 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);
|
||||
+ }
|
||||
+}
|
||||
|
@ -166,7 +152,7 @@ index 73545d8..a729880 100644
|
|||
void
|
||||
xunloadfont(Font *f)
|
||||
{
|
||||
@@ -1137,6 +1235,9 @@ xinit(int cols, int rows)
|
||||
@@ -1168,6 +1266,9 @@ xinit(int cols, int rows)
|
||||
usedfont = (opt_font == NULL)? font : opt_font;
|
||||
xloadfonts(usedfont, 0);
|
||||
|
||||
|
@ -177,5 +163,5 @@ index 73545d8..a729880 100644
|
|||
xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None);
|
||||
xloadcols();
|
||||
--
|
||||
2.27.0
|
||||
2.38.1
|
||||
|
|
@ -1,17 +1,18 @@
|
|||
From 01802617dab7370542755f7e38453be57e7516c8 Mon Sep 17 00:00:00 2001
|
||||
From 66e82b1d4db5c6ad7d62f809c38ff6f27773238a Mon Sep 17 00:00:00 2001
|
||||
From: Shourai <10200748+Shourai@users.noreply.github.com>
|
||||
Date: Sat, 18 Jul 2020 12:48:48 +0200
|
||||
Subject: [PATCH 3/5] Apply colorscheme
|
||||
Date: Tue, 8 Nov 2022 19:45:28 +0100
|
||||
Subject: Apply colorscheme on st version 0.9
|
||||
|
||||
Apply colorscheme on st version 0.9
|
||||
---
|
||||
config.def.h | 38 +++++++++++++++++++-------------------
|
||||
1 file changed, 19 insertions(+), 19 deletions(-)
|
||||
config.def.h | 57 +++++++++++++++++++++++++---------------------------
|
||||
1 file changed, 27 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 984158d..1e55784 100644
|
||||
index 2ac0781..21a5b0a 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -106,25 +106,25 @@ float alpha = 0.70;
|
||||
@@ -106,33 +106,30 @@ float alpha = 0.7;
|
||||
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
|
@ -34,6 +35,15 @@ index 984158d..1e55784 100644
|
|||
- "magenta",
|
||||
- "cyan",
|
||||
- "white",
|
||||
-
|
||||
- [255] = 0,
|
||||
-
|
||||
- /* more colors can be added after 255 to use with DefaultXX */
|
||||
- "#cccccc",
|
||||
- "#555555",
|
||||
- "gray90", /* default foreground colour */
|
||||
- "black", /* default background colour */
|
||||
+
|
||||
+ /* 8 normal colors */
|
||||
+ [0] = "#002b36", /* black */
|
||||
+ [1] = "#dc322f", /* red */
|
||||
|
@ -53,9 +63,26 @@ index 984158d..1e55784 100644
|
|||
+ [13] = "#6c71c4", /* magenta */
|
||||
+ [14] = "#2aa198", /* cyan */
|
||||
+ [15] = "#fdf6e3", /* white */
|
||||
+
|
||||
+ /* special colors */
|
||||
+ [256] = "#272727", /* background */
|
||||
+ [257] = "#ffffff", /* foreground */
|
||||
};
|
||||
|
||||
[255] = 0,
|
||||
|
||||
@@ -140,9 +137,9 @@ static const char *colorname[] = {
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
-unsigned int defaultfg = 258;
|
||||
-unsigned int defaultbg = 259;
|
||||
-unsigned int defaultcs = 256;
|
||||
+unsigned int defaultfg = 257;
|
||||
+unsigned int defaultbg = 256;
|
||||
+unsigned int defaultcs = 257;
|
||||
static unsigned int defaultrcs = 257;
|
||||
|
||||
/*
|
||||
--
|
||||
2.27.0
|
||||
2.38.1
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
From ea299313051d7d0aa1240b1e7ce57c8844915262 Mon Sep 17 00:00:00 2001
|
||||
From a248b1eedb9de154751faf9760f15edca141c353 Mon Sep 17 00:00:00 2001
|
||||
From: Shourai <10200748+Shourai@users.noreply.github.com>
|
||||
Date: Sat, 18 Jul 2020 12:48:58 +0200
|
||||
Subject: [PATCH 4/5] Apply clipboard
|
||||
Date: Tue, 8 Nov 2022 19:49:03 +0100
|
||||
Subject: Apply clipboard on st version 0.9
|
||||
|
||||
---
|
||||
x.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/x.c b/x.c
|
||||
index a729880..c87e48e 100644
|
||||
index db17dcf..c7ef7fc 100644
|
||||
--- a/x.c
|
||||
+++ b/x.c
|
||||
@@ -678,6 +678,7 @@ setsel(char *str, Time t)
|
||||
@@ -691,6 +691,7 @@ setsel(char *str, Time t)
|
||||
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
|
||||
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
|
||||
selclear();
|
||||
|
@ -20,5 +20,5 @@ index a729880..c87e48e 100644
|
|||
|
||||
void
|
||||
--
|
||||
2.27.0
|
||||
2.38.1
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
From 066e1d364baef67e9cae2289dbb47d6a0724a360 Mon Sep 17 00:00:00 2001
|
||||
From: Shourai <10200748+Shourai@users.noreply.github.com>
|
||||
Date: Sat, 18 Jul 2020 12:50:44 +0200
|
||||
Subject: [PATCH 5/5] Apply keybindings for zoom
|
||||
|
||||
---
|
||||
config.def.h | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 1e55784..828ee5f 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -210,6 +210,13 @@ static Shortcut shortcuts[] = {
|
||||
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
|
||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
||||
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
|
||||
+ { MODKEY|ShiftMask, XK_Up, zoom, {.f = +1} },
|
||||
+ { MODKEY|ShiftMask, XK_Down, zoom, {.f = -1} },
|
||||
+ { MODKEY|ShiftMask, XK_K, zoom, {.f = +1} },
|
||||
+ { MODKEY|ShiftMask, XK_J, zoom, {.f = -1} },
|
||||
+ { MODKEY|ShiftMask, XK_plus, zoom, {.f = +1} },
|
||||
+ { MODKEY|ShiftMask, XK_underscore, zoom, {.f = -1} },
|
||||
+ { MODKEY|ShiftMask, XK_parenright, zoomreset, {.f = 0} },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -251,6 +258,9 @@ static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
|
||||
*/
|
||||
static Key key[] = {
|
||||
/* keysym mask string appkey appcursor */
|
||||
+ { XK_parenright, Mod1Mask|ShiftMask,"\033[41;6u", 0, 0},
|
||||
+ { XK_underscore, Mod1Mask|ShiftMask,"\033[95;4u", 0, 0},
|
||||
+ { XK_plus, Mod1Mask|ShiftMask,"\033[43;4u", 0, 0},
|
||||
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
|
||||
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
|
||||
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
|
||||
--
|
||||
2.27.0
|
||||
|
Loading…
Reference in New Issue