rework
Build/Publish XBPS / build-and-publish (push) Successful in 8s Details

This commit is contained in:
Luca Bilke 2024-04-18 10:23:09 +02:00
parent 6037e1a5bd
commit dc51c13fb5
No known key found for this signature in database
GPG Key ID: AD6630D0A1E650AC
4 changed files with 75 additions and 113 deletions

View File

@ -62,8 +62,8 @@ int allowwindowops = 0;
* 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 = 3; static double minlatency = 5;
static double maxlatency = 25; static double maxlatency = 30;
/* /*
* Synchronized-Update timeout in ms * Synchronized-Update timeout in ms
@ -158,11 +158,10 @@ static const char *colorname[] = {
unsigned int defaultcs = 256; unsigned int defaultcs = 256;
unsigned int defaultrcs = 257; unsigned int defaultrcs = 257;
unsigned int defaultfg = 258; unsigned int defaultfg = 258;
unsigned int defaultbg = 0; unsigned int defaultbg = 259;
unsigned int bg = 259;
unsigned int selectionfg = 260; unsigned int selectionfg = 260;
unsigned int selectionbg = 261; 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 * 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}; "externalpipein", NULL};
static Shortcut shortcuts[] = { static Shortcut shortcuts[] = {
/* mask keysym function argument screen */ /* mask keysym function argument screen
{XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}}, */
{ControlMask, XK_Print, toggleprinter, {.i = 0}}, { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}},
{ShiftMask, XK_Print, printscreen, {.i = 0}}, { ControlMask, XK_Print, toggleprinter, {.i = 0}},
{XK_ANY_MOD, XK_Print, printsel, {.i = 0}}, { ShiftMask, XK_Print, printscreen, {.i = 0}},
{TERMMOD, XK_Prior, zoom, {.f = +3}}, { XK_ANY_MOD, XK_Print, printsel, {.i = 0}},
{TERMMOD, XK_Next, zoom, {.f = -3}}, { TERMMOD, XK_Prior, zoom, {.f = +3}},
{TERMMOD, XK_Home, zoomreset, {.f = 0}}, { TERMMOD, XK_Next, zoom, {.f = -3}},
{TERMMOD, XK_C, clipcopy, {.i = 0}}, { TERMMOD, XK_Home, zoomreset, {.f = 0}},
{TERMMOD, XK_V, clippaste, {.i = 0}}, { TERMMOD, XK_C, clipcopy, {.i = 0}},
{TERMMOD, XK_Y, selpaste, {.i = 0}}, { TERMMOD, XK_V, clippaste, {.i = 0}},
{ShiftMask, XK_Insert, selpaste, {.i = 0}}, { TERMMOD, XK_Y, selpaste, {.i = 0}},
{TERMMOD, XK_Num_Lock, numlock, {.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 },
}; };
/* /*

View File

@ -25,7 +25,7 @@ LIGATURES_INC = `$(PKG_CONFIG) --cflags harfbuzz`
LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz` LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz`
# Uncomment this for the SIXEL patch / SIXEL_PATCH # 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 # includes and libs, uncomment harfbuzz for the ligatures patch
INCS = -I$(X11INC) \ INCS = -I$(X11INC) \

View File

@ -77,9 +77,8 @@
#define CLIPBOARD_PATCH 0 #define CLIPBOARD_PATCH 0
/* This patch allows st to be resized without cutting off text when the terminal window is /* 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. * 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.
* The vim browse patch takes precedence over this patch.
* *
* https://github.com/bakkeby/st-flexipatch/issues/34 * https://github.com/bakkeby/st-flexipatch/issues/34
*/ */
@ -121,7 +120,7 @@
/* Return BS on pressing backspace and DEL on pressing the delete key. /* Return BS on pressing backspace and DEL on pressing the delete key.
* https://st.suckless.org/patches/delkey/ * https://st.suckless.org/patches/delkey/
*/ */
#define DELKEY_PATCH 0 #define DELKEY_PATCH 1
/* This patch adds the option of disabling bold fonts globally. /* This patch adds the option of disabling bold fonts globally.
* https://st.suckless.org/patches/disable_bold_italic_fonts/ * 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. /* This patch makes the cursor color the inverse of the current cell color.
* https://st.suckless.org/patches/dynamic-cursor-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. /* Reading and writing st's screen through a pipe, e.g. pass info to dmenu.
* https://st.suckless.org/patches/externalpipe/ * https://st.suckless.org/patches/externalpipe/
@ -213,9 +212,11 @@
#define ISO14755_PATCH 0 #define ISO14755_PATCH 0
/* This patch allows you to select text on the terminal using keyboard shortcuts. /* 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/ * 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 /* 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. * original text of a single line to a list of glyphs with ligatures included.
@ -233,16 +234,45 @@
*/ */
#define MONOCHROME_PATCH 0 #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/ * https://st.suckless.org/patches/netwmicon/
*/ */
#define NETWMICON_PATCH 0 #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 /* 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. * same CWD (current working directory) as the original st instance.
* https://st.suckless.org/patches/newterm/ * 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 /* 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. * respects it, will show the st window without window decorations.
@ -264,6 +294,13 @@
*/ */
#define OPENURLONCLICK_PATCH 1 #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 /* This patch allows you to specify a border that is relative in size to the width of a cell
* in the terminal. * in the terminal.
* https://st.suckless.org/patches/relativeborder/ * https://st.suckless.org/patches/relativeborder/
@ -279,7 +316,7 @@
/* Scroll back through terminal output using Shift+{PageUp, PageDown}. /* Scroll back through terminal output using Shift+{PageUp, PageDown}.
* https://st.suckless.org/patches/scrollback/ * https://st.suckless.org/patches/scrollback/
*/ */
#define SCROLLBACK_PATCH 0 #define SCROLLBACK_PATCH 1
/* Scroll back through terminal output using Shift+MouseWheel. /* Scroll back through terminal output using Shift+MouseWheel.
* This variant depends on SCROLLBACK_PATCH being enabled. * This variant depends on SCROLLBACK_PATCH being enabled.
@ -293,6 +330,13 @@
*/ */
#define SCROLLBACK_MOUSE_ALTSCREEN_PATCH 0 #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 /* 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 * 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. * are not shown in w3m if the alpha patch is applied.
@ -312,7 +356,7 @@
* *
* https://gist.github.com/saitoha/70e0fdf22e3e8f63ce937c7f7da71809 * 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 /* 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: * start X applications from the terminal. For example:
@ -399,16 +443,6 @@
*/ */
#define VERTCENTER_PATCH 1 #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. /* Briefly inverts window content on terminal bell event.
* https://st.suckless.org/patches/visualbell/ * https://st.suckless.org/patches/visualbell/
*/ */

View File

@ -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;