summaryrefslogtreecommitdiff
path: root/config.def.h
diff options
context:
space:
mode:
authorZachIR <zachir@librem.one>2025-07-08 21:48:39 -0500
committerZachIR <zachir@librem.one>2025-07-08 21:48:39 -0500
commitcbffff166748e7dada4b66ed1c4f10f495eefa97 (patch)
treee5b15a872bb79b4beb56c8177b229c58b356bdb5 /config.def.h
parentd79cc4cea16572f7f80c3842031406172630f697 (diff)
Add in st-graphics repo
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h71
1 files changed, 61 insertions, 10 deletions
diff --git a/config.def.h b/config.def.h
index 49d3dda..ee892e4 100644
--- a/config.def.h
+++ b/config.def.h
@@ -8,6 +8,13 @@
static char *font = "FiraCode Nerd Font Mono:pixelsize=18:antialias=true:autohint=true";
static int borderpx = 2;
+/* How to align the content in the window when the size of the terminal
+ * doesn't perfectly match the size of the window. The values are percentages.
+ * 50 means center, 0 means flush left/top, 100 means flush right/bottom.
+ */
+static int anysize_halign = 50;
+static int anysize_valign = 50;
+
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
@@ -23,7 +30,8 @@ char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
-char *vtiden = "\033[?6c";
+/* By default, use the same one as kitty. */
+char *vtiden = "\033[?62c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
@@ -68,6 +76,18 @@ static unsigned int blinktimeout = 800;
static unsigned int cursorthickness = 2;
/*
+ * 1: render most of the lines/blocks characters without using the font for
+ * perfect alignment between cells (U2500 - U259F except dashes/diagonals).
+ * Bold affects lines thickness if boxdraw_bold is not 0. Italic is ignored.
+ * 0: disable (render all U25XX glyphs normally from the font).
+ */
+const int boxdraw = 1;
+const int boxdraw_bold = 1;
+
+/* braille (U28XX): 1: render as adjacent "pixels", 0: use font */
+const int boxdraw_braille = 0;
+
+/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
@@ -167,18 +187,46 @@ static unsigned int mousebg = 0;
static unsigned int defaultattr = 11;
/*
+ * Graphics configuration
+ */
+
+/// The template for the cache directory.
+const char graphics_cache_dir_template[] = "/tmp/st-images-XXXXXX";
+/// The max size of a single image file, in bytes.
+unsigned graphics_max_single_image_file_size = 20 * 1024 * 1024;
+/// The max size of the cache, in bytes.
+unsigned graphics_total_file_cache_size = 300 * 1024 * 1024;
+/// The max ram size of an image or placement, in bytes.
+unsigned graphics_max_single_image_ram_size = 100 * 1024 * 1024;
+/// The max total size of all images loaded into RAM.
+unsigned graphics_max_total_ram_size = 300 * 1024 * 1024;
+/// The max total number of image placements and images.
+unsigned graphics_max_total_placements = 4096;
+/// The ratio by which limits can be exceeded. This is to reduce the frequency
+/// of image removal.
+double graphics_excess_tolerance_ratio = 0.05;
+/// The minimum delay between redraws caused by animations, in milliseconds.
+unsigned graphics_animation_min_delay = 20;
+
+/*
* 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
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
+/* Internal keyboard shortcuts. */
+#define MODKEY Mod1Mask
+#define TERMMOD (ControlMask|ShiftMask)
+
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
+ { TERMMOD, Button3, previewimage, {.s = "feh"} },
+ { TERMMOD, Button2, showimageinfo, {}, 1 },
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
@@ -186,9 +234,7 @@ static MouseShortcut mshortcuts[] = {
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};
-/* Internal keyboard shortcuts. */
-#define MODKEY Mod1Mask
-#define TERMMOD (ControlMask|ShiftMask)
+static const char *writetofilecmd[] = {"/bin/sh", "-c", "cat > $(mktemp /tmp/st-screen.XXXXXX)"};
static Shortcut shortcuts[] = {
/* mask keysym function argument */
@@ -196,18 +242,23 @@ static Shortcut shortcuts[] = {
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
- { TERMMOD, XK_plus, zoom, {.f = +1} },
- { TERMMOD, XK_underscore, zoom, {.f = -1} },
+ { TERMMOD, XK_Prior, zoom, {.f = +1} },
+ { TERMMOD, XK_Next, zoom, {.f = -1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
- { TERMMOD, XK_Up, kscrollup, {.i = +1} },
- { TERMMOD, XK_Down, kscrolldown, {.i = +1} },
- { TERMMOD, XK_Page_Up, kscrollup, {.i = -1} },
- { TERMMOD, XK_Page_Down, kscrolldown, {.i = -1} },
+ { TERMMOD, XK_Up, numlock, {.i = +1} },
+ { TERMMOD, XK_Down, numlock, {.i = +1} },
+ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
+ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
+ { TERMMOD, XK_F1, togglegrdebug, {.i = 0} },
+ { TERMMOD, XK_F6, dumpgrstate, {.i = 0} },
+ { TERMMOD, XK_F7, unloadimages, {.i = 0} },
+ { TERMMOD, XK_F8, toggleimages, {.i = 0} },
+ { TERMMOD, XK_F9, externalpipe, { .v = writetofilecmd } },
};
/*