Updated to latest git version and patches

This commit is contained in:
David Thurstenson 2017-06-09 10:32:40 -05:00
parent 01bba932c3
commit 907fad0672
4 changed files with 147 additions and 133 deletions

View File

@ -2,8 +2,8 @@
pkgname=st-tl pkgname=st-tl
_pkgname=st _pkgname=st
pkgver=0.7.r17.gc63a87c pkgver=0.7.r26.gb331da5
pkgrel=3 pkgrel=1
pkgdesc='A simple virtual terminal emulator for X.' pkgdesc='A simple virtual terminal emulator for X.'
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
license=('MIT') license=('MIT')
@ -11,14 +11,14 @@ depends=('libxft' 'libxext' 'xorg-fonts-misc' 'dmenu' 'xurls')
makedepends=('ncurses') makedepends=('ncurses')
conflicts=('st') conflicts=('st')
url="http://st.suckless.org" url="http://st.suckless.org"
source=('git://git.suckless.org/st#commit=c63a87cd936c1eeef14c4c21572e5b782d3df4bc' source=('git://git.suckless.org/st#commit=b331da550b290d54592b7ba11242c92f5a303a48'
tl-config.diff tl-config.diff
st-externalpipe.diff st-externalpipe.diff
st-hidecursor.diff) st-hidecursor.diff)
md5sums=('SKIP' md5sums=('SKIP'
'0a61cd23b891bce98c56cf97eafb24f7' '4d1089c3845767e52f1bd79f0022acb0'
'c54c87489342b8d77c6dd8f3c2ff997e' 'a75266ee959386a4b50e0ad7d1c41580'
'8ff8a77b34dfc09a4dd0d2cf876d68e7') '487dc42b84ea464474aac527c2b47191')
pkgver() { pkgver() {
cd "$_pkgname" cd "$_pkgname"

View File

@ -1,70 +1,67 @@
diff --git a/st.c b/st.c diff --git a/st.c b/st.c
index d6fe58a..1595e59 100644 index 8d4a9f2..3b05f0b 100644
--- a/st.c --- a/st.c
+++ b/st.c +++ b/st.c
@@ -344,6 +344,7 @@ static void printscreen(const Arg *) ; @@ -138,6 +138,7 @@ static void printscreen(const Arg *) ;
static void iso14755(const Arg *); static void iso14755(const Arg *);
static void toggleprinter(const Arg *); static void toggleprinter(const Arg *);
static void sendbreak(const Arg *); static void sendbreak(const Arg *);
+static void externalpipe(const Arg *); +static void externalpipe(const Arg *);
/* Config.h for applying patches and the configuration. */ /* config.h for applying patches and the configuration. */
#include "config.h" #include "config.h"
@@ -2996,6 +2997,62 @@ eschandle(uchar ascii) @@ -2344,6 +2345,59 @@ eschandle(uchar ascii)
} }
void void
+externalpipe(const Arg *arg) +externalpipe(const Arg *arg)
+{ +{
+ int to[2]; /* 0 = read, 1 = write */ + int to[2];
+ pid_t child;
+ int n;
+ void (*oldsigpipe)(int);
+ char buf[UTF_SIZ]; + char buf[UTF_SIZ];
+ void (*oldsigpipe)(int);
+ Glyph *bp, *end; + Glyph *bp, *end;
+ int lastpos, n, newline;
+ +
+ if(pipe(to) == -1) + if (pipe(to) == -1)
+ return; + return;
+ +
+ /* sigchld() handles this */ + switch (fork()) {
+ switch(child = fork()){ + case -1:
+ case -1: + close(to[0]);
+ close(to[0]), close(to[1]); + close(to[1]);
+ return; + return;
+ case 0: + case 0:
+ /* child */ + dup2(to[0], STDIN_FILENO);
+ close(to[1]); + close(to[0]);
+ dup2(to[0], STDIN_FILENO); /* 0<&to */ + close(to[1]);
+ close(to[0]); + execvp(((char **)arg->v)[0], (char **)arg->v);
+ execvp( + fprintf(stderr, "st: execvp %s ", ((char **)arg->v)[0]);
+ "sh", + perror("failed");
+ (char *const []){ + exit(0);
+ "/bin/sh",
+ "-c",
+ (char *)arg->v,
+ 0
+ });
+ exit(127);
+ } + }
+ +
+ /* parent */
+ close(to[0]); + close(to[0]);
+ /* ignore sigpipe for now, in case child exits early */ + /* ignore sigpipe for now, in case child exits early */
+ oldsigpipe = signal(SIGPIPE, SIG_IGN); + oldsigpipe = signal(SIGPIPE, SIG_IGN);
+ + newline = 0;
+ for(n = 0; n < term.row; n++){ + for (n = 0; n < term.row; n++) {
+ bp = &term.line[n][0]; + bp = term.line[n];
+ end = &bp[MIN(tlinelen(n), term.col) - 1]; + lastpos = MIN(tlinelen(n) + 1, term.col) - 1;
+ if(bp != end || bp->u != ' ') + if (lastpos < 0)
+ for(; bp <= end; ++bp)
+ if(xwrite(to[1], buf, utf8encode(bp->u, buf)) < 0)
+ break;
+ if(xwrite(to[1], "\n", 1) < 0)
+ break; + break;
+ end = &bp[lastpos + 1];
+ for (; bp < end; ++bp)
+ if (xwrite(to[1], buf, utf8encode(bp->u, buf)) < 0)
+ break;
+ if (newline = term.line[n][lastpos].mode & ATTR_WRAP)
+ continue;
+ if (xwrite(to[1], "\n", 1) < 0)
+ break;
+ newline = 0;
+ } + }
+ + if (newline)
+ (void)xwrite(to[1], "\n", 1);
+ close(to[1]); + close(to[1]);
+
+ /* restore */ + /* restore */
+ signal(SIGPIPE, oldsigpipe); + signal(SIGPIPE, oldsigpipe);
+} +}
@ -73,3 +70,33 @@ index d6fe58a..1595e59 100644
tputc(Rune u) tputc(Rune u)
{ {
char c[UTF_SIZ]; char c[UTF_SIZ];
diff --git a/win.h b/win.h
index 428111c..a012a24 100644
--- a/win.h
+++ b/win.h
@@ -28,3 +28,5 @@ void xresize(int, int);
void xselpaste(void);
unsigned long xwinid(void);
void xsetsel(char *, Time);
+
+extern char winid[64];
diff --git a/x.c b/x.c
index fbfd350..ff052e6 100644
--- a/x.c
+++ b/x.c
@@ -139,6 +139,7 @@ static void (*handler[LASTEvent])(XEvent *) = {
static DC dc;
static XWindow xw;
static XSelection xsel;
+char winid[64];
/* Font Ring Cache */
enum {
@@ -915,6 +916,7 @@ xinit(void)
win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
| CWEventMask | CWColormap, &xw.attrs);
+ snprintf(winid, LEN(winid), "%lu", (unsigned long)xw.win);
memset(&gcvalues, 0, sizeof(gcvalues));
gcvalues.graphics_exposures = False;

View File

@ -1,8 +1,8 @@
diff --git a/st.c b/st.c diff --git a/x.c b/x.c
index 2594c65..2a031f0 100644 index fbfd350..2f72214 100644
--- a/st.c --- a/x.c
+++ b/st.c +++ b/x.c
@@ -260,6 +260,11 @@ typedef struct { @@ -47,6 +47,11 @@ typedef struct {
Draw draw; Draw draw;
Visual *vis; Visual *vis;
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
@ -14,21 +14,21 @@ index 2594c65..2a031f0 100644
int scr; int scr;
int isfixed; /* is fixed geometry? */ int isfixed; /* is fixed geometry? */
int l, t; /* left and top offset */ int l, t; /* left and top offset */
@@ -1291,6 +1296,13 @@ bmotion(XEvent *e) @@ -535,6 +540,13 @@ bmotion(XEvent *e)
{ {
int oldey, oldex, oldsby, oldsey; int oldey, oldex, oldsby, oldsey;
+ if(!xw.pointerisvisible) { + if (!xw.pointerisvisible) {
+ XDefineCursor(xw.dpy, xw.win, xw.vpointer); + XDefineCursor(xw.dpy, xw.win, xw.vpointer);
+ xw.pointerisvisible = 1; + xw.pointerisvisible = 1;
+ if(!IS_SET(MODE_MOUSEMANY)) + if (!IS_SET(MODE_MOUSEMANY))
+ xsetpointermotion(0); + xsetpointermotion(0);
+ } + }
+ +
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
mousereport(e); mousereport(e);
return; return;
@@ -3435,10 +3447,10 @@ void @@ -871,10 +883,10 @@ void
xinit(void) xinit(void)
{ {
XGCValues gcvalues; XGCValues gcvalues;
@ -40,7 +40,7 @@ index 2594c65..2a031f0 100644
if (!(xw.dpy = XOpenDisplay(NULL))) if (!(xw.dpy = XOpenDisplay(NULL)))
die("Can't open display\n"); die("Can't open display\n");
@@ -3511,8 +3523,9 @@ xinit(void) @@ -947,8 +959,9 @@ xinit(void)
die("XCreateIC failed. Could not obtain input method.\n"); die("XCreateIC failed. Could not obtain input method.\n");
/* white cursor, black outline */ /* white cursor, black outline */
@ -52,7 +52,7 @@ index 2594c65..2a031f0 100644
if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
xmousefg.red = 0xffff; xmousefg.red = 0xffff;
@@ -3526,7 +3539,10 @@ xinit(void) @@ -962,7 +975,10 @@ xinit(void)
xmousebg.blue = 0x0000; xmousebg.blue = 0x0000;
} }
@ -64,20 +64,20 @@ index 2594c65..2a031f0 100644
xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
@@ -4026,6 +4042,8 @@ unmap(XEvent *ev) @@ -1462,6 +1478,8 @@ unmap(XEvent *ev)
void void
xsetpointermotion(int set) xsetpointermotion(int set)
{ {
+ if(!set && !xw.pointerisvisible) + if (!set && !xw.pointerisvisible)
+ return; + return;
MODBIT(xw.attrs.event_mask, set, PointerMotionMask); MODBIT(xw.attrs.event_mask, set, PointerMotionMask);
XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs);
} }
@@ -4125,6 +4143,12 @@ kpress(XEvent *ev) @@ -1521,6 +1539,12 @@ kpress(XEvent *ev)
Status status; Status status;
Shortcut *bp; Shortcut *bp;
+ if(xw.pointerisvisible) { + if (xw.pointerisvisible) {
+ XDefineCursor(xw.dpy, xw.win, xw.bpointer); + XDefineCursor(xw.dpy, xw.win, xw.bpointer);
+ xsetpointermotion(1); + xsetpointermotion(1);
+ xw.pointerisvisible = 0; + xw.pointerisvisible = 0;

View File

@ -1,12 +1,12 @@
--- a/config.h 2017-03-16 15:22:46.638368708 -0500 --- a/config.h 2017-06-09 09:57:08.991613650 -0500
+++ b/config.h 2017-03-16 15:31:48.438413697 -0500 +++ b/config.h 2017-06-09 10:30:35.471854916 -0500
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
* *
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/ */
-static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; -char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
+static char font[] = "Monospace:size=11.5:antialias=true:autohint=true"; +char font[] = "Monospace:size=11.5:antialias=true:autohint=true";
static int borderpx = 2; int borderpx = 2;
/* /*
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
@ -17,14 +17,10 @@
+static int bellvolume = 50; +static int bellvolume = 50;
/* default TERM value */ /* default TERM value */
static char termname[] = "st-256color"; char termname[] = "st-256color";
@@ -82,33 +82,32 @@ @@ -85,30 +85,29 @@
*/
static unsigned int tabspaces = 8;
+/*TERMINAL.SEXY START*/
/* Terminal colors (16 first used in escape sequence) */ /* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = { const char *colorname[] = {
/* 8 normal colors */ /* 8 normal colors */
- "black", - "black",
- "red3", - "red3",
@ -34,14 +30,15 @@
- "magenta3", - "magenta3",
- "cyan3", - "cyan3",
- "gray90", - "gray90",
+ [0] = "#1c1c1c", /* black */ + [0] = "#1c1c1c", /* black */
+ [1] = "#b40f0f", /* red */ + [1] = "#b40f0f", /* red */
+ [2] = "#12981b", /* green */ + [2] = "#12981b", /* green */
+ [3] = "#faff00", /* yellow */ + [3] = "#faff00", /* yellow */
+ [4] = "#048ac7", /* blue */ + [4] = "#048ac7", /* blue */
+ [5] = "#833c9f", /* magenta */ + [5] = "#833c9f", /* magenta */
+ [6] = "#0ac1cd", /* cyan */ + [6] = "#0ac1cd", /* cyan */
+ [7] = "#e5e5e5", /* white */ + [7] = "#e5e5e5", /* white */
+
/* 8 bright colors */ /* 8 bright colors */
- "gray50", - "gray50",
@ -58,70 +55,60 @@
- /* more colors can be added after 255 to use with DefaultXX */ - /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc", - "#cccccc",
- "#555555", - "#555555",
+ [8] = "#666666", /* black */ + [8] = "#666666", /* black */
+ [9] = "#e31313", /* red */ + [9] = "#e31313", /* red */
+ [10] = "#1ce129", /* green */ + [10] = "#1ce129", /* green */
+ [11] = "#fbff3f", /* yellow */ + [11] = "#fbff3f", /* yellow */
+ [12] = "#48c6ff", /* blue */ + [12] = "#48c6ff", /* blue */
+ [13] = "#be67e1", /* magenta */ + [13] = "#be67e1", /* magenta */
+ [14] = "#63e7f0", /* cyan */ + [14] = "#63e7f0", /* cyan */
+ [15] = "#f3f3f3", /* white */ + [15] = "#f3f3f3", /* white */
+ +
+ /* special colors */ + /* special colors */
+ [256] = "#131313", /* background */ + [256] = "#131313", /* background */
+ [257] = "#dddddd", /* foreground */ + [257] = "#dddddd", /* foreground */
}; };
@@ -116,10 +115,10 @@ @@ -116,10 +115,11 @@
* Default colors (colorname index) * Default colors (colorname index)
* foreground, background, cursor, reverse cursor * foreground, background, cursor, reverse cursor
*/ */
-static unsigned int defaultfg = 7; -unsigned int defaultfg = 7;
-static unsigned int defaultbg = 0; -unsigned int defaultbg = 0;
-static unsigned int defaultcs = 256; -unsigned int defaultcs = 256;
-static unsigned int defaultrcs = 257; -unsigned int defaultrcs = 257;
+static unsigned int defaultfg = 257; +unsigned int defaultfg = 257;
+static unsigned int defaultbg = 256; +unsigned int defaultbg = 256;
+static unsigned int defaultcs = 257; +unsigned int defaultcs = 257;
+static unsigned int defaultrcs = 256; +unsigned int defaultrcs = 256;
+
/* /*
* Default shape of cursor * Default shape of cursor
@@ -164,20 +163,22 @@ @@ -164,6 +164,14 @@
#define MODKEY Mod1Mask #define MODKEY Mod1Mask
#define TERMMOD (ControlMask|ShiftMask)
static Shortcut shortcuts[] = { +static char *openurlcmd[] = { "/bin/sh", "-c",
- /* mask keysym function argument */ + "xurls | tac | dmenu -l 10 -w $1 | xargs -r open",
- { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, + "externalpipe", winid, NULL };
- { ControlMask, XK_Print, toggleprinter, {.i = 0} }, +
- { ShiftMask, XK_Print, printscreen, {.i = 0} }, +static char *copyurlcmd[] = { "/bin/sh", "-c",
- { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, + "xurls | tac | dmenu -l 10 -w $1 -p 'Copy URL:' | xsel -ib",
- { MODKEY|ShiftMask, XK_Prior, xzoom, {.f = +1} }, + "externalpipe", winid, NULL };
- { MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} }, +
- { MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} }, Shortcut shortcuts[] = {
- { ShiftMask, XK_Insert, selpaste, {.i = 0} }, /* mask keysym function argument */
- { MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} }, { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
- { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, @@ -178,6 +186,10 @@
- { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
- { MODKEY, XK_Control_L, iso14755, {.i = 0} }, { TERMMOD, XK_I, iso14755, {.i = 0} },
+ /* mask keysym function argument */ + { TERMMOD, XK_X, externalpipe, {.v = openurlcmd } },
+ { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, + { TERMMOD, XK_Z, externalpipe, {.v = copyurlcmd} },
+ { ControlMask, XK_Print, toggleprinter, {.i = 0} }, + { TERMMOD, XK_U, iso14755, {.i = 0} },
+ { ShiftMask, XK_Print, printscreen, {.i = 0} }, +
+ { XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
+ { MODKEY|ShiftMask, XK_Prior, xzoom, {.f = +1} },
+ { MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} },
+ { MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} },
+ { ShiftMask, XK_Insert, selpaste, {.i = 0} },
+ { MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} },
+ { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} },
+ { ControlMask|ShiftMask, XK_V, clippaste, {.i = 0} },
+ { MODKEY, XK_Num_Lock, numlock, {.i = 0} },
+ { ControlMask|ShiftMask, XK_X, externalpipe, {.v = "xurls | tac | dmenu -l 10 | xargs -r chromium" } },
+ { ControlMask|ShiftMask, XK_Z, externalpipe, {.v = "xurls | tac | dmenu -l 10 -p 'Copy URL:' | xsel -ib" } },
+ { ControlMask|ShiftMask, XK_U, iso14755, {.i = 0} },
}; };
/* /*