diff options
-rw-r--r-- | .Xdefaults | 2 | ||||
-rw-r--r-- | config.def.h | 18 | ||||
-rw-r--r-- | config.mk | 2 | ||||
-rw-r--r-- | st.h | 1 | ||||
-rw-r--r-- | x.c | 2 |
5 files changed, 13 insertions, 12 deletions
@@ -5,7 +5,7 @@ st.alpha: 0.92 st.font: Monospace-11; ! st.termname: st-256color -! st.borderpx: 2 +! st.borderperc: 20 !! Set the background, foreground and cursor colors as below: *.background: #282828 diff --git a/config.def.h b/config.def.h index c179518..840ae86 100644 --- a/config.def.h +++ b/config.def.h @@ -4,13 +4,15 @@ * appearance * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + * borderperc: percentage of cell width to use as a border + * 0 = no border, 100 = border width is same as cell width */ static char *font = "monospace:pixelsize=16:antialias=true:autohint=true"; static char *font2[] = { "Spleen 32x64:pixelsize=15:antialias=true:autohint=true" }; -static int borderpx = 2; +static int borderperc = 20; /* - * What program is executed by st depends of these precedence rules: + * What program is execed by st depends of these precedence rules: * 1: program passed with -e * 2: utmp option * 3: SHELL environment variable @@ -115,10 +117,6 @@ static const char *colorname[] = { "#ebdbb2", [255] = 0, /* more colors can be added after 255 to use with DefaultXX */ - "#add8e6", /* 256 -> cursor */ - "#555555", /* 257 -> rev cursor*/ - "#0c1012", /* 258 -> bg */ - "#ebdbb2", /* 259 -> fg */ }; @@ -126,11 +124,11 @@ static const char *colorname[] = { * Default colors (colorname index) * foreground, background, cursor, reverse cursor */ -unsigned int defaultfg = 259; +unsigned int defaultfg = 3; unsigned int defaultbg = 0; /* unsigned int defaultbg = 258; */ -static unsigned int defaultcs = 256; -static unsigned int defaultrcs = 257; +static unsigned int defaultcs = 3; +static unsigned int defaultrcs = 6; /* * Default shape of cursor @@ -193,7 +191,7 @@ ResourcePref resources[] = { { "blinktimeout", INTEGER, &blinktimeout }, { "bellvolume", INTEGER, &bellvolume }, { "tabspaces", INTEGER, &tabspaces }, - { "borderpx", INTEGER, &borderpx }, + { "borderperc", INTEGER, &borderperc }, { "cwscale", FLOAT, &cwscale }, { "chscale", FLOAT, &chscale }, { "alpha", FLOAT, &alpha }, @@ -32,4 +32,4 @@ STLDFLAGS = $(LIBS) $(LDFLAGS) # `pkg-config --libs freetype2` # compiler and linker -# CC = c99 + CC = tcc @@ -52,6 +52,7 @@ enum selection_snap { SNAP_LINE = 2 }; +int borderpx; typedef unsigned char uchar; typedef unsigned int uint; typedef unsigned long ulong; @@ -1008,6 +1008,8 @@ xloadfonts(char *fontstr, double fontsize) win.ch = ceilf(dc.font.height * chscale); win.cyo = ceilf(dc.font.height * (chscale - 1) / 2); + borderpx = ceilf(((float)borderperc / 100) * win.cw); + FcPatternDel(pattern, FC_SLANT); FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); if (xloadfont(&dc.ifont, pattern)) |