set some default options and clean up config.def.h

This commit is contained in:
Jakub 2023-01-11 10:12:31 -05:00
parent 9a71b0161e
commit 9d63797049

View File

@ -1,12 +1,8 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
/* /* appearance */
* appearance static char *font = "Hack Nerd Font:pixelsize=14:antialias=true";
* static int borderpx = 0;
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
static int borderpx = 2;
/* /*
* What program is execed by st depends of these precedence rules: * What program is execed by st depends of these precedence rules:
@ -16,8 +12,9 @@ static int borderpx = 2;
* 4: value of shell in /etc/passwd * 4: value of shell in /etc/passwd
* 5: value of shell in config.h * 5: value of shell in config.h
*/ */
static char *shell = "/bin/sh"; static char *shell = "/bin/zsh";
char *utmp = NULL; char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */ /* scroll program: to enable use a string like "scroll" */
char *scroll = NULL; char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
@ -29,11 +26,8 @@ char *vtiden = "\033[?6c";
static float cwscale = 1.0; static float cwscale = 1.0;
static float chscale = 1.0; static float chscale = 1.0;
/* /* word delimiter string
* word delimiter string * More advanced example: L" `'\"()[]{}" */
*
* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" "; wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */ /* selection timeouts (in milliseconds) */
@ -47,30 +41,22 @@ int allowaltscreen = 1;
setting the clipboard text */ setting the clipboard text */
int allowwindowops = 0; int allowwindowops = 0;
/* /* draw latency range in ms - from new content/keypress/etc until drawing.
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's * within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw. * near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early. * low minlatency will tear/flicker more, as it can "detect" idle too early. */
*/
static double minlatency = 8; static double minlatency = 8;
static double maxlatency = 33; static double maxlatency = 33;
/* /* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* blinking timeout (set to 0 to disable blinking) for the terminal blinking * attribute. */
* attribute.
*/
static unsigned int blinktimeout = 800; static unsigned int blinktimeout = 800;
/* /* thickness of underline and bar cursors */
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2; static unsigned int cursorthickness = 2;
/* /* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* bell volume. It must be a value between -100 and 100. Use 0 for disabling it */
* it
*/
static int bellvolume = 0; static int bellvolume = 0;
/* default TERM value */ /* default TERM value */
@ -98,44 +84,46 @@ float alpha = 0.9;
/* Terminal colors (16 first used in escape sequence) */ /* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = { static const char *colorname[] = {
/* 8 normal colors */ /* 8 normal colors */
"black", "#282828",
"red3", "#cc241d",
"green3", "#98971a",
"yellow3", "#d79921",
"blue2", "#458588",
"magenta3", "#b16286",
"cyan3", "#689d6a",
"gray90", "#a89984",
/* 8 bright colors */ /* 8 bright colors */
"gray50", "#928374",
"red", "#fb4934",
"green", "#b8bb26",
"yellow", "#fabd2f",
"#5c5cff", "#83a598",
"magenta", "#d3869b",
"cyan", "#ebdbb2",
"white", "#8ec07c",
[255] = 0, [255] = 0,
/* more colors can be added after 255 to use with DefaultXX */ /* more colors can be added after 255 to use with DefaultXX */
"#cccccc", "#ebdbb2", /* default cursor color */
"#555555", "#555555", /* default rcs color */
"gray90", /* default foreground colour */ "#ebdbb2", /* default foreground color */
"black", /* default background colour */ "#1d2021", /* default background color */
}; };
/* /* Default colors (colorname index)
* Default colors (colorname index) foreground, background, cursor, reverse cursor */
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
unsigned int defaultcs = 256; unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257; static unsigned int defaultrcs = 257;
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
/* /*
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81 * https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81
@ -153,36 +141,25 @@ static unsigned int defaultrcs = 257;
static unsigned int cursorstyle = 1; static unsigned int cursorstyle = 1;
static Rune stcursor = 0x2603; /* snowman ("☃") */ static Rune stcursor = 0x2603; /* snowman ("☃") */
/* /* Default columns and rows numbers */
* Default columns and rows numbers
*/
static unsigned int cols = 80; static unsigned int cols = 80;
static unsigned int rows = 24; static unsigned int rows = 24;
/* /* Default colour and shape of the mouse cursor */
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm; static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7; static unsigned int mousefg = 7;
static unsigned int mousebg = 0; static unsigned int mousebg = 0;
/* /* Color used to display font attributes when fontconfig selected a font which
* Color used to display font attributes when fontconfig selected a font which doesn't match the ones requested. */
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11; static unsigned int defaultattr = 11;
/* /* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set). Note that if you want to use ShiftMask with selmasks, set this to an other
* Note that if you want to use ShiftMask with selmasks, set this to an other modifier, set to 0 to not use it. */
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask; static uint forcemousemod = ShiftMask;
/* /* Xresources preferences to load at startup */
* Xresources preferences to load at startup
*/
ResourcePref resources[] = { ResourcePref resources[] = {
{ "font", STRING, &font }, { "font", STRING, &font },
{ "color0", STRING, &colorname[0] }, { "color0", STRING, &colorname[0] },
@ -217,20 +194,13 @@ ResourcePref resources[] = {
{ "opacity", FLOAT, &alpha }, { "opacity", FLOAT, &alpha },
}; };
/* /* Internal mouse shortcuts.
* Internal mouse shortcuts. Beware that overloading Button1 will disable the se */
* Beware that overloading Button1 will disable the selection.
*/
const unsigned int mousescrollincrement = 1; const unsigned int mousescrollincrement = 1;
static MouseShortcut mshortcuts[] = { static MouseShortcut mshortcuts[] = {
/* mask button function argument release */ /* mask button function argument release */
{ ShiftMask, Button4, kscrollup, {.i = mousescrollincrement} }, { ShiftMask, Button4, kscrollup, {.i = mousescrollincrement} },
{ ShiftMask, Button5, kscrolldown, {.i = mousescrollincrement} }, { ShiftMask, Button5, kscrolldown, {.i = mousescrollincrement} },
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
}; };
/* Internal keyboard shortcuts. */ /* Internal keyboard shortcuts. */
@ -283,22 +253,16 @@ static Shortcut shortcuts[] = {
* position for a key. * position for a key.
*/ */
/* /* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) * to be mapped below, add them to this array. */
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 }; static KeySym mappedkeys[] = { -1 };
/* /* State bits to ignore when matching key or button events. By default,
* State bits to ignore when matching key or button events. By default, * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. */
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/* /* This is the huge key array which defines all compatibility to the Linux
* This is the huge key array which defines all compatibility to the Linux * world. Please decide about changes wisely. */
* world. Please decide about changes wisely.
*/
static Key key[] = { static Key key[] = {
/* keysym mask string appkey appcursor */ /* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, { XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
@ -512,21 +476,17 @@ static Key key[] = {
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
}; };
/* /* Selection types' masks.
* Selection types' masks. Use the same masks as usual.
* Use the same masks as usual. Button1Mask is always unset, to make masks match between ButtonPress.
* Button1Mask is always unset, to make masks match between ButtonPress. ButtonRelease and MotionNotify.
* ButtonRelease and MotionNotify. If no match is found, regular selection is used. */
* If no match is found, regular selection is used.
*/
static uint selmasks[] = { static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask, [SEL_RECTANGULAR] = Mod1Mask,
}; };
/* /* Printable characters in ASCII, used to estimate the advance width
* Printable characters in ASCII, used to estimate the advance width of single wide characters. */
* of single wide characters.
*/
static char ascii_printable[] = static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?" " !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"