diff -up st-0.1.1/st.c st-0.1.1-xembed/st.c
--- st-0.1.1/st.c	2011-04-03 12:04:45.000000000 -0700
+++ st-0.1.1-xembed/st.c	2011-06-08 11:21:00.137190577 -0700
@@ -251,6 +251,7 @@ static pid_t pid;
 static Selection sel;
 static char **opt_cmd  = NULL;
 static char *opt_title = NULL;
+static char *opt_embed = NULL;
 static char *opt_class = NULL;
 
 int
@@ -1539,7 +1540,7 @@ xinit(void) {
 		| PointerMotionMask | ButtonPressMask | ButtonReleaseMask;
 	attrs.colormap = xw.cmap;
 
-	xw.win = XCreateWindow(xw.dpy, XRootWindow(xw.dpy, xw.scr), 0, 0,
+	xw.win = XCreateWindow(xw.dpy, opt_embed?strtol(opt_embed, NULL, 0):XRootWindow(xw.dpy, xw.scr), 0, 0,
 			xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
 			XDefaultVisual(xw.dpy, xw.scr),
 			CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
@@ -1866,6 +1867,9 @@ main(int argc, char *argv[]) {
 		case 'e':
 			if(++i < argc) opt_cmd = &argv[i];
 			break;
+		case 'w':
+			if(++i < argc) opt_embed = argv[i];
+			break;
 		case 'v':
 		default:
 			die(USAGE);
