st-relativeborder-0.8.3.diff (1393B)
1 diff -up ../st-0.8.3/config.def.h ./config.def.h 2 --- ../st-0.8.3/config.def.h 2020-04-27 13:58:27.000000000 +0200 3 +++ ./config.def.h 2020-05-24 18:27:19.179361165 +0200 4 @@ -4,9 +4,11 @@ 5 * appearance 6 * 7 * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html 8 + * borderperc: percentage of cell width to use as a border 9 + * 0 = no border, 100 = border width is same as cell width 10 */ 11 static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; 12 -static int borderpx = 2; 13 +static int borderperc = 20; 14 15 /* 16 * What program is execed by st depends of these precedence rules: 17 diff -up ../st-0.8.3/st.h ./st.h 18 --- ../st-0.8.3/st.h 2020-04-27 13:58:27.000000000 +0200 19 +++ ./st.h 2020-05-24 18:27:20.255369735 +0200 20 @@ -52,6 +52,7 @@ enum selection_snap { 21 SNAP_LINE = 2 22 }; 23 24 +int borderpx; 25 typedef unsigned char uchar; 26 typedef unsigned int uint; 27 typedef unsigned long ulong; 28 diff -up ../st-0.8.3/x.c ./x.c 29 --- ../st-0.8.3/x.c 2020-04-27 13:58:27.000000000 +0200 30 +++ ./x.c 2020-05-24 18:27:17.551348200 +0200 31 @@ -1001,6 +1001,8 @@ xloadfonts(char *fontstr, double fontsiz 32 win.cw = ceilf(dc.font.width * cwscale); 33 win.ch = ceilf(dc.font.height * chscale); 34 35 + borderpx = ceilf(((float)borderperc / 100) * win.cw); 36 + 37 FcPatternDel(pattern, FC_SLANT); 38 FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); 39 if (xloadfont(&dc.ifont, pattern))