[2025-jun-17] The SlackDocs Wiki has moved to a new server, in order to make it more performant.
Table of Contents
st config.h Quick Reference
A practical guide to customising st without knowing C.
Based on vanilla st (no patches).
What is config.h?
config.h is the configuration file for st.
It is a C source file, but you do not need to know C to edit it.
After every change, recompile and restart st:
cd ~/st make make install
Before making changes, create a backup:
cp config.h config.h.bak
To start, copy the template:
cp config.def.h config.h
Important: after a git pull, always compare your config.h
with the updated config.def.h to catch new options:
diff config.def.h config.h
Font
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
Liberation Mono is the vanilla default.
Replace with any monospace font.
Example using Iosevka Term:
static char *font = "Iosevka Term:size=11:antialias=true:autohint=true";
Finding the Correct Font Name
The display name and the fontconfig name often differ.
To find the exact name as fontconfig sees it:
fc-list | grep -i "fontname"
Fonts on Slackware
- Iosevka (full, 400MB+)
- Iosevka-core (minimal subset, sufficient for st)
- JetBrains Mono
Border
static int borderpx = 2;
Border width in pixels around the terminal window.
Set to 1 for a thinner border:
static int borderpx = 1;
Cursor
Shape
static unsigned int cursorshape = 2;
Available shapes:
2: Block 4: Underline 6: Bar 7: Snowman
Thickness
static unsigned int cursorthickness = 2;
Blinking
static unsigned int blinktimeout = 800;
Set to 0 to disable blinking entirely.
Draw Latency
static double minlatency = 2; static double maxlatency = 33;
Lower values reduce perceived lag:
static double minlatency = 1; static double maxlatency = 16;
Terminal Size
static unsigned int cols = 80; static unsigned int rows = 24;
These are only the initial values.
Window resizing behavior itself is usually controlled by the
window manager, not by st.
TERM Value
char *termname = "st-256color";
Do not change this unless you know what you are doing.
Common Tasks
| Want to change | Where to look |
|---|---|
| Font | font |
| Border width | borderpx |
| Cursor shape | cursorshape |
| Cursor thickness | cursorthickness |
| Cursor blinking | blinktimeout |
| Draw latency | minlatency, maxlatency |
| Default size | cols, rows |
| Background color | colorname[259] |
| Foreground color | colorname[258] |
| Cursor color | colorname[256] |
| Add a shortcut | shortcuts[] |
Slackware
Slackware users may alternatively build st using a SlackBuild
and include their custom config.h during the build process.
See Also
Sources
- Originally written by r1w1s1