X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=dwm.c;h=3f896dcbf0d0a2be030bb44eeab2b632f683ffa9;hb=e237b2a76fb3dac1f43b91e5c7b6adb9ef04c9ed;hp=0894c651c9b36615e0e858df585b132df40d9f1f;hpb=831428b00cf0bb6c7830c2178c8d13213f29b2db;p=dwm.git diff --git a/dwm.c b/dwm.c index 0894c65..3f896dc 100644 --- a/dwm.c +++ b/dwm.c @@ -96,11 +96,12 @@ typedef struct { const char *symbol; void (*arrange)(void); Bool isfloating; -} Layout; /* TODO: layout should keep an auxilliary pointer to its Geometry, - instead of having all those layout specific vars globally */ +} Layout; typedef struct { - const char *prop; + const char *class; + const char *instance; + const char *title; const char *tag; Bool isfloating; } Rule; @@ -162,7 +163,7 @@ void restack(void); void run(void); void scan(void); void setclientstate(Client *c, long state); -void setdefaultgeoms(void); +void setdefgeoms(void); void setlayout(const char *arg); void setup(void); void spawn(const char *arg); @@ -225,7 +226,6 @@ Display *dpy; DC dc = {0}; Layout *lt = NULL; Window root, barwin; -void (*setgeoms)(void) = setdefaultgeoms; /* configuration, allows nested code to access above variables */ #include "config.h" @@ -245,9 +245,9 @@ applyrules(Client *c) { XGetClassHint(dpy, c->win, &ch); for(i = 0; i < LENGTH(rules); i++) { r = &rules[i]; - if(strstr(c->name, r->prop) - || (ch.res_class && strstr(ch.res_class, r->prop)) - || (ch.res_name && strstr(ch.res_name, r->prop))) + if(strstr(c->name, r->title) + || (ch.res_class && r->class && strstr(ch.res_class, r->class)) + || (ch.res_name && r->instance && strstr(ch.res_name, r->instance))) { c->isfloating = r->isfloating; if(r->tag) { @@ -1052,7 +1052,7 @@ maprequest(XEvent *e) { } void -monocle(void) { +monocle(void) { Client *c; for(c = clients; c; c = c->next) @@ -1391,7 +1391,7 @@ setclientstate(Client *c, long state) { } void -setdefaultgeoms(void) { +setdefgeoms(void) { /* screen dimensions */ sx = 0;