1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
ST Patches
* ST Patches Open Work
** TODO [#A] font2 (fallback font for glyphs + emojis)
st-font2-0.8.5.diff
** TODO [#A] right-click sends paste
st-rightclickpaste-0.8.2.diff
** TODO [#B] xresources with signal reloading
*** Description and URLs
This patch adds the ability to configure st via Xresources and signal reloading. This patch is not based on xresources patch and is extended from xst's commit on github.
You can basically pass a USR1 signal to all st processes after updating your Xresources to reload the settings: ` pidof st | xargs kill -s USR1 `
https://st.suckless.org/patches/xresources-with-reload-signal/
https://st.suckless.org/patches/xresources-with-reload-signal/st-xresources-signal-reloading-20220407-ef05519.diff
** TODO [#B] swaps the color of the background with the character the cursor is on
st-dynamic-cursor-color-0.9.diff
** TODO [#C] .desktop entry
st-desktopentry-0.8.5.diff
** TODO [#C] netwmicon
st-netwmicon-0.8.5-v2.diff
** TODO [#C] colorschemes
This patch adds multiple color schemes and lets you change them without having to restart st.
Predefined color schemes:
the default (dark) st color scheme
the default (dark) alacritty color scheme
One Half (dark & light)
Solarized (dark & light)
Gruvbox (dark & light)
It's similar to the palettes patch but it has additional features:
Support for the colors 17 to 256 (palettes returns random colors here).
Allow different background and foreground color indices for different color schemes.
Add a key binding for switching through color schemes.
Key bindings
Select the first..eighth color scheme with Alt+1..8.
Select the next color scheme with Alt+0.
Select the previous one with Ctrl+Alt+0.
https://st.suckless.org/patches/colorschemes/
https://st.suckless.org/patches/colorschemes/st-colorschemes-0.8.5.diff
* ST Patches Cancelled
** CANCELLED [#B] externalpipe
*** 2023-07-23 @ 16:32:10 -0500 skipping this patch.
*** 2023-07-23 @ 16:32:06 -0500 failed verification using the example in description
zsh: segmentation fault (core dumped) ./st
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x2200006
Serial number of failed request: 24
Current serial number in output stream: 25
*** 2023-07-23 @ 15:56:30 -0500 Patch applied w/ intervention, but make produces warnings.
Couldn't find proper match in st.h, but was about 4 lines off. The lines below the insert changed from another patch.
However, make is producing warnings.
In file included from st.c:20:
st.c: In function ‘externalpipe’:
st.c:2271:40: warning: passing argument 1 of ‘tlinelen’ makes pointer from integer without a cast [-Wint-conversion]
2271 | lastpos = MIN(tlinelen(n) + 1, term.col) - 1;
| ^
| |
| int
st.h:7:35: note: in definition of macro ‘MIN’
7 | #define MIN(a, b) ((a) < (b) ? (a) : (b))
| ^
st.c:450:15: note: expected ‘Line’ {aka ‘Glyph_ *’} but argument is of type ‘int’
450 | tlinelen(Line line)
| ~~~~~^~~~
st.c:2271:40: warning: passing argument 1 of ‘tlinelen’ makes pointer from integer without a cast [-Wint-conversion]
2271 | lastpos = MIN(tlinelen(n) + 1, term.col) - 1;
| ^
| |
| int
st.h:7:47: note: in definition of macro ‘MIN’
7 | #define MIN(a, b) ((a) < (b) ? (a) : (b))
| ^
st.c:450:15: note: expected ‘Line’ {aka ‘Glyph_ *’} but argument is of type ‘int’
450 | tlinelen(Line line)
| ~~~~~^~~~
*** Description and URLs
Reading and writing st's screen through a pipe.
Example
config.h example, binding TERMMOD + U to extract all visible URLs and present dmenu to select and open one:
static char *openurlcmd[] = { "/bin/sh", "-c",
"xurls | dmenu -l 10 -w $WINDOWID | xargs -r open",
"externalpipe", NULL };
Shortcut shortcuts[] = {
...
{ TERMMOD, XK_U, externalpipe, { .v = openurlcmd } },
};
(xurls and open are external scripts)
xurls: https://raw.github.com/bobrippling/perlbin/master/xurls
open: https://github.com/bobrippling/open which leads here:
https://raw.githubusercontent.com/bobrippling/open/master/open
Example Shell Scripts
link grabber - similar to the function above, but without xurls dependency
https://st.suckless.org/patches/externalpipe/linkgrabber.sh
edit screen - open screen in $EDITOR for copying text
https://st.suckless.org/patches/externalpipe/editscreen.sh
https://st.suckless.org/patches/externalpipe/
https://st.suckless.org/patches/externalpipe/st-externalpipe-0.8.4.diff
When using the scrollback patch, you can apply this patch ontop in order to use externalpipe onto the entire terminal history:
https://st.suckless.org/patches/externalpipe/st-externalpipe-eternal-0.8.3.diff
* ST Patches Completed
** DONE [#A] ligatures (apply after alpha and scrollback)
*** 2023-07-23 @ 15:31:37 -0500 Tested and working fine
<= and || showed up instantly when switching font to FiraCode Nerd Font Mono
*** 2023-07-23 @ 15:07:50 -0500 Patch applied w/ manual intervention
Minimal changes. Surprised there was any issues here. I couldn't find why the patterns couldn't match.
I'd forgotten how touchy Makefiles are. Hard to tell what whitespace was missing in config.mk.
*** Description and URL
This patch adds proper drawing of ligatures.
The code uses Harfbuzz library to transform original text of a single line to a list of glyphs with ligatures included.
Note
The patch adds additional dependency on Harfbuzz library and headers.
Original patch was made for vanilla version of ST from latest master commit. It is not 100% compatible with Scrollback and Alpha patches, so I made modified versions that you can apply on top of a Scrollback and/or Alpha patch.
Due to some limitations in drawing engine, ligatures will break when crossing colors, font styles or selection. They will still render properly as separate symbols, just not as ligatures.
Since 0.8.4 patch, there's now a way to enable additional font rendering features. Look into features array in hb.c for details.
Boxdraw
The original patch does not work very well with the boxdraw patch. Since it requires some additional changes in the code to make ligatures compatible with boxdraw, a special version of the patch was added, that you can apply on top of the boxdraw patch.
It does not include Alpha or Scrollback patches.
https://st.suckless.org/patches/ligatures/
https://st.suckless.org/patches/ligatures/0.9/st-ligatures-alpha-scrollback-20230105-0.9.diff
** DONE [#A] alpha
*** 2023-07-23 @ 15:00:52 -0500 Patch applied successfully without issue
*** Patch Description and URL
This patch allows users to change the opacity of the background. Note that you need an X composite manager (e.g. compton, xcompmgr) to make this patch effective.
Notes
The alpha value affects the default background only.
The color designated by 'defaultbg' should not be used elsewhere.
Embedding might fail after applying this patch.
Changes in 0.8.2
The internal method for querying X visual is changed. St will respect the visual of its parent window, allowing it to be embedded easily.
Opacity value is now typed in float.
-A option is added to allow changing the opacity value without compiling.
https://st.suckless.org/patches/alpha/
https://st.suckless.org/patches/alpha/st-alpha-osc11-20220222-0.8.5.diff
*** A Note on OSC 11
'\e]11;?\007' can be used to query the background color of a terminal (OSC 11).
OSC 11 is used by Neovim to automatically set its background setting to "dark" or "light".
** DONE [#A] clipboard
Prefer the system (browser) clipboard instead of the terminal clipboard
*** 2023-07-23 @ 13:56:02 -0500 patch applied successfully w/o issue
*** Description and URL
The Freedesktop standard requires you to remember which clipboard you are keeping selections in. If you switch between a terminal and browser, you may find this UX jarring.
Description
This trivial patch sets CLIPBOARD on selection, the same as your browser.
You may want to replace selpaste with clippaste in your config.h bindings to complete the effect.
https://st.suckless.org/patches/clipboard/
https://st.suckless.org/patches/clipboard/st-clipboard-0.8.3.diff
st-clipboard-0.8.3.diff
** DONE [#A] delkey
Backspace key sends BS; delete key send DEL
*** 2023-07-23 @ 13:52:50 -0500 patch applied successfully w/o issue
*** Description and URL
Return BS on pressing backspace and DEL on pressing the delete key.
https://st.suckless.org/patches/delkey/
https://st.suckless.org/patches/delkey/st-delkey-20201112-4ef0cbd.diff
** DONE [#A] scrollback and reflow
*** 2023-07-23 @ 13:48:51 -0500 All patches applied successfully w/o issue
*** Patch Links and Descriptions
https://st.suckless.org/patches/scrollback/
Scroll back through terminal output using Shift+{PageUp, PageDown}.
https://st.suckless.org/patches/scrollback/st-scrollback-0.8.5.diff
Apply the following patch on top of the previous to allow column and row reflow.
https://st.suckless.org/patches/scrollback/st-scrollback-reflow-20230607-211964d.diff
Apply the following patch on top of the previous to allow scrolling using Shift+MouseWheel.
https://st.suckless.org/patches/scrollback/st-scrollback-mouse-20220127-2c5edf2.diff
Apply the following patch on top of the previous two to allow scrollback using mouse wheel only when not in MODE_ALTSCREEN.
https://st.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20220127-2c5edf2.diff
|