From f99c8d8ee2e8d002df76ba4fd70724ad82f0da42 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Sat, 13 Apr 2024 13:30:01 +0200 Subject: [PATCH 01/11] change fontsize --- config.h | 186 +++++++++++++++++++++++++------------------------------ 1 file changed, 85 insertions(+), 101 deletions(-) diff --git a/config.h b/config.h index 803b1ad..8023f5c 100644 --- a/config.h +++ b/config.h @@ -5,13 +5,12 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "FiraCode Nerd Font:size=12"; +static char *font = "FiraCode Nerd Font:pixelsize=14"; /* Spare fonts */ static char *font2[] = { - "Noto Color Emoji:size=11", + "Noto Color Emoji:pixelsize=14", }; - static int borderpx = 2; /* modkey options: ControlMask, ShiftMask or XK_ANY_MOD */ @@ -127,55 +126,41 @@ float alphaUnfocused = 0.8; /* Terminal colors (16 first used in escape sequence) */ static const char *colorname[] = { - /* 8 normal colors */ - "#1d202f", - "#f7768e", - "#9ece6a", - "#e0af68", - "#7aa2f7", - "#bb9af7", - "#7dcfff", - "#a9b1d6", + /* 8 normal colors */ + "#1d202f", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", + "#a9b1d6", - /* 8 bright colors */ - "#414868", - "#f7768e", - "#9ece6a", - "#e0af68", - "#7aa2f7", - "#bb9af7", - "#7dcfff", - "#c0caf5", + /* 8 bright colors */ + "#414868", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", + "#c0caf5", - [255] = 0, + [255] = 0, - /* more colors can be added after 255 to use with DefaultXX */ - "#c0caf5", /* 256 -> default cursor colour */ - "#1a1b26", /* 257 -> default inverted cursor colour */ - "#c0caf5", /* 258 -> default foreground colour */ - "#1a1b26", /* 259 -> default background colour */ - "#c0caf5", /* 260 -> unfocused foreground colour */ - "#1a1b26", /* 261 -> unfocused background colour */ + /* more colors can be added after 255 to use with DefaultXX */ + "#c0caf5", /* 256 -> default cursor colour */ + "#1a1b26", /* 257 -> default inverted cursor colour */ + "#c0caf5", /* 258 -> default foreground colour */ + "#1a1b26", /* 259 -> default background colour */ + "#c0caf5", /* 260 -> unfocused foreground colour */ + "#1a1b26", /* 261 -> unfocused background colour */ "#c0caf5", /* 262 -> default selection foreground colour */ "#33467C", /* 263 -> default selection background colour */ }; - /* * Default colors (colorname index) * foreground, background, cursor, reverse cursor */ -unsigned int defaultcs = 256; -unsigned int defaultrcs = 257; -unsigned int defaultfg = 258; -unsigned int defaultbg = 0; -unsigned int bg = 259; +unsigned int defaultcs = 256; +unsigned int defaultrcs = 257; +unsigned int defaultfg = 258; +unsigned int defaultbg = 0; +unsigned int bg = 259; unsigned int bgUnfocused = 261; unsigned int selectionfg = 262; unsigned int selectionbg = 263; static int ignoreselfg = 0; - /* * 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 * Default style of cursor @@ -202,7 +187,7 @@ static unsigned int rows = 24; /* * Default shape of the mouse cursor */ -static char* mouseshape = "xterm"; +static char *mouseshape = "xterm"; /* * Color used to display font attributes when fontconfig selected a font which @@ -214,31 +199,31 @@ static unsigned int defaultattr = 11; * Xresources preferences to load at startup */ ResourcePref resources[] = { - { "color0", STRING, &colorname[0] }, - { "color1", STRING, &colorname[1] }, - { "color2", STRING, &colorname[2] }, - { "color3", STRING, &colorname[3] }, - { "color4", STRING, &colorname[4] }, - { "color5", STRING, &colorname[5] }, - { "color6", STRING, &colorname[6] }, - { "color7", STRING, &colorname[7] }, - { "color8", STRING, &colorname[8] }, - { "color9", STRING, &colorname[9] }, - { "color10", STRING, &colorname[10] }, - { "color11", STRING, &colorname[11] }, - { "color12", STRING, &colorname[12] }, - { "color13", STRING, &colorname[13] }, - { "color14", STRING, &colorname[14] }, - { "color15", STRING, &colorname[15] }, - { "cursorColor", STRING, &colorname[256] }, - { "foreground", STRING, &colorname[258] }, - { "background", STRING, &colorname[259] }, - { "unfocusedForeground", STRING, &colorname[260] }, - { "unfocusedBackground", STRING, &colorname[261] }, - { "selectionForeground", STRING, &colorname[262] }, - { "selectionBackground", STRING, &colorname[263] }, - { "alpha", FLOAT, &alpha }, - { "alphaUnfocused",FLOAT, &alphaUnfocused }, + {"color0", STRING, &colorname[0]}, + {"color1", STRING, &colorname[1]}, + {"color2", STRING, &colorname[2]}, + {"color3", STRING, &colorname[3]}, + {"color4", STRING, &colorname[4]}, + {"color5", STRING, &colorname[5]}, + {"color6", STRING, &colorname[6]}, + {"color7", STRING, &colorname[7]}, + {"color8", STRING, &colorname[8]}, + {"color9", STRING, &colorname[9]}, + {"color10", STRING, &colorname[10]}, + {"color11", STRING, &colorname[11]}, + {"color12", STRING, &colorname[12]}, + {"color13", STRING, &colorname[13]}, + {"color14", STRING, &colorname[14]}, + {"color15", STRING, &colorname[15]}, + {"cursorColor", STRING, &colorname[256]}, + {"foreground", STRING, &colorname[258]}, + {"background", STRING, &colorname[259]}, + {"unfocusedForeground", STRING, &colorname[260]}, + {"unfocusedBackground", STRING, &colorname[261]}, + {"selectionForeground", STRING, &colorname[262]}, + {"selectionBackground", STRING, &colorname[263]}, + {"alpha", FLOAT, &alpha}, + {"alphaUnfocused", FLOAT, &alphaUnfocused}, }; /* @@ -253,45 +238,47 @@ static uint forcemousemod = ShiftMask; * Beware that overloading Button1 will disable the selection. */ static MouseShortcut mshortcuts[] = { - /* mask button function argument release screen */ - // { XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 }, - // { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, - // { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, - // { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, - // { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, + /* mask button function argument release + screen */ + // { XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 }, + // { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, + // { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, + // { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, + // { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, }; /* Internal keyboard shortcuts. */ #define MODKEY Mod1Mask -#define TERMMOD (ControlMask|ShiftMask) +#define TERMMOD (ControlMask | ShiftMask) -static char *openurlcmd[] = { "/bin/sh", "-c", - "xurls | dmenu -l 10 -w $WINDOWID | xargs -r open", - "externalpipe", NULL }; +static char *openurlcmd[] = {"/bin/sh", "-c", + "xurls | dmenu -l 10 -w $WINDOWID | xargs -r open", + "externalpipe", NULL}; -static char *setbgcolorcmd[] = { "/bin/sh", "-c", - "printf '\033]11;#008000\007'", - "externalpipein", NULL }; +static char *setbgcolorcmd[] = {"/bin/sh", "-c", "printf '\033]11;#008000\007'", + "externalpipein", NULL}; static Shortcut shortcuts[] = { - /* mask keysym function argument screen */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, - { ControlMask, XK_Print, toggleprinter, {.i = 0} }, - { ShiftMask, XK_Print, printscreen, {.i = 0} }, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { TERMMOD, XK_Prior, zoom, {.f = +3} }, - { TERMMOD, XK_Next, zoom, {.f = -3} }, - { TERMMOD, XK_Home, zoomreset, {.f = 0} }, - { TERMMOD, XK_C, clipcopy, {.i = 0} }, - { TERMMOD, XK_V, clippaste, {.i = 0} }, - { TERMMOD, XK_O, changealpha, {.f = +0.05} }, - { TERMMOD, XK_P, changealpha, {.f = -0.05} }, - //{ TERMMOD, XK_, changealphaunfocused, {.f = +0.05} }, - //{ TERMMOD, XK_, changealphaunfocused, {.f = -0.05} }, - { TERMMOD, XK_Y, selpaste, {.i = 0} }, - { ShiftMask, XK_Insert, selpaste, {.i = 0} }, - { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, - { TERMMOD, XK_I, iso14755, {.i = 0} }, + /* mask keysym function argument screen + */ + {XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, + {ControlMask, XK_Print, toggleprinter, {.i = 0}}, + {ShiftMask, XK_Print, printscreen, {.i = 0}}, + {XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, + {TERMMOD, XK_Prior, zoom, {.f = +3}}, + {TERMMOD, XK_Next, zoom, {.f = -3}}, + {TERMMOD, XK_Home, zoomreset, {.f = 0}}, + {TERMMOD, XK_C, clipcopy, {.i = 0}}, + {TERMMOD, XK_V, clippaste, {.i = 0}}, + {TERMMOD, XK_O, changealpha, {.f = +0.05}}, + {TERMMOD, XK_P, changealpha, {.f = -0.05}}, + //{ TERMMOD, XK_, changealphaunfocused, {.f = +0.05} + //}, { TERMMOD, XK_, changealphaunfocused, {.f = + //-0.05} }, + {TERMMOD, XK_Y, selpaste, {.i = 0}}, + {ShiftMask, XK_Insert, selpaste, {.i = 0}}, + {TERMMOD, XK_Num_Lock, numlock, {.i = 0}}, + {TERMMOD, XK_I, iso14755, {.i = 0}}, }; /* @@ -315,13 +302,11 @@ static Shortcut shortcuts[] = { * position for a key. */ - /* * State bits to ignore when matching key or button events. By default, * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. */ -static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; - +static uint ignoremod = Mod2Mask | XK_SWITCH_MOD; /* * Selection types' masks. @@ -331,17 +316,16 @@ static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; * If no match is found, regular selection is used. */ static uint selmasks[] = { - [SEL_RECTANGULAR] = Mod1Mask, + [SEL_RECTANGULAR] = Mod1Mask, }; /* * Printable characters in ASCII, used to estimate the advance width * of single wide characters. */ -static char ascii_printable[] = - " !\"#$%&'()*+,-./0123456789:;<=>?" - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" - "`abcdefghijklmnopqrstuvwxyz{|}~"; +static char ascii_printable[] = " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~"; /* * plumb_cmd is run on mouse button 3 click, with argument set to From f72e6cc250dd175217a2eb266a827253be4d5482 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 17 Apr 2024 22:57:36 +0200 Subject: [PATCH 02/11] rework st --- config.h | 101 ++++++++++++++++-------------------------------------- patches.h | 10 +++--- 2 files changed, 35 insertions(+), 76 deletions(-) diff --git a/config.h b/config.h index 8023f5c..465a328 100644 --- a/config.h +++ b/config.h @@ -120,19 +120,25 @@ char *termname = "st-256color"; */ unsigned int tabspaces = 8; -/* bg opacity */ -float alpha = 0.9; -float alphaUnfocused = 0.8; +#define BLACK "#15161E" +#define RED "#f7768e" +#define GREEN "#9ece6a" +#define ORANGE "#e0af68" +#define BLUE "#7aa2f7" +#define MAGENTA "#bb9af7" +#define CYAN "#7dcfff" +#define LIGHT_GRAY "#a9b1d6" +#define GRAY "#414868" +#define WHITE "#c0caf5" +#define UNDEFINED "#ff0000" /* Terminal colors (16 first used in escape sequence) */ static const char *colorname[] = { /* 8 normal colors */ - "#1d202f", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", - "#a9b1d6", + BLACK, RED, GREEN, ORANGE, BLUE, MAGENTA, CYAN, LIGHT_GRAY, /* 8 bright colors */ - "#414868", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", - "#c0caf5", + GRAY, RED, GREEN, ORANGE, BLUE, MAGENTA, CYAN, WHITE, [255] = 0, @@ -141,10 +147,8 @@ static const char *colorname[] = { "#1a1b26", /* 257 -> default inverted cursor colour */ "#c0caf5", /* 258 -> default foreground colour */ "#1a1b26", /* 259 -> default background colour */ - "#c0caf5", /* 260 -> unfocused foreground colour */ - "#1a1b26", /* 261 -> unfocused background colour */ - "#c0caf5", /* 262 -> default selection foreground colour */ - "#33467C", /* 263 -> default selection background colour */ + "#c0caf5", /* 260 -> default selection foreground colour */ + "#33467C", /* 261 -> default selection background colour */ }; /* @@ -156,9 +160,8 @@ unsigned int defaultrcs = 257; unsigned int defaultfg = 258; unsigned int defaultbg = 0; unsigned int bg = 259; -unsigned int bgUnfocused = 261; -unsigned int selectionfg = 262; -unsigned int selectionbg = 263; +unsigned int selectionfg = 260; +unsigned int selectionbg = 261; static int ignoreselfg = 0; /* @@ -195,37 +198,6 @@ static char *mouseshape = "xterm"; */ static unsigned int defaultattr = 11; -/* - * Xresources preferences to load at startup - */ -ResourcePref resources[] = { - {"color0", STRING, &colorname[0]}, - {"color1", STRING, &colorname[1]}, - {"color2", STRING, &colorname[2]}, - {"color3", STRING, &colorname[3]}, - {"color4", STRING, &colorname[4]}, - {"color5", STRING, &colorname[5]}, - {"color6", STRING, &colorname[6]}, - {"color7", STRING, &colorname[7]}, - {"color8", STRING, &colorname[8]}, - {"color9", STRING, &colorname[9]}, - {"color10", STRING, &colorname[10]}, - {"color11", STRING, &colorname[11]}, - {"color12", STRING, &colorname[12]}, - {"color13", STRING, &colorname[13]}, - {"color14", STRING, &colorname[14]}, - {"color15", STRING, &colorname[15]}, - {"cursorColor", STRING, &colorname[256]}, - {"foreground", STRING, &colorname[258]}, - {"background", STRING, &colorname[259]}, - {"unfocusedForeground", STRING, &colorname[260]}, - {"unfocusedBackground", STRING, &colorname[261]}, - {"selectionForeground", STRING, &colorname[262]}, - {"selectionBackground", STRING, &colorname[263]}, - {"alpha", FLOAT, &alpha}, - {"alphaUnfocused", FLOAT, &alphaUnfocused}, -}; - /* * 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 @@ -259,26 +231,19 @@ static char *setbgcolorcmd[] = {"/bin/sh", "-c", "printf '\033]11;#008000\007'", "externalpipein", NULL}; static Shortcut shortcuts[] = { - /* mask keysym function argument screen - */ - {XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, - {ControlMask, XK_Print, toggleprinter, {.i = 0}}, - {ShiftMask, XK_Print, printscreen, {.i = 0}}, - {XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, - {TERMMOD, XK_Prior, zoom, {.f = +3}}, - {TERMMOD, XK_Next, zoom, {.f = -3}}, - {TERMMOD, XK_Home, zoomreset, {.f = 0}}, - {TERMMOD, XK_C, clipcopy, {.i = 0}}, - {TERMMOD, XK_V, clippaste, {.i = 0}}, - {TERMMOD, XK_O, changealpha, {.f = +0.05}}, - {TERMMOD, XK_P, changealpha, {.f = -0.05}}, - //{ TERMMOD, XK_, changealphaunfocused, {.f = +0.05} - //}, { TERMMOD, XK_, changealphaunfocused, {.f = - //-0.05} }, - {TERMMOD, XK_Y, selpaste, {.i = 0}}, - {ShiftMask, XK_Insert, selpaste, {.i = 0}}, - {TERMMOD, XK_Num_Lock, numlock, {.i = 0}}, - {TERMMOD, XK_I, iso14755, {.i = 0}}, + /* mask keysym function argument screen */ + {XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, + {ControlMask, XK_Print, toggleprinter, {.i = 0}}, + {ShiftMask, XK_Print, printscreen, {.i = 0}}, + {XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, + {TERMMOD, XK_Prior, zoom, {.f = +3}}, + {TERMMOD, XK_Next, zoom, {.f = -3}}, + {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}}, }; /* @@ -327,12 +292,6 @@ static char ascii_printable[] = " !\"#$%&'()*+,-./0123456789:;<=>?" "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" "`abcdefghijklmnopqrstuvwxyz{|}~"; -/* - * plumb_cmd is run on mouse button 3 click, with argument set to - * current selection and with cwd set to the cwd of the active shell - */ -static char *plumb_cmd = "plumb"; - /** * Undercurl style. Set UNDERCURL_STYLE to one of the available styles. * diff --git a/patches.h b/patches.h index 7d5c80b..255e556 100644 --- a/patches.h +++ b/patches.h @@ -14,7 +14,7 @@ * when including this patch. * https://st.suckless.org/patches/alpha/ */ -#define ALPHA_PATCH 1 +#define ALPHA_PATCH 0 /* The alpha focus highlight patch allows the user to specify two distinct opacity values or * background colors in order to easily differentiate between focused and unfocused terminal @@ -22,7 +22,7 @@ * https://github.com/juliusHuelsmann/st-focus/ * https://st.suckless.org/patches/alpha_focus_highlight/ */ -#define ALPHA_FOCUS_HIGHLIGHT_PATCH 1 +#define ALPHA_FOCUS_HIGHLIGHT_PATCH 0 /* Adds gradient transparency to st, depends on the alpha patch. * https://st.suckless.org/patches/gradient/ @@ -210,7 +210,7 @@ * codepoint that will be converted to a glyph and then pushed to st. * https://st.suckless.org/patches/iso14755/ */ -#define ISO14755_PATCH 1 +#define ISO14755_PATCH 0 /* This patch allows you to select text on the terminal using keyboard shortcuts. * https://st.suckless.org/patches/keyboard_select/ @@ -445,10 +445,10 @@ * apply the resources named in the resources[] array in config.h. * https://st.suckless.org/patches/xresources/ */ -#define XRESOURCES_PATCH 1 +#define XRESOURCES_PATCH 0 /* This patch adds the ability to reload the Xresources config when a SIGUSR1 signal is received * e.g.: killall -USR1 st * Depends on the XRESOURCES_PATCH. */ -#define XRESOURCES_RELOAD_PATCH 1 +#define XRESOURCES_RELOAD_PATCH 0 From df00cd0094287d984d1ed14188e36cedcd5ccc7d Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 17 Apr 2024 23:17:37 +0200 Subject: [PATCH 03/11] improve build script --- build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index f114dbb..79fedd3 100755 --- a/build.sh +++ b/build.sh @@ -4,8 +4,12 @@ cp -f config.mk Makefile patches.h st-flexipatch/ flexipatch-finalizer/flexipatch-finalizer.sh -r -d st-flexipatch -o st-final git -C st-flexipatch reset --hard HEAD && git -C st-flexipatch clean -fd for patch in patches/*.diff; do - patch -d st-final <"$patch" + patch -d st-final <"$patch" done cp -f config.h st-final/ cd st-final || exit 1 -make +if [ "$1" = "-i" ]; then + sudo make install +else + make +fi From 6037e1a5bd31d926954196c489d67bf39cd58684 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 17 Apr 2024 23:21:11 +0200 Subject: [PATCH 04/11] default classname patch --- patches/default-class-name.diff | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/default-class-name.diff diff --git a/patches/default-class-name.diff b/patches/default-class-name.diff new file mode 100644 index 0000000..b0b6d3c --- /dev/null +++ b/patches/default-class-name.diff @@ -0,0 +1,18 @@ +--- a/x.c ++++ b/x.c +@@ -173,13 +173,13 @@ static char *usedfont = NULL; + static double usedfontsize = 0; + static double defaultfontsize = 0; + +-static char *opt_class = NULL; ++static char *opt_class = "St"; + static char **opt_cmd = NULL; + static char *opt_embed = NULL; + static char *opt_font = NULL; + static char *opt_io = NULL; + static char *opt_line = NULL; +-static char *opt_name = NULL; ++static char *opt_name = "st"; + static char *opt_title = NULL; + static char *opt_dir = NULL; + From dc51c13fb5cd9cfa4b61dab7743308ba9ba19df7 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 18 Apr 2024 10:23:09 +0200 Subject: [PATCH 05/11] rework --- config.h | 38 +++++++++--------- config.mk | 2 +- patches.h | 74 +++++++++++++++++++++++++---------- patches/selection-colors.diff | 74 ----------------------------------- 4 files changed, 75 insertions(+), 113 deletions(-) delete mode 100644 patches/selection-colors.diff diff --git a/config.h b/config.h index 465a328..7c249bb 100644 --- a/config.h +++ b/config.h @@ -62,8 +62,8 @@ int allowwindowops = 0; * 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. */ -static double minlatency = 3; -static double maxlatency = 25; +static double minlatency = 5; +static double maxlatency = 30; /* * Synchronized-Update timeout in ms @@ -158,11 +158,10 @@ static const char *colorname[] = { unsigned int defaultcs = 256; unsigned int defaultrcs = 257; unsigned int defaultfg = 258; -unsigned int defaultbg = 0; -unsigned int bg = 259; +unsigned int defaultbg = 259; unsigned int selectionfg = 260; unsigned int selectionbg = 261; -static int ignoreselfg = 0; +static int ignoreselfg = 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 @@ -231,19 +230,22 @@ static char *setbgcolorcmd[] = {"/bin/sh", "-c", "printf '\033]11;#008000\007'", "externalpipein", NULL}; static Shortcut shortcuts[] = { - /* mask keysym function argument screen */ - {XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, - {ControlMask, XK_Print, toggleprinter, {.i = 0}}, - {ShiftMask, XK_Print, printscreen, {.i = 0}}, - {XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, - {TERMMOD, XK_Prior, zoom, {.f = +3}}, - {TERMMOD, XK_Next, zoom, {.f = -3}}, - {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}}, + /* mask keysym function argument screen + */ + { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, + { ControlMask, XK_Print, toggleprinter, {.i = 0}}, + { ShiftMask, XK_Print, printscreen, {.i = 0}}, + { XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, + { TERMMOD, XK_Prior, zoom, {.f = +3}}, + { TERMMOD, XK_Next, zoom, {.f = -3}}, + { TERMMOD, XK_Home, zoomreset, {.f = 0}}, + { TERMMOD, XK_C, clipcopy, {.i = 0}}, + { TERMMOD, XK_V, clippaste, {.i = 0}}, + { TERMMOD, XK_Y, selpaste, {.i = 0}}, + { TERMMOD, XK_Num_Lock, numlock, {.i = 0}}, + { TERMMOD, XK_Escape, keyboard_select, {0}}, + { TERMMOD, XK_K, kscrollup, {.i = -1}, S_PRI }, + { TERMMOD, XK_J, kscrolldown, {.i = -1}, S_PRI }, }; /* diff --git a/config.mk b/config.mk index c4cf5a3..8e04344 100644 --- a/config.mk +++ b/config.mk @@ -25,7 +25,7 @@ LIGATURES_INC = `$(PKG_CONFIG) --cflags harfbuzz` LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz` # Uncomment this for the SIXEL patch / SIXEL_PATCH -# SIXEL_C = sixel.c sixel_hls.c +SIXEL_C = sixel.c sixel_hls.c # includes and libs, uncomment harfbuzz for the ligatures patch INCS = -I$(X11INC) \ diff --git a/patches.h b/patches.h index 255e556..f5b2434 100644 --- a/patches.h +++ b/patches.h @@ -77,9 +77,8 @@ #define CLIPBOARD_PATCH 0 /* This patch allows st to be resized without cutting off text when the terminal window is - * made larger again. Text does not wrap when the terminal window is made smaller. - * - * The vim browse patch takes precedence over this patch. + * made larger again. Text does not wrap when the terminal window is made smaller, you may + * also want to have a look at the reflow patch. * * https://github.com/bakkeby/st-flexipatch/issues/34 */ @@ -121,7 +120,7 @@ /* Return BS on pressing backspace and DEL on pressing the delete key. * https://st.suckless.org/patches/delkey/ */ -#define DELKEY_PATCH 0 +#define DELKEY_PATCH 1 /* This patch adds the option of disabling bold fonts globally. * https://st.suckless.org/patches/disable_bold_italic_fonts/ @@ -141,7 +140,7 @@ /* This patch makes the cursor color the inverse of the current cell color. * https://st.suckless.org/patches/dynamic-cursor-color/ */ -#define DYNAMIC_CURSOR_COLOR_PATCH 0 +#define DYNAMIC_CURSOR_COLOR_PATCH 1 /* Reading and writing st's screen through a pipe, e.g. pass info to dmenu. * https://st.suckless.org/patches/externalpipe/ @@ -213,9 +212,11 @@ #define ISO14755_PATCH 0 /* This patch allows you to select text on the terminal using keyboard shortcuts. + * NB: An improved variant of this patch is enabled if combined with the reflow patch. + * * https://st.suckless.org/patches/keyboard_select/ */ -#define KEYBOARDSELECT_PATCH 0 +#define KEYBOARDSELECT_PATCH 1 /* This patch adds support for drawing ligatures using the Harfbuzz library to transform * original text of a single line to a list of glyphs with ligatures included. @@ -233,16 +234,45 @@ */ #define MONOCHROME_PATCH 0 -/* This patch sets the _NET_WM_ICON X property with a hardcoded icon for st. +/* This patch sets the _NET_WM_ICON X property with an icon that is read from a .png file. + * This patch depends on the GD Graphics Library and headers to compile. + * You need to uncomment the corresponding lines in config.mk to use the gd library. + * + * The default location for the .png file is: + * - /usr/local/share/pixmaps/st.png + * * https://st.suckless.org/patches/netwmicon/ */ #define NETWMICON_PATCH 0 +/* This patch sets the _NET_WM_ICON X property with an icon that is read from a farbfeld image. + * The benefit of this patch is that you do not need an additional dependency on an external + * library to read and convert the farbfeld image. + * + * The default location for the farbfeld image is: + * - /usr/local/share/pixmaps/st.ff + * + * Remember to change the ICONNAME in config.mk from st.png to st.ff when using this patch. + * + * Example command to convert a .png to farbfeld: + * $ png2ff < st.png > st.ff + * + * https://tools.suckless.org/farbfeld/ + * https://github.com/bakkeby/patches/wiki/netwmicon/ + */ +#define NETWMICON_FF_PATCH 0 + +/* This patch sets the _NET_WM_ICON X property with a hardcoded icon for st. This is the + * original version that predates the version that reads the image from a .png file. + * https://st.suckless.org/patches/netwmicon/ + */ +#define NETWMICON_LEGACY_PATCH 0 + /* This patch allows you to spawn a new st terminal using Ctrl-Shift-Return. It will have the * same CWD (current working directory) as the original st instance. * https://st.suckless.org/patches/newterm/ */ -#define NEWTERM_PATCH 0 +#define NEWTERM_PATCH 1 /* This patch will set the _MOTIF_WM_HINTS property for the st window which, if the window manager * respects it, will show the st window without window decorations. @@ -264,6 +294,13 @@ */ #define OPENURLONCLICK_PATCH 1 +/* Reflow. + * Allows st to be resized without cutting off text when the terminal window is made larger again. + * Text wraps when the terminal window is made smaller. + * Comes with scrollback. + */ +#define REFLOW_PATCH 1 + /* This patch allows you to specify a border that is relative in size to the width of a cell * in the terminal. * https://st.suckless.org/patches/relativeborder/ @@ -279,7 +316,7 @@ /* Scroll back through terminal output using Shift+{PageUp, PageDown}. * https://st.suckless.org/patches/scrollback/ */ -#define SCROLLBACK_PATCH 0 +#define SCROLLBACK_PATCH 1 /* Scroll back through terminal output using Shift+MouseWheel. * This variant depends on SCROLLBACK_PATCH being enabled. @@ -293,6 +330,13 @@ */ #define SCROLLBACK_MOUSE_ALTSCREEN_PATCH 0 +/* This patch adds the two color-settings selectionfg and selectionbg to config.def.h. + * Those define the fore- and background colors which are used when text on the screen is selected + * with the mouse. This removes the default behaviour which would simply reverse the colors. + * https://st.suckless.org/patches/selectioncolors/ + */ +#define SELECTION_COLORS_PATCH 1 + /* This is the single drawable buffer patch as outlined in the FAQ to get images * in w3m to display. While this patch does not break the alpha patch it images * are not shown in w3m if the alpha patch is applied. @@ -312,7 +356,7 @@ * * https://gist.github.com/saitoha/70e0fdf22e3e8f63ce937c7f7da71809 */ -#define SIXEL_PATCH 0 +#define SIXEL_PATCH 1 /* This patch allows clients to embed into the st window and is useful if you tend to * start X applications from the terminal. For example: @@ -399,16 +443,6 @@ */ #define VERTCENTER_PATCH 1 -/* The vim-browse patch offers the possibility to move through the terminal history-buffer, - * search for strings using VIM-like motions, operations and quantifiers. It overlays the - * screen with highlighted search results and displays the current operation / motions / search - * string in the bottom right corner. - * - * https://github.com/juliusHuelsmann/st-history-vim - * https://st.suckless.org/patches/vim_browse/ - */ -#define VIM_BROWSE_PATCH 0 - /* Briefly inverts window content on terminal bell event. * https://st.suckless.org/patches/visualbell/ */ diff --git a/patches/selection-colors.diff b/patches/selection-colors.diff deleted file mode 100644 index f8ea091..0000000 --- a/patches/selection-colors.diff +++ /dev/null @@ -1,74 +0,0 @@ ---- a/st.h -+++ b/st.h -@@ -42,6 +42,7 @@ enum glyph_attribute { - ATTR_WDUMMY = 1 << 10, - ATTR_BOXDRAW = 1 << 11, - ATTR_LIGA = 1 << 12, -+ ATTR_SELECTED = 1 << 13, - ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, - ATTR_DIRTYUNDERLINE = 1 << 15, - }; ---- a/x.c -+++ b/x.c -@@ -1565,6 +1565,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i - } - } - -+ if (base.mode & ATTR_SELECTED) { -+ bg = &dc.col[selectionbg]; -+ if (!ignoreselfg) -+ fg = &dc.col[selectionfg]; -+ } -+ - if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK) - fg = bg; - -@@ -2005,7 +2011,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og, Line line, int le - - /* remove the old cursor */ - if (selected(ox, oy)) -- og.mode ^= ATTR_REVERSE; -+ og.mode |= ATTR_SELECTED; - /* Redraw the line where cursor was previously. - * It will restore the ligatures broken by the cursor. */ - xdrawline(line, 0, oy, len); -@@ -2020,25 +2026,13 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og, Line line, int le - - if (IS_SET(MODE_REVERSE)) { - g.mode |= ATTR_REVERSE; -+ g.fg = defaultcs; - g.bg = defaultfg; -- if (selected(cx, cy)) { -- drawcol = dc.col[defaultcs]; -- g.fg = defaultrcs; -- } else { -- drawcol = dc.col[defaultrcs]; -- g.fg = defaultcs; -- } -+ drawcol = dc.col[defaultrcs]; - } else { -- if (selected(cx, cy)) { -- g.fg = defaultfg; -- g.bg = defaultrcs; -- } -- else { -- g.fg = defaultbg; -- g.bg = defaultcs; -- } -- -- drawcol = dc.col[g.bg]; -+ g.fg = defaultbg; -+ g.bg = defaultcs; -+ drawcol = dc.col[defaultcs]; - } - - /* draw the new one */ -@@ -2196,7 +2190,7 @@ xdrawline(Line line, int x1, int y1, int x2) - if (new.mode == ATTR_WDUMMY) - continue; - if (selected(x, y1)) -- new.mode ^= ATTR_REVERSE; -+ new.mode |= ATTR_SELECTED; - if (i > 0 && ATTRCMP(base, new)) { - xdrawglyphfontspecs(specs, base, i, ox, y1, dmode); - specs += i; From a744fe43cdb2387a81f52564fdc01f5b9e83d101 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 18 Apr 2024 11:07:13 +0200 Subject: [PATCH 06/11] update patches, keybinds --- config.h | 2 ++ patches.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 7c249bb..486fd3e 100644 --- a/config.h +++ b/config.h @@ -211,6 +211,8 @@ static uint forcemousemod = ShiftMask; static MouseShortcut mshortcuts[] = { /* mask button function argument release screen */ + { ShiftMask, Button4, kscrollup, {.i = 1}, 0, S_PRI}, + { ShiftMask, Button5, kscrolldown, {.i = 1}, 0, S_PRI}, // { XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 }, // { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, // { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, diff --git a/patches.h b/patches.h index f5b2434..7cab373 100644 --- a/patches.h +++ b/patches.h @@ -322,7 +322,7 @@ * This variant depends on SCROLLBACK_PATCH being enabled. * https://st.suckless.org/patches/scrollback/ */ -#define SCROLLBACK_MOUSE_PATCH 0 +#define SCROLLBACK_MOUSE_PATCH 1 /* Scroll back through terminal output using mouse wheel (when not in MODE_ALTSCREEN). * This variant depends on SCROLLBACK_PATCH being enabled. @@ -441,7 +441,7 @@ /* Vertically center lines in the space available if you have set a larger chscale in config.h * https://st.suckless.org/patches/vertcenter/ */ -#define VERTCENTER_PATCH 1 +#define VERTCENTER_PATCH 0 /* Briefly inverts window content on terminal bell event. * https://st.suckless.org/patches/visualbell/ From d759862d817d63bff6df23f9d212f8681930af76 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 18 Apr 2024 13:01:47 +0200 Subject: [PATCH 07/11] change scroll distances --- config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 486fd3e..9f8f08d 100644 --- a/config.h +++ b/config.h @@ -246,8 +246,8 @@ static Shortcut shortcuts[] = { { TERMMOD, XK_Y, selpaste, {.i = 0}}, { TERMMOD, XK_Num_Lock, numlock, {.i = 0}}, { TERMMOD, XK_Escape, keyboard_select, {0}}, - { TERMMOD, XK_K, kscrollup, {.i = -1}, S_PRI }, - { TERMMOD, XK_J, kscrolldown, {.i = -1}, S_PRI }, + { TERMMOD, XK_K, kscrollup, {.i = 20}, S_PRI }, + { TERMMOD, XK_J, kscrolldown, {.i = 20}, S_PRI }, }; /* From 12e7cb8f9189f57c8b4560ffb56779324dfb9b22 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 18 Apr 2024 13:08:20 +0200 Subject: [PATCH 08/11] update submodules --- config.mk | 1 + flexipatch-finalizer | 2 +- st-flexipatch | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.mk b/config.mk index 8e04344..db1f56f 100644 --- a/config.mk +++ b/config.mk @@ -26,6 +26,7 @@ LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz` # Uncomment this for the SIXEL patch / SIXEL_PATCH SIXEL_C = sixel.c sixel_hls.c +SIXEL_LIBS = `$(PKG_CONFIG) --libs imlib2` # includes and libs, uncomment harfbuzz for the ligatures patch INCS = -I$(X11INC) \ diff --git a/flexipatch-finalizer b/flexipatch-finalizer index 7c66a3d..37e8cb6 160000 --- a/flexipatch-finalizer +++ b/flexipatch-finalizer @@ -1 +1 @@ -Subproject commit 7c66a3d0560d33d9d49b3e856859ef8a0af1fd6a +Subproject commit 37e8cb6145f189b805aa58c7d560b1adf51377a7 diff --git a/st-flexipatch b/st-flexipatch index 76cb580..118e965 160000 --- a/st-flexipatch +++ b/st-flexipatch @@ -1 +1 @@ -Subproject commit 76cb5801f6b94a56dc144fe8d00b9282fa32a43e +Subproject commit 118e965d0c8bd9c29b5e6bcba3ffcc1dd41064a7 From 7faa6813ef55b130d1f6b2e6483bd8a4614178a7 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 18 Apr 2024 13:50:18 +0200 Subject: [PATCH 09/11] fixes --- Makefile | 4 +- config.h | 75 ++++++++++++++++++++++---------------- config.mk | 18 ++++++--- patches.h | 2 +- patches/font-features.diff | 2 +- 5 files changed, 60 insertions(+), 41 deletions(-) diff --git a/Makefile b/Makefile index 307a983..d0e4488 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ install: st chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1 mkdir -p $(DESTDIR)$(PREFIX)/share/terminfo tic -sx -o $(DESTDIR)$(PREFIX)/share/terminfo st.info - # mkdir -p $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch - # test -f ${DESTDIR}${PREFIX}/share/applications/st.desktop || cp -n st.desktop $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch + mkdir -p $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch + test -f ${DESTDIR}${PREFIX}/share/applications/st.desktop || cp -n st.desktop $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch @echo Please see the README file regarding the terminfo entry of st. uninstall: diff --git a/config.h b/config.h index 9f8f08d..9058aef 100644 --- a/config.h +++ b/config.h @@ -32,7 +32,10 @@ char *scroll = NULL; char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; /* identification sequence returned in DA and DECID */ -char *vtiden = "\033[?12;4c"; +char *vtiden = "\033[?62;4c"; /* VT200 family (62) with sixel (4) */ + +/* sixel rgb byte order: LSBFirst or MSBFirst */ +int const sixelbyteorder = LSBFirst; /* Kerning / character bounding-box multipliers */ static float cwscale = 1.0; @@ -45,6 +48,10 @@ static float chscale = 1.0; */ wchar_t *worddelimiters = L" `'\"()[]{}=,"; +/* Word delimiters for short and long jumps in the keyboard select patch */ +wchar_t *kbds_sdelim = L"!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~ "; +wchar_t *kbds_ldelim = L" "; + /* selection timeouts (in milliseconds) */ static unsigned int doubleclicktimeout = 300; static unsigned int tripleclicktimeout = 600; @@ -62,8 +69,8 @@ int allowwindowops = 0; * 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. */ -static double minlatency = 5; -static double maxlatency = 30; +static double minlatency = 2; +static double maxlatency = 33; /* * Synchronized-Update timeout in ms @@ -82,6 +89,9 @@ static unsigned int blinktimeout = 800; */ static unsigned int cursorthickness = 2; +/* Hide the X cursor whenever a key is pressed. 0: off, 1: on */ +int hidecursor = 1; + /* * 1: render most of the lines/blocks characters without using the font for * perfect alignment between cells (U2500 - U259F except dashes/diagonals). @@ -155,13 +165,19 @@ static const char *colorname[] = { * Default colors (colorname index) * foreground, background, cursor, reverse cursor */ -unsigned int defaultcs = 256; -unsigned int defaultrcs = 257; unsigned int defaultfg = 258; unsigned int defaultbg = 259; +unsigned int defaultcs = 256; +unsigned int defaultrcs = 257; unsigned int selectionfg = 260; unsigned int selectionbg = 261; -static int ignoreselfg = 259; +/* If 0 use selectionfg as foreground in order to have a uniform + * foreground-color */ +/* Else if 1 keep original foreground-color of each cell => more colors :) */ +static int ignoreselfg = 1; +/* Foreground and background color of search results */ +unsigned int highlightfg = 3; +unsigned int highlightbg = 0; /* * 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 @@ -187,9 +203,11 @@ static unsigned int cols = 80; static unsigned int rows = 24; /* - * Default shape of the mouse cursor + * Default colour and shape of the mouse cursor */ -static char *mouseshape = "xterm"; +static unsigned int mouseshape = XC_xterm; +static unsigned int mousefg = 7; +static unsigned int mousebg = 0; /* * Color used to display font attributes when fontconfig selected a font which @@ -211,13 +229,8 @@ static uint forcemousemod = ShiftMask; static MouseShortcut mshortcuts[] = { /* mask button function argument release screen */ - { ShiftMask, Button4, kscrollup, {.i = 1}, 0, S_PRI}, - { ShiftMask, Button5, kscrolldown, {.i = 1}, 0, S_PRI}, - // { XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 }, - // { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, - // { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, - // { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, - // { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, + {ShiftMask, Button4, kscrollup, {.i = 1}, 0, S_PRI}, + {ShiftMask, Button5, kscrolldown, {.i = 1}, 0, S_PRI}, }; /* Internal keyboard shortcuts. */ @@ -232,22 +245,22 @@ static char *setbgcolorcmd[] = {"/bin/sh", "-c", "printf '\033]11;#008000\007'", "externalpipein", NULL}; static Shortcut shortcuts[] = { - /* mask keysym function argument screen - */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, - { ControlMask, XK_Print, toggleprinter, {.i = 0}}, - { ShiftMask, XK_Print, printscreen, {.i = 0}}, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, - { TERMMOD, XK_Prior, zoom, {.f = +3}}, - { TERMMOD, XK_Next, zoom, {.f = -3}}, - { TERMMOD, XK_Home, zoomreset, {.f = 0}}, - { TERMMOD, XK_C, clipcopy, {.i = 0}}, - { TERMMOD, XK_V, clippaste, {.i = 0}}, - { TERMMOD, XK_Y, selpaste, {.i = 0}}, - { TERMMOD, XK_Num_Lock, numlock, {.i = 0}}, - { TERMMOD, XK_Escape, keyboard_select, {0}}, - { TERMMOD, XK_K, kscrollup, {.i = 20}, S_PRI }, - { TERMMOD, XK_J, kscrolldown, {.i = 20}, S_PRI }, + {XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, + {ControlMask, XK_Print, toggleprinter, {.i = 0}}, + {TERMMOD, XK_Print, printscreen, {.i = 0}}, + {XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, + {TERMMOD, XK_Prior, zoom, {.f = +3}}, + {TERMMOD, XK_Next, zoom, {.f = -3}}, + {TERMMOD, XK_Home, zoomreset, {.f = 0}}, + {TERMMOD, XK_C, clipcopy, {.i = 0}}, + {TERMMOD, XK_V, clippaste, {.i = 0}}, + {TERMMOD, XK_Y, selpaste, {.i = 0}}, + {TERMMOD, XK_K, kscrollup, {.i = 20}, S_PRI}, + {TERMMOD, XK_J, kscrolldown, {.i = 20}, S_PRI}, + {TERMMOD, XK_Num_Lock, numlock, {.i = 0}}, + {TERMMOD, XK_Escape, keyboard_select, {0}}, + {TERMMOD, XK_F, searchforward, {0}}, + {TERMMOD, XK_B, searchbackward, {0}}, }; /* diff --git a/config.mk b/config.mk index db1f56f..ea3a8b2 100644 --- a/config.mk +++ b/config.mk @@ -1,11 +1,13 @@ # st version -VERSION = 0.9 +VERSION = 0.9.1 # Customize below to fit your system # paths PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man +ICONPREFIX = $(PREFIX)/share/pixmaps +ICONNAME = st.png X11INC = /usr/include/X11 X11LIB = /usr/lib @@ -13,10 +15,10 @@ X11LIB = /usr/lib PKG_CONFIG = pkg-config # Uncomment this for the alpha patch / ALPHA_PATCH -XRENDER = -lXrender +#XRENDER = `$(PKG_CONFIG) --libs xrender` # Uncomment this for the themed cursor patch / THEMED_CURSOR_PATCH -XCURSOR = -lXcursor +#XCURSOR = `$(PKG_CONFIG) --libs xcursor` # Uncomment the lines below for the ligatures patch / LIGATURES_PATCH LIGATURES_C = hb.c @@ -28,18 +30,22 @@ LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz` SIXEL_C = sixel.c sixel_hls.c SIXEL_LIBS = `$(PKG_CONFIG) --libs imlib2` +# Uncomment for the netwmicon patch / NETWMICON_PATCH +#NETWMICON_LIBS = `$(PKG_CONFIG) --libs gdlib` + # includes and libs, uncomment harfbuzz for the ligatures patch INCS = -I$(X11INC) \ `$(PKG_CONFIG) --cflags fontconfig` \ `$(PKG_CONFIG) --cflags freetype2` \ $(LIGATURES_INC) -LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft ${XRENDER} ${XCURSOR}\ +LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft ${SIXEL_LIBS} ${XRENDER} ${XCURSOR}\ `$(PKG_CONFIG) --libs fontconfig` \ `$(PKG_CONFIG) --libs freetype2` \ - $(LIGATURES_LIBS) + $(LIGATURES_LIBS) \ + $(NETWMICON_LIBS) # flags -STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 +STCPPFLAGS = -DVERSION=\"$(VERSION)\" -DICON=\"$(ICONPREFIX)/$(ICONNAME)\" -D_XOPEN_SOURCE=600 STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) STLDFLAGS = $(LIBS) $(LDFLAGS) diff --git a/patches.h b/patches.h index 7cab373..b0b82dd 100644 --- a/patches.h +++ b/patches.h @@ -398,7 +398,7 @@ * when including this patch. * https://st.suckless.org/patches/themed_cursor/ */ -#define THEMED_CURSOR_PATCH 1 +#define THEMED_CURSOR_PATCH 0 /* Adds support for special underlines. * diff --git a/patches/font-features.diff b/patches/font-features.diff index d545164..8607b29 100644 --- a/patches/font-features.diff +++ b/patches/font-features.diff @@ -4,7 +4,7 @@ * e. g. * FEATURE('c', 'a', 'l', 't'), FEATURE('d', 'l', 'i', 'g') */ --hb_feature_t features[] = { 0 }; +-hb_feature_t features[] = { }; +hb_feature_t features[] = { + FEATURE('c','v','0','2'), + FEATURE('c','v','1','6'), From 32abdd875d0da04c9f430051a269253acde2a52f Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 18 Apr 2024 13:52:54 +0200 Subject: [PATCH 10/11] update build container --- .forgejo/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index f4f293c..0318255 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -11,7 +11,7 @@ on: jobs: build-and-publish: runs-on: docker - container: git.snaile.de/snailed/xbps-builder:2024.46.1156@sha256:c69bcb9da724a31d9c1fff36fa6dc8f363b2d9f2470d3ec7887a0905c84b66ea + container: git.snaile.de/snailed/xbps-builder:2024.0418.1149 env: LICENSE: "GPL-2.0" SHORT_DESCRIPTION: "Customized st" @@ -45,7 +45,7 @@ jobs: cd st-final && make clean install DESTDIR="${GITHUB_WORKSPACE}/pkg" PREFIX="/usr" - name: Create package - run : | + run: | set -xeu export XBPS_TARGET_ARCH=${{ env.ARCH }} mkdir /target From 0687ff25f673cb9fc4d6ca746f9922b2130b59f8 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 18 Apr 2024 16:16:16 +0200 Subject: [PATCH 11/11] increase histsize --- patches/histsize.diff | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 patches/histsize.diff diff --git a/patches/histsize.diff b/patches/histsize.diff new file mode 100644 index 0000000..1a2d4c4 --- /dev/null +++ b/patches/histsize.diff @@ -0,0 +1,11 @@ +--- a/st.h ++++ b/st.h +@@ -27,7 +27,7 @@ + + #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) + #define IS_TRUECOL(x) (1 << 24 & (x)) +-#define HISTSIZE 2000 ++#define HISTSIZE 7500 + + enum glyph_attribute { + ATTR_NULL = 0,