Attached is an updated version of the patch which removes some
debugging nonsense and fixes a minor error.
--
Samuel Baldwin - logik.li
diff -up tabbed-0.2/config.def.h tabbed-0.2-modified/config.def.h
--- tabbed-0.2/config.def.h 2009-10-30 08:41:29.000000000 -0400
+++ tabbed-0.2-modified/config.def.h 2010-04-15 23:13:55.000000000 -0400
@@ -24,4 +24,7 @@ static Key keys[] = { \
{ MODKEY, XK_9, move, { .i = 8 } },
{ MODKEY, XK_0, move, { .i = 9 } },
{ MODKEY, XK_q, killclient, { 0 } },
+ { MODKEY|Mod1Mask, XK_l, list, { .v = (char
*[]){ \
+ "prop=\"`dmenu -l`\" && xprop -id %s -f TABBED_LIST 8s -set
TABBED_LIST \"$prop\"", \
+ winid, NULL } } },
};
diff -up tabbed-0.2/tabbed.c tabbed-0.2-modified/tabbed.c
--- tabbed-0.2/tabbed.c 2009-10-30 08:41:29.000000000 -0400
+++ tabbed-0.2-modified/tabbed.c 2010-04-16 16:58:18.000000000 -0400
@@ -110,6 +110,7 @@ static void initfont(const char *fontstr
static Bool isprotodel(Client *c);
static void keypress(const XEvent *e);
static void killclient(const Arg *arg);
+static void list(const Arg *arg);
static void manage(Window win);
static void maprequest(const XEvent *e);
static void move(const Arg *arg);
@@ -554,6 +555,20 @@ killclient(const Arg *arg) {
}
void
+list(const Arg *arg) {
+ FILE *l;
+ Client *c;
+ static char cmd[264];
+
+ snprintf(cmd, LENGTH(cmd), ((char **)arg->v)[0], ((char **)arg->v)[1]);
+ l = popen(cmd, "w");
+ for(c = clients; c; c = c->next)
+ if (c)
+ fprintf(l, "%s\n", c->name);
+ pclose(l);
+}
+
+void
manage(Window w) {
updatenumlockmask();
{
@@ -619,10 +634,19 @@ void
propertynotify(const XEvent *e) {
const XPropertyEvent *ev = &e->xproperty;
Client *c;
+ static char buf[256];
+ Atom listprop = XInternAtom(dpy, "TABBED_LIST", False);
if(ev->state != PropertyDelete && ev->atom == XA_WM_NAME
&& (c = getclient(ev->window))) {
updatetitle(c);
+ } else if(ev->state != PropertyDelete && ev->atom == listprop) {
+ gettextprop(win, listprop, buf, sizeof buf);
+
+ for(c = clients; c; c = c->next) {
+ if(!strncmp(buf, c->name, 10))
+ focus(c);
+ }
}
}
@@ -724,7 +748,7 @@ setup(void) {
XMapRaised(dpy, win);
XSelectInput(dpy, win, SubstructureNotifyMask|FocusChangeMask|
ButtonPressMask|ExposureMask|KeyPressMask|
- StructureNotifyMask|SubstructureRedirectMask);
+
StructureNotifyMask|SubstructureRedirectMask|PropertyChangeMask);
xerrorxlib = XSetErrorHandler(xerror);
XClassHint class_hint;
class_hint.res_name = "tabbed";