aewl
changeset 130:30d1302dbe3b
sanitization of several clunky stuff, removed heretag (rarely of use), simplified pop(), changed shortcuts to always contain MODKEY
author | arg@10ksloc.org |
---|---|
date | Fri, 21 Jul 2006 07:37:52 +0200 |
parents | c478383db7c9 |
children | 65efe27cbf3d |
files | client.c dwm.h event.c tag.c |
diffstat | 4 files changed, 40 insertions(+), 48 deletions(-) [+] |
line diff
1.1 --- a/client.c Thu Jul 20 19:09:11 2006 +0200 1.2 +++ b/client.c Fri Jul 21 07:37:52 2006 +0200 1.3 @@ -476,7 +476,7 @@ 1.4 void 1.5 zoom(Arg *arg) 1.6 { 1.7 - Client *c; 1.8 + Client *c, **l; 1.9 1.10 if(!sel) 1.11 return; 1.12 @@ -486,6 +486,19 @@ 1.13 sel = c; 1.14 } 1.15 1.16 - pop(sel); 1.17 + /* pop */ 1.18 + for(l = &clients; *l && *l != sel; l = &(*l)->next); 1.19 + if(sel->prev) 1.20 + sel->prev->next = sel->next; 1.21 + if(sel->next) 1.22 + sel->next->prev = sel->prev; 1.23 + *l = sel->next; 1.24 + 1.25 + sel->prev = NULL; 1.26 + if(clients) 1.27 + clients->prev = sel; 1.28 + sel->next = clients; 1.29 + clients = sel; 1.30 + arrange(NULL); 1.31 focus(sel); 1.32 }
2.1 --- a/dwm.h Thu Jul 20 19:09:11 2006 +0200 2.2 +++ b/dwm.h Fri Jul 21 07:37:52 2006 +0200 2.3 @@ -7,21 +7,21 @@ 2.4 2.5 /* CUSTOMIZE */ 2.6 2.7 -#define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*" 2.8 -#define BGCOLOR "#0a2c2d" 2.9 -#define FGCOLOR "#ddeeee" 2.10 -#define BORDERCOLOR "#176164" 2.11 -#define MODKEY Mod1Mask /* Mod4Mask */ 2.12 +#define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*" 2.13 +#define BGCOLOR "#0a2c2d" 2.14 +#define FGCOLOR "#ddeeee" 2.15 +#define BORDERCOLOR "#176164" 2.16 +#define MODKEY Mod1Mask /* Mod4Mask */ 2.17 /* 2.18 -#define BGCOLOR "#666699" 2.19 -#define FGCOLOR "#eeeeee" 2.20 -#define BORDERCOLOR "#9999CC" 2.21 +#define BGCOLOR "#666699" 2.22 +#define FGCOLOR "#eeeeee" 2.23 +#define BORDERCOLOR "#9999CC" 2.24 */ 2.25 -#define MASTERW 52 /* percent */ 2.26 +#define MASTERW 52 /* percent */ 2.27 #define WM_PROTOCOL_DELWIN 1 2.28 2.29 /* tags */ 2.30 -enum { Tscratch, Tdev, Twww, Twork, TLast }; 2.31 +enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast }; 2.32 2.33 /* END CUSTOMIZE */ 2.34 2.35 @@ -105,7 +105,6 @@ 2.36 extern void killclient(Arg *arg); 2.37 extern void lower(Client *c); 2.38 extern void manage(Window w, XWindowAttributes *wa); 2.39 -extern void pop(Client *c); 2.40 extern void resize(Client *c, Bool sizehints, Corner sticky); 2.41 extern void setsize(Client *c); 2.42 extern void settitle(Client *c); 2.43 @@ -136,7 +135,6 @@ 2.44 extern void dotile(Arg *arg); 2.45 extern Client *getnext(Client *c, unsigned int t); 2.46 extern Client *getprev(Client *c); 2.47 -extern void heretag(Arg *arg); 2.48 extern void replacetag(Arg *arg); 2.49 extern void settags(Client *c); 2.50 extern void togglemode(Arg *arg);
3.1 --- a/event.c Thu Jul 20 19:09:11 2006 +0200 3.2 +++ b/event.c Fri Jul 21 07:37:52 2006 +0200 3.3 @@ -30,27 +30,26 @@ 3.4 3.5 static Key key[] = { 3.6 /* modifier key function arguments */ 3.7 - { ControlMask, XK_0, appendtag, { .i = Tscratch } }, 3.8 - { ControlMask, XK_1, appendtag, { .i = Tdev } }, 3.9 - { ControlMask, XK_2, appendtag, { .i = Twww } }, 3.10 - { ControlMask, XK_3, appendtag, { .i = Twork } }, 3.11 - { MODKEY, XK_0, view, { .i = Tscratch } }, 3.12 + { MODKEY, XK_0, view, { .i = Tfnord } }, 3.13 { MODKEY, XK_1, view, { .i = Tdev } }, 3.14 - { MODKEY, XK_2, view, { .i = Twww } }, 3.15 + { MODKEY, XK_2, view, { .i = Tnet } }, 3.16 { MODKEY, XK_3, view, { .i = Twork } }, 3.17 + { MODKEY, XK_4, view, { .i = Tmisc} }, 3.18 { MODKEY, XK_j, focusnext, { 0 } }, 3.19 { MODKEY, XK_k, focusprev, { 0 } }, 3.20 { MODKEY, XK_m, togglemax, { 0 } }, 3.21 { MODKEY, XK_space, togglemode, { 0 } }, 3.22 { MODKEY, XK_Return, zoom, { 0 } }, 3.23 - { ControlMask|ShiftMask,XK_0, heretag, { .i = Tscratch } }, 3.24 - { ControlMask|ShiftMask,XK_1, heretag, { .i = Tdev } }, 3.25 - { ControlMask|ShiftMask,XK_2, heretag, { .i = Twww } }, 3.26 - { ControlMask|ShiftMask,XK_3, heretag, { .i = Twork } }, 3.27 - { MODKEY|ShiftMask, XK_0, replacetag, { .i = Tscratch } }, 3.28 + { MODKEY|ControlMask, XK_0, appendtag, { .i = Tfnord } }, 3.29 + { MODKEY|ControlMask, XK_1, appendtag, { .i = Tdev } }, 3.30 + { MODKEY|ControlMask, XK_2, appendtag, { .i = Tnet } }, 3.31 + { MODKEY|ControlMask, XK_3, appendtag, { .i = Twork } }, 3.32 + { MODKEY|ControlMask, XK_4, appendtag, { .i = Tmisc } }, 3.33 + { MODKEY|ShiftMask, XK_0, replacetag, { .i = Tfnord } }, 3.34 { MODKEY|ShiftMask, XK_1, replacetag, { .i = Tdev } }, 3.35 - { MODKEY|ShiftMask, XK_2, replacetag, { .i = Twww } }, 3.36 + { MODKEY|ShiftMask, XK_2, replacetag, { .i = Tnet } }, 3.37 { MODKEY|ShiftMask, XK_3, replacetag, { .i = Twork } }, 3.38 + { MODKEY|ShiftMask, XK_4, replacetag, { .i = Tmisc } }, 3.39 { MODKEY|ShiftMask, XK_c, killclient, { 0 } }, 3.40 { MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } }, 3.41 { MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } },
4.1 --- a/tag.c Thu Jul 20 19:09:11 2006 +0200 4.2 +++ b/tag.c Fri Jul 21 07:37:52 2006 +0200 4.3 @@ -21,15 +21,16 @@ 4.4 /* CUSTOMIZE */ 4.5 static Rule rule[] = { 4.6 /* class:instance tags isfloat */ 4.7 - { "Firefox.*", { [Twww] = "www" }, False }, 4.8 + { "Firefox.*", { [Tnet] = "net" }, False }, 4.9 { "Gimp.*", { 0 }, True}, 4.10 }; 4.11 4.12 char *tags[TLast] = { 4.13 - [Tscratch] = "scratch", 4.14 + [Tfnord] = "fnord", 4.15 [Tdev] = "dev", 4.16 - [Twww] = "www", 4.17 + [Tnet] = "net", 4.18 [Twork] = "work", 4.19 + [Tmisc] = "misc", 4.20 }; 4.21 4.22 void (*arrange)(Arg *) = dotile; 4.23 @@ -148,25 +149,6 @@ 4.24 } 4.25 4.26 void 4.27 -heretag(Arg *arg) 4.28 -{ 4.29 - int i; 4.30 - Client *c; 4.31 - 4.32 - if(arg->i == tsel) 4.33 - return; 4.34 - 4.35 - if(!(c = getnext(clients, arg->i))) 4.36 - return; 4.37 - 4.38 - for(i = 0; i < TLast; i++) 4.39 - c->tags[i] = NULL; 4.40 - c->tags[tsel] = tags[tsel]; 4.41 - pop(c); 4.42 - focus(c); 4.43 -} 4.44 - 4.45 -void 4.46 replacetag(Arg *arg) 4.47 { 4.48 int i;