tadded heretag command which allows to tag a client of a foreign tag with curre… | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 4f8b08d330a6c377ab919f48b8e922d1c5ded601 | |
parent 849e631510ed6533ac930449804e477fe67a43c2 | |
Author: Anselm R. Garbe <[email protected]> | |
Date: Tue, 18 Jul 2006 11:38:31 +0200 | |
added heretag command which allows to tag a client of a foreign tag with curren… | |
Diffstat: | |
M client.c | 8 ++++---- | |
M draw.c | 2 +- | |
M dwm.1 | 8 ++++++++ | |
M dwm.h | 3 ++- | |
M event.c | 4 ++++ | |
M tag.c | 27 +++++++++++++++++++++++---- | |
6 files changed, 42 insertions(+), 10 deletions(-) | |
--- | |
diff --git a/client.c b/client.c | |
t@@ -66,8 +66,8 @@ focusnext(Arg *arg) | |
if(!sel) | |
return; | |
- if(!(c = getnext(sel->next))) | |
- c = getnext(clients); | |
+ if(!(c = getnext(sel->next, tsel))) | |
+ c = getnext(clients, tsel); | |
if(c) { | |
higher(c); | |
c->revert = sel; | |
t@@ -410,8 +410,8 @@ zoom(Arg *arg) | |
if(!sel) | |
return; | |
- if(sel == getnext(clients) && sel->next) { | |
- if((c = getnext(sel->next))) | |
+ if(sel == getnext(clients, tsel) && sel->next) { | |
+ if((c = getnext(sel->next, tsel))) | |
sel = c; | |
} | |
diff --git a/draw.c b/draw.c | |
t@@ -97,7 +97,7 @@ drawall() | |
{ | |
Client *c; | |
- for(c = clients; c; c = getnext(c->next)) | |
+ for(c = clients; c; c = getnext(c->next, tsel)) | |
drawtitle(c); | |
drawstatus(); | |
} | |
diff --git a/dwm.1 b/dwm.1 | |
t@@ -93,6 +93,14 @@ Append | |
tag to current | |
.B window | |
.TP | |
+.B Control-Shift-[0..n] | |
+Replace current | |
+.B window | |
+of | |
+.B nth | |
+tag with current tag. | |
+.B window | |
+.TP | |
.B Control-Button1 | |
Zooms the clicked | |
.B window | |
diff --git a/dwm.h b/dwm.h | |
t@@ -145,7 +145,8 @@ extern int xerror(Display *dsply, XErrorEvent *ee); | |
extern void appendtag(Arg *arg); | |
extern void dofloat(Arg *arg); | |
extern void dotile(Arg *arg); | |
-extern Client *getnext(Client *c); | |
+extern Client *getnext(Client *c, unsigned int t); | |
+extern void heretag(Arg *arg); | |
extern void replacetag(Arg *arg); | |
extern void settags(Client *c); | |
extern void view(Arg *arg); | |
diff --git a/event.c b/event.c | |
t@@ -35,6 +35,10 @@ Key key[] = { | |
{ Mod1Mask, XK_m, maximi… | |
{ Mod1Mask, XK_space, dotile, … | |
{ Mod1Mask, XK_Return, zoom, … | |
+ { ControlMask|ShiftMask,XK_0, heretag, { .i = Ts… | |
+ { ControlMask|ShiftMask,XK_1, heretag, { .i = Td… | |
+ { ControlMask|ShiftMask,XK_2, heretag, { .i = Tw… | |
+ { ControlMask|ShiftMask,XK_3, heretag, { .i = Tw… | |
{ Mod1Mask|ShiftMask, XK_0, replacetag, … | |
{ Mod1Mask|ShiftMask, XK_1, replacetag, … | |
{ Mod1Mask|ShiftMask, XK_2, replacetag, … | |
diff --git a/tag.c b/tag.c | |
t@@ -49,7 +49,7 @@ dofloat(Arg *arg) | |
ban(c); | |
} | |
if(sel && !sel->tags[tsel]) { | |
- if((sel = getnext(clients))) { | |
+ if((sel = getnext(clients, tsel))) { | |
higher(sel); | |
focus(sel); | |
} | |
t@@ -106,7 +106,7 @@ dotile(Arg *arg) | |
ban(c); | |
} | |
if(!sel || (sel && !sel->tags[tsel])) { | |
- if((sel = getnext(clients))) { | |
+ if((sel = getnext(clients, tsel))) { | |
higher(sel); | |
focus(sel); | |
} | |
t@@ -115,13 +115,32 @@ dotile(Arg *arg) | |
} | |
Client * | |
-getnext(Client *c) | |
+getnext(Client *c, unsigned int t) | |
{ | |
- for(; c && !c->tags[tsel]; c = c->next); | |
+ for(; c && !c->tags[t]; c = c->next); | |
return c; | |
} | |
void | |
+heretag(Arg *arg) | |
+{ | |
+ int i; | |
+ Client *c; | |
+ | |
+ if(arg->i == tsel) | |
+ return; | |
+ | |
+ if(!(c = getnext(clients, arg->i))) | |
+ return; | |
+ | |
+ for(i = 0; i < TLast; i++) | |
+ c->tags[i] = NULL; | |
+ c->tags[tsel] = tags[tsel]; | |
+ arrange(NULL); | |
+ focus(c); | |
+} | |
+ | |
+void | |
replacetag(Arg *arg) | |
{ | |
int i; |