|
|
@ -19,7 +19,7 @@ Layout *lt = NULL; |
|
|
|
typedef struct { |
|
|
|
typedef struct { |
|
|
|
const char *prop; |
|
|
|
const char *prop; |
|
|
|
const char *tags; |
|
|
|
const char *tags; |
|
|
|
Bool swimming; |
|
|
|
Bool versatile; |
|
|
|
} Rule; |
|
|
|
} Rule; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
typedef struct { |
|
|
@ -52,7 +52,7 @@ tile(void) { |
|
|
|
if(c->isbanned) |
|
|
|
if(c->isbanned) |
|
|
|
XMoveWindow(dpy, c->win, c->x, c->y); |
|
|
|
XMoveWindow(dpy, c->win, c->x, c->y); |
|
|
|
c->isbanned = False; |
|
|
|
c->isbanned = False; |
|
|
|
if(c->swimming) |
|
|
|
if(c->versatile) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
c->ismax = False; |
|
|
|
c->ismax = False; |
|
|
|
nx = wax; |
|
|
|
nx = wax; |
|
|
@ -175,10 +175,10 @@ restack(void) { |
|
|
|
drawstatus(); |
|
|
|
drawstatus(); |
|
|
|
if(!sel) |
|
|
|
if(!sel) |
|
|
|
return; |
|
|
|
return; |
|
|
|
if(sel->swimming || lt->arrange == swim) |
|
|
|
if(sel->versatile || lt->arrange == versatile) |
|
|
|
XRaiseWindow(dpy, sel->win); |
|
|
|
XRaiseWindow(dpy, sel->win); |
|
|
|
if(lt->arrange != swim) { |
|
|
|
if(lt->arrange != versatile) { |
|
|
|
if(!sel->swimming) |
|
|
|
if(!sel->versatile) |
|
|
|
XLowerWindow(dpy, sel->win); |
|
|
|
XLowerWindow(dpy, sel->win); |
|
|
|
for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
|
|
|
for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
|
|
|
if(c == sel) |
|
|
|
if(c == sel) |
|
|
@ -208,7 +208,7 @@ settags(Client *c, Client *trans) { |
|
|
|
ch.res_name ? ch.res_name : "", c->name); |
|
|
|
ch.res_name ? ch.res_name : "", c->name); |
|
|
|
for(i = 0; i < nrules; i++) |
|
|
|
for(i = 0; i < nrules; i++) |
|
|
|
if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { |
|
|
|
if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { |
|
|
|
c->swimming = rule[i].swimming; |
|
|
|
c->versatile = rule[i].versatile; |
|
|
|
for(j = 0; regs[i].tagregex && j < ntags; j++) { |
|
|
|
for(j = 0; regs[i].tagregex && j < ntags; j++) { |
|
|
|
if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { |
|
|
|
if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { |
|
|
|
matched = True; |
|
|
|
matched = True; |
|
|
@ -226,29 +226,6 @@ settags(Client *c, Client *trans) { |
|
|
|
c->tags[i] = seltag[i]; |
|
|
|
c->tags[i] = seltag[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
|
|
swim(void) { |
|
|
|
|
|
|
|
Client *c; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(c = clients; c; c = c->next) { |
|
|
|
|
|
|
|
if(isvisible(c)) { |
|
|
|
|
|
|
|
if(c->isbanned) |
|
|
|
|
|
|
|
XMoveWindow(dpy, c->win, c->x, c->y); |
|
|
|
|
|
|
|
c->isbanned = False; |
|
|
|
|
|
|
|
resize(c, c->x, c->y, c->w, c->h, True); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
c->isbanned = True; |
|
|
|
|
|
|
|
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(!sel || !isvisible(sel)) { |
|
|
|
|
|
|
|
for(c = stack; c && !isvisible(c); c = c->snext); |
|
|
|
|
|
|
|
focus(c); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
restack(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
tag(Arg *arg) { |
|
|
|
tag(Arg *arg) { |
|
|
|
unsigned int i; |
|
|
|
unsigned int i; |
|
|
@ -262,14 +239,6 @@ tag(Arg *arg) { |
|
|
|
lt->arrange(); |
|
|
|
lt->arrange(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
|
|
toggleswimming(Arg *arg) { |
|
|
|
|
|
|
|
if(!sel || lt->arrange == swim) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
sel->swimming = !sel->swimming; |
|
|
|
|
|
|
|
lt->arrange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
toggletag(Arg *arg) { |
|
|
|
toggletag(Arg *arg) { |
|
|
|
unsigned int i; |
|
|
|
unsigned int i; |
|
|
@ -298,6 +267,14 @@ togglelayout(Arg *arg) { |
|
|
|
drawstatus(); |
|
|
|
drawstatus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
|
|
toggleversatile(Arg *arg) { |
|
|
|
|
|
|
|
if(!sel || lt->arrange == versatile) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
sel->versatile = !sel->versatile; |
|
|
|
|
|
|
|
lt->arrange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
toggleview(Arg *arg) { |
|
|
|
toggleview(Arg *arg) { |
|
|
|
unsigned int i; |
|
|
|
unsigned int i; |
|
|
@ -309,6 +286,29 @@ toggleview(Arg *arg) { |
|
|
|
lt->arrange(); |
|
|
|
lt->arrange(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
|
|
versatile(void) { |
|
|
|
|
|
|
|
Client *c; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(c = clients; c; c = c->next) { |
|
|
|
|
|
|
|
if(isvisible(c)) { |
|
|
|
|
|
|
|
if(c->isbanned) |
|
|
|
|
|
|
|
XMoveWindow(dpy, c->win, c->x, c->y); |
|
|
|
|
|
|
|
c->isbanned = False; |
|
|
|
|
|
|
|
resize(c, c->x, c->y, c->w, c->h, True); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
c->isbanned = True; |
|
|
|
|
|
|
|
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(!sel || !isvisible(sel)) { |
|
|
|
|
|
|
|
for(c = stack; c && !isvisible(c); c = c->snext); |
|
|
|
|
|
|
|
focus(c); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
restack(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
view(Arg *arg) { |
|
|
|
view(Arg *arg) { |
|
|
|
unsigned int i; |
|
|
|
unsigned int i; |
|
|
|