Compare commits
No commits in common. "0eeee01496e62a629bba52b0d6514d5437865048" and "48f696499db3c6adfe6e0813afc49c582be20a3b" have entirely different histories.
0eeee01496
...
48f696499d
14 changed files with 60 additions and 429 deletions
10
README.md
10
README.md
|
|
@ -1,4 +1,4 @@
|
||||||
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.9.2 (98610fc, 2025-01-26) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
|
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.9.2 (6009e6e, 2024-11-25) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
|
||||||
|
|
||||||
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/st-flexipatch/blob/master/patches.def.h):
|
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/st-flexipatch/blob/master/patches.def.h):
|
||||||
```c
|
```c
|
||||||
|
|
@ -15,8 +15,6 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
|
||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
2025-02-20 - Added the drag-n-drop and open-selected-text patches
|
|
||||||
|
|
||||||
2024-05-31 - Added the anygeometry patch
|
2024-05-31 - Added the anygeometry patch
|
||||||
|
|
||||||
2024-03-13 - Added the reflow patch and upgraded the netwmicon patch
|
2024-03-13 - Added the reflow patch and upgraded the netwmicon patch
|
||||||
|
|
@ -164,9 +162,6 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
|
||||||
- [disable-fonts](https://st.suckless.org/patches/disable_bold_italic_fonts/)
|
- [disable-fonts](https://st.suckless.org/patches/disable_bold_italic_fonts/)
|
||||||
- this patch adds the option of disabling bold/italic/roman fonts globally
|
- this patch adds the option of disabling bold/italic/roman fonts globally
|
||||||
|
|
||||||
- [drag-n-drop](https://st.suckless.org/patches/drag-n-drop)
|
|
||||||
- allows dragging a file into the terminal and have the path printed
|
|
||||||
|
|
||||||
- [dynamic-cursor-color](https://st.suckless.org/patches/dynamic-cursor-color/)
|
- [dynamic-cursor-color](https://st.suckless.org/patches/dynamic-cursor-color/)
|
||||||
- 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
|
||||||
|
|
||||||
|
|
@ -235,9 +230,6 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
|
||||||
- [open-copied-url](https://st.suckless.org/patches/open_copied_url/)
|
- [open-copied-url](https://st.suckless.org/patches/open_copied_url/)
|
||||||
- open contents of the clipboard in a user-defined browser
|
- open contents of the clipboard in a user-defined browser
|
||||||
|
|
||||||
- [open-selected-text](https://st.suckless.org/patches/open_selected_text)
|
|
||||||
- open the selected text using `xdg-open`
|
|
||||||
|
|
||||||
- [openurlonclick](https://www.reddit.com/r/suckless/comments/cc83om/st_open_url/)
|
- [openurlonclick](https://www.reddit.com/r/suckless/comments/cc83om/st_open_url/)
|
||||||
- allows for URLs to be opened directly when you click on them
|
- allows for URLs to be opened directly when you click on them
|
||||||
|
|
||||||
|
|
|
||||||
54
config.def.h
54
config.def.h
|
|
@ -162,7 +162,7 @@ unsigned int tabspaces = 8;
|
||||||
|
|
||||||
#if ALPHA_PATCH
|
#if ALPHA_PATCH
|
||||||
/* bg opacity */
|
/* bg opacity */
|
||||||
float alpha = 0.9;
|
float alpha = 0.8;
|
||||||
#if ALPHA_GRADIENT_PATCH
|
#if ALPHA_GRADIENT_PATCH
|
||||||
float grad_alpha = 0.54; //alpha value that'll change
|
float grad_alpha = 0.54; //alpha value that'll change
|
||||||
float stat_alpha = 0.46; //constant alpha value that'll get added to grad_alpha
|
float stat_alpha = 0.46; //constant alpha value that'll get added to grad_alpha
|
||||||
|
|
@ -172,39 +172,30 @@ float alphaUnfocused = 0.6;
|
||||||
#endif // ALPHA_FOCUS_HIGHLIGHT_PATCH
|
#endif // ALPHA_FOCUS_HIGHLIGHT_PATCH
|
||||||
#endif // ALPHA_PATCH
|
#endif // ALPHA_PATCH
|
||||||
|
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
/*
|
|
||||||
* drag and drop escape characters
|
|
||||||
*
|
|
||||||
* this will add a '\' before any characters specified in the string.
|
|
||||||
*/
|
|
||||||
char *xdndescchar = " !\"#$&'()*;<>?[\\]^`{|}~";
|
|
||||||
#endif // DRAG_AND_DROP_PATCH
|
|
||||||
|
|
||||||
/* Terminal colors (16 first used in escape sequence) */
|
/* Terminal colors (16 first used in escape sequence) */
|
||||||
static char *colorname[] = {
|
static char *colorname[] = {
|
||||||
"#000000",
|
"#011627", /* hard contrast: #1d2021 / soft contrast: #32302f */
|
||||||
"#ff3333",
|
"#d3423e",
|
||||||
"#86b200",
|
"#2aa298",
|
||||||
"#f19618",
|
"#daaa01",
|
||||||
"#41a6d9",
|
"#4876d6",
|
||||||
"#f07078",
|
"#403f53",
|
||||||
"#4cbe99",
|
"#08916a",
|
||||||
"#ffffff",
|
"#7a8181",
|
||||||
"#323232",
|
"#7a8181",
|
||||||
"#ff6565",
|
"#f76e6e",
|
||||||
"#b8e532",
|
"#49d0c5",
|
||||||
"#ffc849",
|
"#dac26b",
|
||||||
"#73d7ff",
|
"#5ca7e4",
|
||||||
"#ffa3aa",
|
"#697098",
|
||||||
"#7ff0cb",
|
"#00c990",
|
||||||
"#ffffff",
|
"#989fb1",
|
||||||
[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 */
|
||||||
"#ff6900", /* 256 -> cursor */
|
"#403f53", /* 256 -> cursor */
|
||||||
"#f0ede4", /* 257 -> rev cursor*/
|
"#f2f2f2", /* 257 -> rev cursor*/
|
||||||
"#fafafa", /* 258 -> bg */
|
"#ffffff", /* 258 -> bg */
|
||||||
"#5b6673", /* 259 -> fg */
|
"#403f53", /* 259 -> fg */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if DARKMAN_PATCH
|
#if DARKMAN_PATCH
|
||||||
|
|
@ -401,9 +392,6 @@ static uint forcemousemod = ShiftMask;
|
||||||
*/
|
*/
|
||||||
static MouseShortcut mshortcuts[] = {
|
static MouseShortcut mshortcuts[] = {
|
||||||
/* mask button function argument release screen */
|
/* mask button function argument release screen */
|
||||||
#if OPEN_SELECTED_TEXT_PATCH
|
|
||||||
{ ControlMask, Button2, selopen, {.i = 0}, 1 },
|
|
||||||
#endif // OPEN_SELECTED_TEXT_PATCH
|
|
||||||
#if CLIPBOARD_PATCH
|
#if CLIPBOARD_PATCH
|
||||||
{ XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 },
|
{ XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 },
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ INCS = -I$(X11INC) \
|
||||||
`$(PKG_CONFIG) --cflags fontconfig` \
|
`$(PKG_CONFIG) --cflags fontconfig` \
|
||||||
`$(PKG_CONFIG) --cflags freetype2` \
|
`$(PKG_CONFIG) --cflags freetype2` \
|
||||||
$(LIGATURES_INC)
|
$(LIGATURES_INC)
|
||||||
LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft ${SIXEL_LIBS} ${XRENDER} ${XCURSOR}\
|
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft ${SIXEL_LIBS} ${XRENDER} ${XCURSOR}\
|
||||||
`$(PKG_CONFIG) --libs fontconfig` \
|
`$(PKG_CONFIG) --libs fontconfig` \
|
||||||
`$(PKG_CONFIG) --libs freetype2` \
|
`$(PKG_CONFIG) --libs freetype2` \
|
||||||
$(LIGATURES_LIBS) \
|
$(LIGATURES_LIBS) \
|
||||||
|
|
@ -50,7 +50,10 @@ STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||||
STLDFLAGS = $(LIBS) $(LDFLAGS)
|
STLDFLAGS = $(LIBS) $(LDFLAGS)
|
||||||
|
|
||||||
# OpenBSD:
|
# OpenBSD:
|
||||||
#CPPFLAGS = $(STCPPFLAGS) -D_XOPEN_SOURCE=600
|
#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
|
||||||
|
#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
|
||||||
|
# `pkg-config --libs fontconfig` \
|
||||||
|
# `pkg-config --libs freetype2`
|
||||||
#MANPREFIX = ${PREFIX}/man
|
#MANPREFIX = ${PREFIX}/man
|
||||||
|
|
||||||
# compiler and linker
|
# compiler and linker
|
||||||
|
|
|
||||||
|
|
@ -1,204 +0,0 @@
|
||||||
const char XdndVersion = 5;
|
|
||||||
|
|
||||||
void
|
|
||||||
xdndsel(XEvent *e)
|
|
||||||
{
|
|
||||||
char* data;
|
|
||||||
unsigned long result;
|
|
||||||
|
|
||||||
Atom actualType;
|
|
||||||
int32_t actualFormat;
|
|
||||||
unsigned long bytesAfter;
|
|
||||||
XEvent reply = { ClientMessage };
|
|
||||||
|
|
||||||
reply.xclient.window = xw.XdndSourceWin;
|
|
||||||
reply.xclient.format = 32;
|
|
||||||
reply.xclient.data.l[0] = (long) xw.win;
|
|
||||||
reply.xclient.data.l[2] = 0;
|
|
||||||
reply.xclient.data.l[3] = 0;
|
|
||||||
|
|
||||||
XGetWindowProperty((Display*) xw.dpy, e->xselection.requestor,
|
|
||||||
e->xselection.property, 0, LONG_MAX, False,
|
|
||||||
e->xselection.target, &actualType, &actualFormat, &result,
|
|
||||||
&bytesAfter, (unsigned char**) &data);
|
|
||||||
|
|
||||||
if (result == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
xdndpastedata(data);
|
|
||||||
XFree(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xw.XdndSourceVersion >= 2) {
|
|
||||||
reply.xclient.message_type = xw.XdndFinished;
|
|
||||||
reply.xclient.data.l[1] = result;
|
|
||||||
reply.xclient.data.l[2] = xw.XdndActionCopy;
|
|
||||||
|
|
||||||
XSendEvent((Display*) xw.dpy, xw.XdndSourceWin, False, NoEventMask,
|
|
||||||
&reply);
|
|
||||||
XFlush((Display*) xw.dpy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
xdndurldecode(char *src, char *dest)
|
|
||||||
{
|
|
||||||
char c;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
while (*src) {
|
|
||||||
if (*src == '%' && HEX_TO_INT(src[1]) != -1 && HEX_TO_INT(src[2]) != -1) {
|
|
||||||
/* handle %xx escape sequences in url e.g. %20 == ' ' */
|
|
||||||
c = (char)((HEX_TO_INT(src[1]) << 4) | HEX_TO_INT(src[2]));
|
|
||||||
src += 3;
|
|
||||||
} else {
|
|
||||||
c = *src++;
|
|
||||||
}
|
|
||||||
if (strchr(xdndescchar, c) != NULL) {
|
|
||||||
*dest++ = '\\';
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
*dest++ = c;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
*dest++ = ' ';
|
|
||||||
*dest = '\0';
|
|
||||||
return i + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
xdndpastedata(char *data)
|
|
||||||
{
|
|
||||||
char *pastedata, *t;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
pastedata = (char *)malloc(strlen(data) * 2 + 1);
|
|
||||||
*pastedata = '\0';
|
|
||||||
|
|
||||||
t = strtok(data, "\n\r");
|
|
||||||
while(t != NULL) {
|
|
||||||
/* Remove 'file://' prefix if it exists */
|
|
||||||
if (strncmp(data, "file://", 7) == 0) {
|
|
||||||
t += 7;
|
|
||||||
}
|
|
||||||
i += xdndurldecode(t, pastedata + i);
|
|
||||||
t = strtok(NULL, "\n\r");
|
|
||||||
}
|
|
||||||
|
|
||||||
xsetsel(pastedata);
|
|
||||||
selpaste(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
xdndenter(XEvent *e)
|
|
||||||
{
|
|
||||||
unsigned long count;
|
|
||||||
Atom* formats;
|
|
||||||
Atom real_formats[6];
|
|
||||||
Bool list;
|
|
||||||
Atom actualType;
|
|
||||||
int32_t actualFormat;
|
|
||||||
unsigned long bytesAfter;
|
|
||||||
unsigned long i;
|
|
||||||
|
|
||||||
list = e->xclient.data.l[1] & 1;
|
|
||||||
|
|
||||||
if (list) {
|
|
||||||
XGetWindowProperty((Display*) xw.dpy,
|
|
||||||
xw.XdndSourceWin,
|
|
||||||
xw.XdndTypeList,
|
|
||||||
0,
|
|
||||||
LONG_MAX,
|
|
||||||
False,
|
|
||||||
4,
|
|
||||||
&actualType,
|
|
||||||
&actualFormat,
|
|
||||||
&count,
|
|
||||||
&bytesAfter,
|
|
||||||
(unsigned char**) &formats);
|
|
||||||
} else {
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
if (e->xclient.data.l[2] != None)
|
|
||||||
real_formats[count++] = e->xclient.data.l[2];
|
|
||||||
if (e->xclient.data.l[3] != None)
|
|
||||||
real_formats[count++] = e->xclient.data.l[3];
|
|
||||||
if (e->xclient.data.l[4] != None)
|
|
||||||
real_formats[count++] = e->xclient.data.l[4];
|
|
||||||
|
|
||||||
formats = real_formats;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
|
||||||
if (formats[i] == xw.XtextUriList || formats[i] == xw.XtextPlain) {
|
|
||||||
xw.XdndSourceFormat = formats[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list)
|
|
||||||
XFree(formats);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
xdndpos(XEvent *e)
|
|
||||||
{
|
|
||||||
const int32_t xabs = (e->xclient.data.l[2] >> 16) & 0xffff;
|
|
||||||
const int32_t yabs = (e->xclient.data.l[2]) & 0xffff;
|
|
||||||
Window dummy;
|
|
||||||
int32_t xpos, ypos;
|
|
||||||
XEvent reply = { ClientMessage };
|
|
||||||
|
|
||||||
reply.xclient.window = xw.XdndSourceWin;
|
|
||||||
reply.xclient.format = 32;
|
|
||||||
reply.xclient.data.l[0] = (long) xw.win;
|
|
||||||
reply.xclient.data.l[2] = 0;
|
|
||||||
reply.xclient.data.l[3] = 0;
|
|
||||||
|
|
||||||
XTranslateCoordinates((Display*) xw.dpy,
|
|
||||||
XDefaultRootWindow((Display*) xw.dpy),
|
|
||||||
(Window) xw.win,
|
|
||||||
xabs, yabs,
|
|
||||||
&xpos, &ypos,
|
|
||||||
&dummy);
|
|
||||||
|
|
||||||
reply.xclient.message_type = xw.XdndStatus;
|
|
||||||
|
|
||||||
if (xw.XdndSourceFormat) {
|
|
||||||
reply.xclient.data.l[1] = 1;
|
|
||||||
if (xw.XdndSourceVersion >= 2)
|
|
||||||
reply.xclient.data.l[4] = xw.XdndActionCopy;
|
|
||||||
}
|
|
||||||
|
|
||||||
XSendEvent((Display*) xw.dpy, xw.XdndSourceWin, False, NoEventMask,
|
|
||||||
&reply);
|
|
||||||
XFlush((Display*) xw.dpy);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
xdnddrop(XEvent *e)
|
|
||||||
{
|
|
||||||
Time time = CurrentTime;
|
|
||||||
XEvent reply = { ClientMessage };
|
|
||||||
|
|
||||||
reply.xclient.window = xw.XdndSourceWin;
|
|
||||||
reply.xclient.format = 32;
|
|
||||||
reply.xclient.data.l[0] = (long) xw.win;
|
|
||||||
reply.xclient.data.l[2] = 0;
|
|
||||||
reply.xclient.data.l[3] = 0;
|
|
||||||
|
|
||||||
if (xw.XdndSourceFormat) {
|
|
||||||
if (xw.XdndSourceVersion >= 1)
|
|
||||||
time = e->xclient.data.l[2];
|
|
||||||
|
|
||||||
XConvertSelection((Display*) xw.dpy, xw.XdndSelection,
|
|
||||||
xw.XdndSourceFormat, xw.XdndSelection, (Window) xw.win, time);
|
|
||||||
} else if (xw.XdndSourceVersion >= 2) {
|
|
||||||
reply.xclient.message_type = xw.XdndFinished;
|
|
||||||
|
|
||||||
XSendEvent((Display*) xw.dpy, xw.XdndSourceWin,
|
|
||||||
False, NoEventMask, &reply);
|
|
||||||
XFlush((Display*) xw.dpy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
static void xdndenter(XEvent *);
|
|
||||||
static void xdndpos(XEvent *);
|
|
||||||
static void xdnddrop(XEvent *);
|
|
||||||
static void xdndsel(XEvent *);
|
|
||||||
static void xdndpastedata(char *);
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
void
|
|
||||||
selopen(const Arg *dummy)
|
|
||||||
{
|
|
||||||
pid_t chpid;
|
|
||||||
|
|
||||||
if ((chpid = fork()) == 0) {
|
|
||||||
if (fork() == 0)
|
|
||||||
execlp("xdg-open", "xdg-open", getsel(), NULL);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if (chpid > 0)
|
|
||||||
waitpid(chpid, NULL, 0);
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
static void selopen(const Arg *);
|
|
||||||
|
|
@ -619,8 +619,8 @@ tclearregion(int x1, int y1, int x2, int y2, int usecurattr)
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
/* regionselected() takes relative coordinates */
|
/* regionselected() takes relative coordinates */
|
||||||
if (regionselected(x1, y1+term.scr, x2, y2+term.scr))
|
if (regionselected(x1+term.scr, y1+term.scr, x2+term.scr, y2+term.scr))
|
||||||
selclear();
|
selremove();
|
||||||
|
|
||||||
for (y = y1; y <= y2; y++) {
|
for (y = y1; y <= y2; y++) {
|
||||||
term.dirty[y] = 1;
|
term.dirty[y] = 1;
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@
|
||||||
#if BOXDRAW_PATCH
|
#if BOXDRAW_PATCH
|
||||||
#include "boxdraw.c"
|
#include "boxdraw.c"
|
||||||
#endif
|
#endif
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
#include "drag-n-drop.c"
|
|
||||||
#endif
|
|
||||||
#if OPENCOPIED_PATCH
|
#if OPENCOPIED_PATCH
|
||||||
#include "opencopied.c"
|
#include "opencopied.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -38,9 +35,6 @@
|
||||||
#elif NETWMICON_LEGACY_PATCH
|
#elif NETWMICON_LEGACY_PATCH
|
||||||
#include "netwmicon_legacy.c"
|
#include "netwmicon_legacy.c"
|
||||||
#endif
|
#endif
|
||||||
#if OPEN_SELECTED_TEXT_PATCH
|
|
||||||
#include "openselectedtext.c"
|
|
||||||
#endif
|
|
||||||
#if OPENURLONCLICK_PATCH
|
#if OPENURLONCLICK_PATCH
|
||||||
#include "openurlonclick.c"
|
#include "openurlonclick.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@
|
||||||
#if BOXDRAW_PATCH
|
#if BOXDRAW_PATCH
|
||||||
#include "boxdraw.h"
|
#include "boxdraw.h"
|
||||||
#endif
|
#endif
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
#include "drag-n-drop.h"
|
|
||||||
#endif
|
|
||||||
#if OPENCOPIED_PATCH
|
#if OPENCOPIED_PATCH
|
||||||
#include "opencopied.h"
|
#include "opencopied.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -35,9 +32,6 @@
|
||||||
#if NETWMICON_PATCH || NETWMICON_FF_PATCH || NETWMICON_LEGACY_PATCH
|
#if NETWMICON_PATCH || NETWMICON_FF_PATCH || NETWMICON_LEGACY_PATCH
|
||||||
#include "netwmicon.h"
|
#include "netwmicon.h"
|
||||||
#endif
|
#endif
|
||||||
#if OPEN_SELECTED_TEXT_PATCH
|
|
||||||
#include "openselectedtext.h"
|
|
||||||
#endif
|
|
||||||
#if RIGHTCLICKTOPLUMB_PATCH
|
#if RIGHTCLICKTOPLUMB_PATCH
|
||||||
#include "rightclicktoplumb_x.h"
|
#include "rightclicktoplumb_x.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -144,27 +144,11 @@
|
||||||
*/
|
*/
|
||||||
#define DISABLE_ROMAN_FONTS_PATCH 0
|
#define DISABLE_ROMAN_FONTS_PATCH 0
|
||||||
|
|
||||||
/* Allows dragging a file into the terminal and have the path printed.
|
|
||||||
* https://st.suckless.org/patches/drag-n-drop
|
|
||||||
*/
|
|
||||||
#define DRAG_AND_DROP_PATCH 0
|
|
||||||
|
|
||||||
/* 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 0
|
||||||
|
|
||||||
/* This is a variant of the anysize patch that explicitly do not change the size increment hints,
|
|
||||||
* i.e. only keeping the dynamic padding which is the main thing the anysize patch introduces.
|
|
||||||
* In practice this means that the dynamic padding / anysize functionality only ever comes into
|
|
||||||
* effect when the size hints are intentionally ignored.
|
|
||||||
* An example of this would be dwm respecting the size hints of floating windows, but disrespecting
|
|
||||||
* the size hints when the window is tiled (provided that resizehints config is set to 0).
|
|
||||||
*
|
|
||||||
* Note that this patch depends on ANYSIZE_PATCH being enabled to have an effect.
|
|
||||||
*/
|
|
||||||
#define DYNAMIC_PADDING_PATCH 0
|
|
||||||
|
|
||||||
/* 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/
|
||||||
*/
|
*/
|
||||||
|
|
@ -317,11 +301,6 @@
|
||||||
*/
|
*/
|
||||||
#define OPENCOPIED_PATCH 0
|
#define OPENCOPIED_PATCH 0
|
||||||
|
|
||||||
/* Open the selected text using xdg-open.
|
|
||||||
* https://st.suckless.org/patches/open_selected_text/
|
|
||||||
*/
|
|
||||||
#define OPEN_SELECTED_TEXT_PATCH 0
|
|
||||||
|
|
||||||
/* This patch allows for URLs to be opened directly when you click on them. This may not work with
|
/* This patch allows for URLs to be opened directly when you click on them. This may not work with
|
||||||
* all terminal applications.
|
* all terminal applications.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
32
st.c
32
st.c
|
|
@ -2039,15 +2039,6 @@ tsetmode(int priv, int set, const int *args, int narg)
|
||||||
MODBIT(term.mode, set, MODE_SIXEL_CUR_RT);
|
MODBIT(term.mode, set, MODE_SIXEL_CUR_RT);
|
||||||
break;
|
break;
|
||||||
#endif // SIXEL_PATCH
|
#endif // SIXEL_PATCH
|
||||||
#if SYNC_PATCH
|
|
||||||
case 2026:
|
|
||||||
if (set) {
|
|
||||||
tsync_begin();
|
|
||||||
} else {
|
|
||||||
tsync_end();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif // SYNC_PATCH
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"erresc: unknown private set/reset mode %d\n",
|
"erresc: unknown private set/reset mode %d\n",
|
||||||
|
|
@ -2444,23 +2435,6 @@ csihandle(void)
|
||||||
goto unknown;
|
goto unknown;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if SYNC_PATCH
|
|
||||||
case '$': /* DECRQM -- DEC Request Mode (private) */
|
|
||||||
if (csiescseq.mode[1] == 'p' && csiescseq.priv) {
|
|
||||||
switch (csiescseq.arg[0]) {
|
|
||||||
#if SYNC_PATCH
|
|
||||||
case 2026:
|
|
||||||
/* https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036 */
|
|
||||||
ttywrite(su ? "\033[?2026;1$y" : "\033[?2026;2$y", 11, 0);
|
|
||||||
break;
|
|
||||||
#endif // SYNC_PATCH
|
|
||||||
default:
|
|
||||||
goto unknown;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
goto unknown;
|
|
||||||
#endif // SYNC_PATCH
|
|
||||||
case 'r': /* DECSTBM -- Set Scrolling Region */
|
case 'r': /* DECSTBM -- Set Scrolling Region */
|
||||||
if (csiescseq.priv) {
|
if (csiescseq.priv) {
|
||||||
goto unknown;
|
goto unknown;
|
||||||
|
|
@ -2524,11 +2498,7 @@ csihandle(void)
|
||||||
break;
|
break;
|
||||||
#endif // CSI_22_23_PATCH | SIXEL_PATCH
|
#endif // CSI_22_23_PATCH | SIXEL_PATCH
|
||||||
case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */
|
case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */
|
||||||
if (csiescseq.priv) {
|
|
||||||
goto unknown;
|
|
||||||
} else {
|
|
||||||
tcursor(CURSOR_LOAD);
|
tcursor(CURSOR_LOAD);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
switch (csiescseq.mode[1]) {
|
switch (csiescseq.mode[1]) {
|
||||||
|
|
@ -3464,7 +3434,7 @@ check_control_code:
|
||||||
|
|
||||||
#if REFLOW_PATCH
|
#if REFLOW_PATCH
|
||||||
/* selected() takes relative coordinates */
|
/* selected() takes relative coordinates */
|
||||||
if (selected(term.c.x, term.c.y + term.scr))
|
if (selected(term.c.x + term.scr, term.c.y + term.scr))
|
||||||
selclear();
|
selclear();
|
||||||
#else
|
#else
|
||||||
if (selected(term.c.x, term.c.y))
|
if (selected(term.c.x, term.c.y))
|
||||||
|
|
|
||||||
14
st.h
14
st.h
|
|
@ -37,12 +37,6 @@
|
||||||
#define HISTSIZE 2000
|
#define HISTSIZE 2000
|
||||||
#endif // SCROLLBACK_PATCH | REFLOW_PATCH
|
#endif // SCROLLBACK_PATCH | REFLOW_PATCH
|
||||||
|
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
#define HEX_TO_INT(c) ((c) >= '0' && (c) <= '9' ? (c) - '0' : \
|
|
||||||
(c) >= 'a' && (c) <= 'f' ? (c) - 'a' + 10 : \
|
|
||||||
(c) >= 'A' && (c) <= 'F' ? (c) - 'A' + 10 : -1)
|
|
||||||
#endif // DRAG_AND_DROP_PATCH
|
|
||||||
|
|
||||||
enum glyph_attribute {
|
enum glyph_attribute {
|
||||||
ATTR_NULL = 0,
|
ATTR_NULL = 0,
|
||||||
ATTR_SET = 1 << 0,
|
ATTR_SET = 1 << 0,
|
||||||
|
|
@ -253,14 +247,6 @@ typedef struct {
|
||||||
GlyphFontSeq *specseq;
|
GlyphFontSeq *specseq;
|
||||||
#endif // LIGATURES_PATCH
|
#endif // LIGATURES_PATCH
|
||||||
Atom xembed, wmdeletewin, netwmname, netwmiconname, netwmpid;
|
Atom xembed, wmdeletewin, netwmname, netwmiconname, netwmpid;
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
Atom XdndTypeList, XdndSelection, XdndEnter, XdndPosition, XdndStatus,
|
|
||||||
XdndLeave, XdndDrop, XdndFinished, XdndActionCopy, XdndActionMove,
|
|
||||||
XdndActionLink, XdndActionAsk, XdndActionPrivate, XtextUriList,
|
|
||||||
XtextPlain, XdndAware;
|
|
||||||
int64_t XdndSourceWin, XdndSourceVersion;
|
|
||||||
int32_t XdndSourceFormat;
|
|
||||||
#endif // DRAG_AND_DROP_PATCH
|
|
||||||
#if FULLSCREEN_PATCH
|
#if FULLSCREEN_PATCH
|
||||||
Atom netwmstate, netwmfullscreen;
|
Atom netwmstate, netwmfullscreen;
|
||||||
#endif // FULLSCREEN_PATCH
|
#endif // FULLSCREEN_PATCH
|
||||||
|
|
|
||||||
108
x.c
108
x.c
|
|
@ -603,13 +603,6 @@ selnotify(XEvent *e)
|
||||||
if (property == None)
|
if (property == None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
if (property == xw.XdndSelection) {
|
|
||||||
xdndsel(e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif // DRAG_AND_DROP_PATCH
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (XGetWindowProperty(xw.dpy, xw.win, property, ofs,
|
if (XGetWindowProperty(xw.dpy, xw.win, property, ofs,
|
||||||
BUFSIZ/4, False, AnyPropertyType,
|
BUFSIZ/4, False, AnyPropertyType,
|
||||||
|
|
@ -1164,7 +1157,7 @@ xhints(void)
|
||||||
sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize;
|
sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize;
|
||||||
sizeh->height = win.h;
|
sizeh->height = win.h;
|
||||||
sizeh->width = win.w;
|
sizeh->width = win.w;
|
||||||
#if ANYSIZE_PATCH && !DYNAMIC_PADDING_PATCH || ANYSIZE_SIMPLE_PATCH
|
#if ANYSIZE_PATCH || ANYSIZE_SIMPLE_PATCH
|
||||||
sizeh->height_inc = 1;
|
sizeh->height_inc = 1;
|
||||||
sizeh->width_inc = 1;
|
sizeh->width_inc = 1;
|
||||||
#else
|
#else
|
||||||
|
|
@ -1690,28 +1683,6 @@ xinit(int cols, int rows)
|
||||||
xw.netwmfullscreen = XInternAtom(xw.dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
xw.netwmfullscreen = XInternAtom(xw.dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
#endif // FULLSCREEN_PATCH
|
#endif // FULLSCREEN_PATCH
|
||||||
|
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
/* Xdnd setup */
|
|
||||||
xw.XdndTypeList = XInternAtom(xw.dpy, "XdndTypeList", 0);
|
|
||||||
xw.XdndSelection = XInternAtom(xw.dpy, "XdndSelection", 0);
|
|
||||||
xw.XdndEnter = XInternAtom(xw.dpy, "XdndEnter", 0);
|
|
||||||
xw.XdndPosition = XInternAtom(xw.dpy, "XdndPosition", 0);
|
|
||||||
xw.XdndStatus = XInternAtom(xw.dpy, "XdndStatus", 0);
|
|
||||||
xw.XdndLeave = XInternAtom(xw.dpy, "XdndLeave", 0);
|
|
||||||
xw.XdndDrop = XInternAtom(xw.dpy, "XdndDrop", 0);
|
|
||||||
xw.XdndFinished = XInternAtom(xw.dpy, "XdndFinished", 0);
|
|
||||||
xw.XdndActionCopy = XInternAtom(xw.dpy, "XdndActionCopy", 0);
|
|
||||||
xw.XdndActionMove = XInternAtom(xw.dpy, "XdndActionMove", 0);
|
|
||||||
xw.XdndActionLink = XInternAtom(xw.dpy, "XdndActionLink", 0);
|
|
||||||
xw.XdndActionAsk = XInternAtom(xw.dpy, "XdndActionAsk", 0);
|
|
||||||
xw.XdndActionPrivate = XInternAtom(xw.dpy, "XdndActionPrivate", 0);
|
|
||||||
xw.XtextUriList = XInternAtom((Display*) xw.dpy, "text/uri-list", 0);
|
|
||||||
xw.XtextPlain = XInternAtom((Display*) xw.dpy, "text/plain", 0);
|
|
||||||
xw.XdndAware = XInternAtom(xw.dpy, "XdndAware", 0);
|
|
||||||
XChangeProperty(xw.dpy, xw.win, xw.XdndAware, 4, 32, PropModeReplace,
|
|
||||||
&XdndVersion, 1);
|
|
||||||
#endif // DRAG_AND_DROP_PATCH
|
|
||||||
|
|
||||||
win.mode = MODE_NUMLOCK;
|
win.mode = MODE_NUMLOCK;
|
||||||
resettitle();
|
resettitle();
|
||||||
xhints();
|
xhints();
|
||||||
|
|
@ -2281,9 +2252,20 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
|
||||||
else
|
else
|
||||||
#endif // BACKGROUND_IMAGE_PATCH
|
#endif // BACKGROUND_IMAGE_PATCH
|
||||||
|
|
||||||
|
#if !WIDE_GLYPHS_PATCH
|
||||||
|
XftDrawRect(xw.draw, bg, winx, winy, width, win.ch);
|
||||||
|
#endif // WIDE_GLYPHS_PATCH
|
||||||
|
|
||||||
|
/* Set the clip region because Xft is sometimes dirty. */
|
||||||
|
r.x = 0;
|
||||||
|
r.y = 0;
|
||||||
|
r.height = win.ch;
|
||||||
|
r.width = width;
|
||||||
|
XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);
|
||||||
|
|
||||||
|
#if WIDE_GLYPHS_PATCH
|
||||||
/* Fill the background */
|
/* Fill the background */
|
||||||
XftDrawRect(xw.draw, bg, winx, winy, width, win.ch);
|
XftDrawRect(xw.draw, bg, winx, winy, width, win.ch);
|
||||||
#if WIDE_GLYPHS_PATCH
|
|
||||||
}
|
}
|
||||||
#endif // WIDE_GLYPHS_PATCH
|
#endif // WIDE_GLYPHS_PATCH
|
||||||
|
|
||||||
|
|
@ -2294,27 +2276,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
|
||||||
if (base.mode & ATTR_BOXDRAW) {
|
if (base.mode & ATTR_BOXDRAW) {
|
||||||
drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len);
|
drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len);
|
||||||
} else {
|
} else {
|
||||||
#endif // BOXDRAW_PATCH
|
|
||||||
/* Set the clip region because Xft is sometimes dirty. */
|
|
||||||
#if WIDE_GLYPHS_PATCH
|
|
||||||
r.x = 0;
|
|
||||||
r.y = 0;
|
|
||||||
r.height = win.ch;
|
|
||||||
r.width = win.w;
|
|
||||||
XftDrawSetClipRectangles(xw.draw, 0, winy, &r, 1);
|
|
||||||
#else
|
|
||||||
r.x = 0;
|
|
||||||
r.y = 0;
|
|
||||||
r.height = win.ch;
|
|
||||||
r.width = width;
|
|
||||||
XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);
|
|
||||||
#endif // WIDE_GLYPHS_PATCH
|
|
||||||
|
|
||||||
/* Render the glyphs. */
|
/* Render the glyphs. */
|
||||||
XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
|
XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
|
||||||
|
|
||||||
#if BOXDRAW_PATCH
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
/* Render the glyphs. */
|
||||||
|
XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
|
||||||
#endif // BOXDRAW_PATCH
|
#endif // BOXDRAW_PATCH
|
||||||
|
|
||||||
/* Render underline and strikethrough. */
|
/* Render underline and strikethrough. */
|
||||||
|
|
@ -2751,19 +2718,21 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
|
||||||
XRenderColor colbg;
|
XRenderColor colbg;
|
||||||
#endif // DYNAMIC_CURSOR_COLOR_PATCH
|
#endif // DYNAMIC_CURSOR_COLOR_PATCH
|
||||||
|
|
||||||
#if LIGATURES_PATCH
|
#if !DYNAMIC_CURSOR_COLOR_PATCH
|
||||||
/* Redraw the line where cursor was previously.
|
/* remove the old cursor */
|
||||||
* It will restore the ligatures broken by the cursor. */
|
|
||||||
xdrawline(line, 0, oy, len);
|
|
||||||
#else
|
|
||||||
/* Remove the old cursor */
|
|
||||||
if (selected(ox, oy))
|
if (selected(ox, oy))
|
||||||
#if SELECTION_COLORS_PATCH
|
#if SELECTION_COLORS_PATCH
|
||||||
og.mode |= ATTR_SELECTED;
|
og.mode |= ATTR_SELECTED;
|
||||||
#else
|
#else
|
||||||
og.mode ^= ATTR_REVERSE;
|
og.mode ^= ATTR_REVERSE;
|
||||||
#endif // SELECTION_COLORS_PATCH
|
#endif // SELECTION_COLORS_PATCH
|
||||||
|
#endif // DYNAMIC_CURSOR_COLOR_PATCH
|
||||||
|
|
||||||
|
#if LIGATURES_PATCH
|
||||||
|
/* Redraw the line where cursor was previously.
|
||||||
|
* It will restore the ligatures broken by the cursor. */
|
||||||
|
xdrawline(line, 0, oy, len);
|
||||||
|
#else
|
||||||
xdrawglyph(og, ox, oy);
|
xdrawglyph(og, ox, oy);
|
||||||
#endif // LIGATURES_PATCH
|
#endif // LIGATURES_PATCH
|
||||||
|
|
||||||
|
|
@ -2806,7 +2775,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
|
||||||
}
|
}
|
||||||
#endif // SELECTION_COLORS_PATCH
|
#endif // SELECTION_COLORS_PATCH
|
||||||
} else {
|
} else {
|
||||||
#if SELECTION_COLORS_PATCH && !DYNAMIC_CURSOR_COLOR_PATCH
|
#if SELECTION_COLORS_PATCH
|
||||||
g.fg = defaultbg;
|
g.fg = defaultbg;
|
||||||
g.bg = defaultcs;
|
g.bg = defaultcs;
|
||||||
drawcol = dc.col[defaultcs];
|
drawcol = dc.col[defaultcs];
|
||||||
|
|
@ -3744,21 +3713,6 @@ cmessage(XEvent *e)
|
||||||
} else if (e->xclient.data.l[0] == xw.wmdeletewin) {
|
} else if (e->xclient.data.l[0] == xw.wmdeletewin) {
|
||||||
ttyhangup();
|
ttyhangup();
|
||||||
exit(0);
|
exit(0);
|
||||||
#if DRAG_AND_DROP_PATCH
|
|
||||||
} else if (e->xclient.message_type == xw.XdndEnter) {
|
|
||||||
xw.XdndSourceWin = e->xclient.data.l[0];
|
|
||||||
xw.XdndSourceVersion = e->xclient.data.l[1] >> 24;
|
|
||||||
xw.XdndSourceFormat = None;
|
|
||||||
if (xw.XdndSourceVersion > 5)
|
|
||||||
return;
|
|
||||||
xdndenter(e);
|
|
||||||
} else if (e->xclient.message_type == xw.XdndPosition
|
|
||||||
&& xw.XdndSourceVersion <= 5) {
|
|
||||||
xdndpos(e);
|
|
||||||
} else if (e->xclient.message_type == xw.XdndDrop
|
|
||||||
&& xw.XdndSourceVersion <= 5) {
|
|
||||||
xdnddrop(e);
|
|
||||||
#endif // DRAG_AND_DROP_PATCH
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3855,12 +3809,8 @@ run(void)
|
||||||
|
|
||||||
xev = 0;
|
xev = 0;
|
||||||
while (XPending(xw.dpy)) {
|
while (XPending(xw.dpy)) {
|
||||||
XNextEvent(xw.dpy, &ev);
|
|
||||||
#if BLINKING_CURSOR_PATCH
|
|
||||||
xev = (!xev || xev == SelectionRequest) ? ev.type : xev;
|
|
||||||
#else
|
|
||||||
xev = 1;
|
xev = 1;
|
||||||
#endif // BLINKING_CURSOR_PATCH
|
XNextEvent(xw.dpy, &ev);
|
||||||
if (XFilterEvent(&ev, None))
|
if (XFilterEvent(&ev, None))
|
||||||
continue;
|
continue;
|
||||||
if (handler[ev.type])
|
if (handler[ev.type])
|
||||||
|
|
@ -3887,10 +3837,10 @@ run(void)
|
||||||
if (!drawing) {
|
if (!drawing) {
|
||||||
trigger = now;
|
trigger = now;
|
||||||
#if BLINKING_CURSOR_PATCH
|
#if BLINKING_CURSOR_PATCH
|
||||||
if (xev != SelectionRequest) {
|
if (IS_SET(MODE_BLINK)) {
|
||||||
win.mode &= ~MODE_BLINK;
|
win.mode ^= MODE_BLINK;
|
||||||
lastblink = now;
|
|
||||||
}
|
}
|
||||||
|
lastblink = now;
|
||||||
#endif // BLINKING_CURSOR_PATCH
|
#endif // BLINKING_CURSOR_PATCH
|
||||||
drawing = 1;
|
drawing = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue