diff --git a/dwm/dwm b/dwm/dwm index 6b05764..12642fb 100755 Binary files a/dwm/dwm and b/dwm/dwm differ diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..dbb7375 --- /dev/null +++ b/install.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +set -eo pipefail + +cd dwm && make && doas make install && cd .. +cd st && make && doas make install && cd .. +cd slstatus && make && doas make install && cd .. diff --git a/slstatus/slstatus b/slstatus/slstatus index 7abb01c..97466f3 100755 Binary files a/slstatus/slstatus and b/slstatus/slstatus differ diff --git a/st/config.def.h b/st/config.def.h index 91ab8ca..2cd740a 100644 --- a/st/config.def.h +++ b/st/config.def.h @@ -53,7 +53,7 @@ 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 = 8; +static double minlatency = 2; static double maxlatency = 33; /* diff --git a/st/config.h b/st/config.h index 1aa9188..71b64f6 100644 --- a/st/config.h +++ b/st/config.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "GoMono Nerd Font:size=11"; +static char *font = "Go Mono:size=11"; static int borderpx = 2; /* diff --git a/st/config.mk b/st/config.mk index 9f1c45e..e8e71cf 100644 --- a/st/config.mk +++ b/st/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.9 +VERSION = 0.9.3 # Customize below to fit your system diff --git a/st/st b/st/st new file mode 100755 index 0000000..f6928f9 Binary files /dev/null and b/st/st differ diff --git a/st/st.c b/st/st.c index d6478f5..8e57991 100644 --- a/st/st.c +++ b/st/st.c @@ -1132,6 +1132,7 @@ csiparse(void) { char *p = csiescseq.buf, *np; long int v; + int sep = ';'; /* colon or semi-colon, but not both */ csiescseq.narg = 0; if (*p == '?') { @@ -1149,7 +1150,9 @@ csiparse(void) v = -1; csiescseq.arg[csiescseq.narg++] = v; p = np; - if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ) + if (sep == ';' && *p == ':') + sep = ':'; /* allow override to colon once */ + if (*p != sep || csiescseq.narg == ESC_ARG_SIZ) break; p++; } @@ -1417,16 +1420,22 @@ tsetattr(const int *attr, int l) if ((idx = tdefcolor(attr, &i, l)) >= 0) term.c.attr.fg = idx; break; - case 39: + case 39: /* set foreground color to default */ term.c.attr.fg = defaultfg; break; case 48: if ((idx = tdefcolor(attr, &i, l)) >= 0) term.c.attr.bg = idx; break; - case 49: + case 49: /* set background color to default */ term.c.attr.bg = defaultbg; break; + case 58: + /* This starts a sequence to change the color of + * "underline" pixels. We don't support that and + * instead eat up a following "5;n" or "2;r;g;b". */ + tdefcolor(attr, &i, l); + break; default: if (BETWEEN(attr[i], 30, 37)) { term.c.attr.fg = attr[i] - 30; @@ -1523,7 +1532,7 @@ tsetmode(int priv, int set, const int *args, int narg) case 1006: /* 1006: extended reporting mode */ xsetmode(set, MODE_MOUSESGR); break; - case 1034: + case 1034: /* 1034: enable 8-bit mode for keyboard input */ xsetmode(set, MODE_8BIT); break; case 1049: /* swap screen & set/restore cursor as xterm */ @@ -1531,8 +1540,8 @@ tsetmode(int priv, int set, const int *args, int narg) break; tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); /* FALLTHROUGH */ - case 47: /* swap screen */ - case 1047: + case 47: /* swap screen buffer */ + case 1047: /* swap screen buffer */ if (!allowaltscreen) break; alt = IS_SET(MODE_ALTSCREEN); @@ -1545,7 +1554,7 @@ tsetmode(int priv, int set, const int *args, int narg) if (*args != 1049) break; /* FALLTHROUGH */ - case 1048: + case 1048: /* save/restore cursor (like DECSC/DECRC) */ tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); break; case 2004: /* 2004: bracketed paste mode */ @@ -1643,7 +1652,7 @@ csihandle(void) ttywrite(vtiden, strlen(vtiden), 0); break; case 'b': /* REP -- if last char is printable print it more times */ - DEFAULT(csiescseq.arg[0], 1); + LIMIT(csiescseq.arg[0], 1, 65535); if (term.lastc) while (csiescseq.arg[0]-- > 0) tputc(term.lastc); @@ -1702,7 +1711,7 @@ csihandle(void) } break; case 1: /* above */ - if (term.c.y > 1) + if (term.c.y > 0) tclearregion(0, 0, term.col-1, term.c.y-1); tclearregion(0, term.c.y, term.c.x, term.c.y); break; @@ -1728,6 +1737,7 @@ csihandle(void) } break; case 'S': /* SU -- Scroll line up */ + if (csiescseq.priv) break; DEFAULT(csiescseq.arg[0], 1); tscrollup(term.top, csiescseq.arg[0]); break; @@ -1797,7 +1807,11 @@ csihandle(void) tcursor(CURSOR_SAVE); break; case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */ - tcursor(CURSOR_LOAD); + if (csiescseq.priv) { + goto unknown; + } else { + tcursor(CURSOR_LOAD); + } break; case ' ': switch (csiescseq.mode[1]) { @@ -1899,7 +1913,7 @@ strhandle(void) if (narg > 1) xsettitle(strescseq.args[1]); return; - case 52: + case 52: /* manipulate selection data */ if (narg > 2 && allowwindowops) { dec = base64dec(strescseq.args[2]); if (dec) { @@ -1910,9 +1924,9 @@ strhandle(void) } } return; - case 10: - case 11: - case 12: + case 10: /* set dynamic VT100 text foreground color */ + case 11: /* set dynamic VT100 text background color */ + case 12: /* set dynamic text cursor color */ if (narg < 2) break; p = strescseq.args[1]; @@ -1953,6 +1967,19 @@ strhandle(void) tfulldirt(); } return; + case 110: /* reset dynamic VT100 text foreground color */ + case 111: /* reset dynamic VT100 text background color */ + case 112: /* reset dynamic text cursor color */ + if (narg != 1) + break; + if ((j = par - 110) < 0 || j >= LEN(osc_table)) + break; /* shouldn't be possible */ + if (xsetcolorname(osc_table[j].idx, NULL)) { + fprintf(stderr, "erresc: %s color not found\n", osc_table[j].str); + } else { + tfulldirt(); + } + return; } break; case 'k': /* old title set compatibility */ diff --git a/st/x.c b/st/x.c index b36fb8c..d73152b 100644 --- a/st/x.c +++ b/st/x.c @@ -1131,7 +1131,7 @@ xinit(int cols, int rows) { XGCValues gcvalues; Cursor cursor; - Window parent; + Window parent, root; pid_t thispid = getpid(); XColor xmousefg, xmousebg; @@ -1168,16 +1168,19 @@ xinit(int cols, int rows) | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; xw.attrs.colormap = xw.cmap; + root = XRootWindow(xw.dpy, xw.scr); if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) - parent = XRootWindow(xw.dpy, xw.scr); - xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, + parent = root; + xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t, win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask | CWColormap, &xw.attrs); + if (parent != root) + XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t); memset(&gcvalues, 0, sizeof(gcvalues)); gcvalues.graphics_exposures = False; - dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, + dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures, &gcvalues); xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, DefaultDepth(xw.dpy, xw.scr)); @@ -1617,6 +1620,9 @@ xseticontitle(char *p) XTextProperty prop; DEFAULT(p, opt_title); + if (p[0] == '\0') + p = opt_title; + if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, &prop) != Success) return; @@ -1631,6 +1637,9 @@ xsettitle(char *p) XTextProperty prop; DEFAULT(p, opt_title); + if (p[0] == '\0') + p = opt_title; + if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, &prop) != Success) return;