sanitization of several clunky stuff, removed heretag (rarely of use), simplified pop(), changed shortcuts to always contain MODKEY
This commit is contained in:
parent
04eb016e78
commit
cd8d8e1208
4 changed files with 40 additions and 48 deletions
17
client.c
17
client.c
|
@ -476,7 +476,7 @@ unmanage(Client *c)
|
||||||
void
|
void
|
||||||
zoom(Arg *arg)
|
zoom(Arg *arg)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c, **l;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
|
@ -486,6 +486,19 @@ zoom(Arg *arg)
|
||||||
sel = c;
|
sel = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
pop(sel);
|
/* pop */
|
||||||
|
for(l = &clients; *l && *l != sel; l = &(*l)->next);
|
||||||
|
if(sel->prev)
|
||||||
|
sel->prev->next = sel->next;
|
||||||
|
if(sel->next)
|
||||||
|
sel->next->prev = sel->prev;
|
||||||
|
*l = sel->next;
|
||||||
|
|
||||||
|
sel->prev = NULL;
|
||||||
|
if(clients)
|
||||||
|
clients->prev = sel;
|
||||||
|
sel->next = clients;
|
||||||
|
clients = sel;
|
||||||
|
arrange(NULL);
|
||||||
focus(sel);
|
focus(sel);
|
||||||
}
|
}
|
||||||
|
|
4
dwm.h
4
dwm.h
|
@ -21,7 +21,7 @@
|
||||||
#define WM_PROTOCOL_DELWIN 1
|
#define WM_PROTOCOL_DELWIN 1
|
||||||
|
|
||||||
/* tags */
|
/* tags */
|
||||||
enum { Tscratch, Tdev, Twww, Twork, TLast };
|
enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
|
||||||
|
|
||||||
/* END CUSTOMIZE */
|
/* END CUSTOMIZE */
|
||||||
|
|
||||||
|
@ -105,7 +105,6 @@ extern void higher(Client *c);
|
||||||
extern void killclient(Arg *arg);
|
extern void killclient(Arg *arg);
|
||||||
extern void lower(Client *c);
|
extern void lower(Client *c);
|
||||||
extern void manage(Window w, XWindowAttributes *wa);
|
extern void manage(Window w, XWindowAttributes *wa);
|
||||||
extern void pop(Client *c);
|
|
||||||
extern void resize(Client *c, Bool sizehints, Corner sticky);
|
extern void resize(Client *c, Bool sizehints, Corner sticky);
|
||||||
extern void setsize(Client *c);
|
extern void setsize(Client *c);
|
||||||
extern void settitle(Client *c);
|
extern void settitle(Client *c);
|
||||||
|
@ -136,7 +135,6 @@ extern void dofloat(Arg *arg);
|
||||||
extern void dotile(Arg *arg);
|
extern void dotile(Arg *arg);
|
||||||
extern Client *getnext(Client *c, unsigned int t);
|
extern Client *getnext(Client *c, unsigned int t);
|
||||||
extern Client *getprev(Client *c);
|
extern Client *getprev(Client *c);
|
||||||
extern void heretag(Arg *arg);
|
|
||||||
extern void replacetag(Arg *arg);
|
extern void replacetag(Arg *arg);
|
||||||
extern void settags(Client *c);
|
extern void settags(Client *c);
|
||||||
extern void togglemode(Arg *arg);
|
extern void togglemode(Arg *arg);
|
||||||
|
|
23
event.c
23
event.c
|
@ -30,27 +30,26 @@ const char *xlock[] = { "xlock", NULL };
|
||||||
|
|
||||||
static Key key[] = {
|
static Key key[] = {
|
||||||
/* modifier key function arguments */
|
/* modifier key function arguments */
|
||||||
{ ControlMask, XK_0, appendtag, { .i = Tscratch } },
|
{ MODKEY, XK_0, view, { .i = Tfnord } },
|
||||||
{ ControlMask, XK_1, appendtag, { .i = Tdev } },
|
|
||||||
{ ControlMask, XK_2, appendtag, { .i = Twww } },
|
|
||||||
{ ControlMask, XK_3, appendtag, { .i = Twork } },
|
|
||||||
{ MODKEY, XK_0, view, { .i = Tscratch } },
|
|
||||||
{ MODKEY, XK_1, view, { .i = Tdev } },
|
{ MODKEY, XK_1, view, { .i = Tdev } },
|
||||||
{ MODKEY, XK_2, view, { .i = Twww } },
|
{ MODKEY, XK_2, view, { .i = Tnet } },
|
||||||
{ MODKEY, XK_3, view, { .i = Twork } },
|
{ MODKEY, XK_3, view, { .i = Twork } },
|
||||||
|
{ MODKEY, XK_4, view, { .i = Tmisc} },
|
||||||
{ MODKEY, XK_j, focusnext, { 0 } },
|
{ MODKEY, XK_j, focusnext, { 0 } },
|
||||||
{ MODKEY, XK_k, focusprev, { 0 } },
|
{ MODKEY, XK_k, focusprev, { 0 } },
|
||||||
{ MODKEY, XK_m, togglemax, { 0 } },
|
{ MODKEY, XK_m, togglemax, { 0 } },
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } },
|
{ MODKEY, XK_space, togglemode, { 0 } },
|
||||||
{ MODKEY, XK_Return, zoom, { 0 } },
|
{ MODKEY, XK_Return, zoom, { 0 } },
|
||||||
{ ControlMask|ShiftMask,XK_0, heretag, { .i = Tscratch } },
|
{ MODKEY|ControlMask, XK_0, appendtag, { .i = Tfnord } },
|
||||||
{ ControlMask|ShiftMask,XK_1, heretag, { .i = Tdev } },
|
{ MODKEY|ControlMask, XK_1, appendtag, { .i = Tdev } },
|
||||||
{ ControlMask|ShiftMask,XK_2, heretag, { .i = Twww } },
|
{ MODKEY|ControlMask, XK_2, appendtag, { .i = Tnet } },
|
||||||
{ ControlMask|ShiftMask,XK_3, heretag, { .i = Twork } },
|
{ MODKEY|ControlMask, XK_3, appendtag, { .i = Twork } },
|
||||||
{ MODKEY|ShiftMask, XK_0, replacetag, { .i = Tscratch } },
|
{ MODKEY|ControlMask, XK_4, appendtag, { .i = Tmisc } },
|
||||||
|
{ MODKEY|ShiftMask, XK_0, replacetag, { .i = Tfnord } },
|
||||||
{ MODKEY|ShiftMask, XK_1, replacetag, { .i = Tdev } },
|
{ MODKEY|ShiftMask, XK_1, replacetag, { .i = Tdev } },
|
||||||
{ MODKEY|ShiftMask, XK_2, replacetag, { .i = Twww } },
|
{ MODKEY|ShiftMask, XK_2, replacetag, { .i = Tnet } },
|
||||||
{ MODKEY|ShiftMask, XK_3, replacetag, { .i = Twork } },
|
{ MODKEY|ShiftMask, XK_3, replacetag, { .i = Twork } },
|
||||||
|
{ MODKEY|ShiftMask, XK_4, replacetag, { .i = Tmisc } },
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } },
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } },
|
||||||
{ MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } },
|
{ MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } },
|
||||||
{ MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } },
|
{ MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } },
|
||||||
|
|
26
tag.c
26
tag.c
|
@ -21,15 +21,16 @@ typedef struct {
|
||||||
/* CUSTOMIZE */
|
/* CUSTOMIZE */
|
||||||
static Rule rule[] = {
|
static Rule rule[] = {
|
||||||
/* class:instance tags isfloat */
|
/* class:instance tags isfloat */
|
||||||
{ "Firefox.*", { [Twww] = "www" }, False },
|
{ "Firefox.*", { [Tnet] = "net" }, False },
|
||||||
{ "Gimp.*", { 0 }, True},
|
{ "Gimp.*", { 0 }, True},
|
||||||
};
|
};
|
||||||
|
|
||||||
char *tags[TLast] = {
|
char *tags[TLast] = {
|
||||||
[Tscratch] = "scratch",
|
[Tfnord] = "fnord",
|
||||||
[Tdev] = "dev",
|
[Tdev] = "dev",
|
||||||
[Twww] = "www",
|
[Tnet] = "net",
|
||||||
[Twork] = "work",
|
[Twork] = "work",
|
||||||
|
[Tmisc] = "misc",
|
||||||
};
|
};
|
||||||
|
|
||||||
void (*arrange)(Arg *) = dotile;
|
void (*arrange)(Arg *) = dotile;
|
||||||
|
@ -147,25 +148,6 @@ getprev(Client *c)
|
||||||
return c;
|
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];
|
|
||||||
pop(c);
|
|
||||||
focus(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
replacetag(Arg *arg)
|
replacetag(Arg *arg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue