commit - fb32d01a183979b3235740aaea555bfe94759dab
commit + 4259a3ba3a99da4bc551c9cde6868366fb2c01fa
blob - 69cfe86810e448a194a7700d83e0070722e93aed
blob + b6c119fff01de007b4d1bf2a3c7245f35d960932
--- st.1
+++ st.1
.IR class ]
.RB [ \-t
.IR title ]
+.RB [ \-w
+.IR windowid ]
.RB [ \-v ]
.RB [ \-e
.IR command ...]
.BI \-c " class"
defines the window class (default $TERM).
.TP
+.BI \-w " windowid"
+embeds st within the window identified by
+.I windowid
+.TP
.B \-v
prints version information to stderr, then exits.
.TP
blob - 6ba5c4c6b0308b50378515d2a7aa65386848a7ee
blob + b331eadebdeb2208ae77916cc2ece6a4291a07a4
--- st.c
+++ st.c
#define USAGE \
"st-" VERSION ", (c) 2010-2011 st engineers\n" \
- "usage: st [-t title] [-c class] [-v] [-e command...]\n"
+ "usage: st [-t title] [-c class] [-w windowid] [-v] [-e command...]\n"
/* Arbitrary sizes */
#define ESC_TITLE_SIZ 256
static Selection sel;
static char **opt_cmd = NULL;
static char *opt_title = NULL;
+static char *opt_embed = NULL;
static char *opt_class = NULL;
int
xinit(void) {
XSetWindowAttributes attrs;
Cursor cursor;
+ Window parent;
if(!(xw.dpy = XOpenDisplay(NULL)))
die("Can't open display\n");
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
attrs.colormap = xw.cmap;
- xw.win = XCreateWindow(xw.dpy, XRootWindow(xw.dpy, xw.scr), 0, 0,
+ parent = opt_embed ? strtol(opt_embed, NULL, 0) : XRootWindow(xw.dpy, xw.scr);
+ xw.win = XCreateWindow(xw.dpy, parent, 0, 0,
xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
XDefaultVisual(xw.dpy, xw.scr),
CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
case 'c':
if(++i < argc) opt_class = argv[i];
break;
+ case 'w':
+ if(++i < argc) opt_embed = argv[i];
+ break;
case 'e':
/* eat every remaining arguments */
if(++i < argc) opt_cmd = &argv[i];