aewl
changeset 93:c498da7520c7
added heretag command which allows to tag a client of a foreign tag with current tag
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 18 Jul 2006 11:38:31 +0200 |
parents | 4bee0aa5b286 |
children | 6efe82c775c9 |
files | client.c draw.c dwm.1 dwm.h event.c tag.c |
diffstat | 6 files changed, 42 insertions(+), 10 deletions(-) [+] |
line diff
1.1 --- a/client.c Tue Jul 18 08:18:54 2006 +0200 1.2 +++ b/client.c Tue Jul 18 11:38:31 2006 +0200 1.3 @@ -66,8 +66,8 @@ 1.4 if(!sel) 1.5 return; 1.6 1.7 - if(!(c = getnext(sel->next))) 1.8 - c = getnext(clients); 1.9 + if(!(c = getnext(sel->next, tsel))) 1.10 + c = getnext(clients, tsel); 1.11 if(c) { 1.12 higher(c); 1.13 c->revert = sel; 1.14 @@ -410,8 +410,8 @@ 1.15 if(!sel) 1.16 return; 1.17 1.18 - if(sel == getnext(clients) && sel->next) { 1.19 - if((c = getnext(sel->next))) 1.20 + if(sel == getnext(clients, tsel) && sel->next) { 1.21 + if((c = getnext(sel->next, tsel))) 1.22 sel = c; 1.23 } 1.24
2.1 --- a/draw.c Tue Jul 18 08:18:54 2006 +0200 2.2 +++ b/draw.c Tue Jul 18 11:38:31 2006 +0200 2.3 @@ -97,7 +97,7 @@ 2.4 { 2.5 Client *c; 2.6 2.7 - for(c = clients; c; c = getnext(c->next)) 2.8 + for(c = clients; c; c = getnext(c->next, tsel)) 2.9 drawtitle(c); 2.10 drawstatus(); 2.11 }
3.1 --- a/dwm.1 Tue Jul 18 08:18:54 2006 +0200 3.2 +++ b/dwm.1 Tue Jul 18 11:38:31 2006 +0200 3.3 @@ -93,6 +93,14 @@ 3.4 tag to current 3.5 .B window 3.6 .TP 3.7 +.B Control-Shift-[0..n] 3.8 +Replace current 3.9 +.B window 3.10 +of 3.11 +.B nth 3.12 +tag with current tag. 3.13 +.B window 3.14 +.TP 3.15 .B Control-Button1 3.16 Zooms the clicked 3.17 .B window
4.1 --- a/dwm.h Tue Jul 18 08:18:54 2006 +0200 4.2 +++ b/dwm.h Tue Jul 18 11:38:31 2006 +0200 4.3 @@ -145,7 +145,8 @@ 4.4 extern void appendtag(Arg *arg); 4.5 extern void dofloat(Arg *arg); 4.6 extern void dotile(Arg *arg); 4.7 -extern Client *getnext(Client *c); 4.8 +extern Client *getnext(Client *c, unsigned int t); 4.9 +extern void heretag(Arg *arg); 4.10 extern void replacetag(Arg *arg); 4.11 extern void settags(Client *c); 4.12 extern void view(Arg *arg);
5.1 --- a/event.c Tue Jul 18 08:18:54 2006 +0200 5.2 +++ b/event.c Tue Jul 18 11:38:31 2006 +0200 5.3 @@ -35,6 +35,10 @@ 5.4 { Mod1Mask, XK_m, maximize, { 0 } }, 5.5 { Mod1Mask, XK_space, dotile, { 0 } }, 5.6 { Mod1Mask, XK_Return, zoom, { 0 } }, 5.7 + { ControlMask|ShiftMask,XK_0, heretag, { .i = Tscratch } }, 5.8 + { ControlMask|ShiftMask,XK_1, heretag, { .i = Tdev } }, 5.9 + { ControlMask|ShiftMask,XK_2, heretag, { .i = Twww } }, 5.10 + { ControlMask|ShiftMask,XK_3, heretag, { .i = Twork } }, 5.11 { Mod1Mask|ShiftMask, XK_0, replacetag, { .i = Tscratch } }, 5.12 { Mod1Mask|ShiftMask, XK_1, replacetag, { .i = Tdev } }, 5.13 { Mod1Mask|ShiftMask, XK_2, replacetag, { .i = Twww } },
6.1 --- a/tag.c Tue Jul 18 08:18:54 2006 +0200 6.2 +++ b/tag.c Tue Jul 18 11:38:31 2006 +0200 6.3 @@ -49,7 +49,7 @@ 6.4 ban(c); 6.5 } 6.6 if(sel && !sel->tags[tsel]) { 6.7 - if((sel = getnext(clients))) { 6.8 + if((sel = getnext(clients, tsel))) { 6.9 higher(sel); 6.10 focus(sel); 6.11 } 6.12 @@ -106,7 +106,7 @@ 6.13 ban(c); 6.14 } 6.15 if(!sel || (sel && !sel->tags[tsel])) { 6.16 - if((sel = getnext(clients))) { 6.17 + if((sel = getnext(clients, tsel))) { 6.18 higher(sel); 6.19 focus(sel); 6.20 } 6.21 @@ -115,13 +115,32 @@ 6.22 } 6.23 6.24 Client * 6.25 -getnext(Client *c) 6.26 +getnext(Client *c, unsigned int t) 6.27 { 6.28 - for(; c && !c->tags[tsel]; c = c->next); 6.29 + for(; c && !c->tags[t]; c = c->next); 6.30 return c; 6.31 } 6.32 6.33 void 6.34 +heretag(Arg *arg) 6.35 +{ 6.36 + int i; 6.37 + Client *c; 6.38 + 6.39 + if(arg->i == tsel) 6.40 + return; 6.41 + 6.42 + if(!(c = getnext(clients, arg->i))) 6.43 + return; 6.44 + 6.45 + for(i = 0; i < TLast; i++) 6.46 + c->tags[i] = NULL; 6.47 + c->tags[tsel] = tags[tsel]; 6.48 + arrange(NULL); 6.49 + focus(c); 6.50 +} 6.51 + 6.52 +void 6.53 replacetag(Arg *arg) 6.54 { 6.55 int i;