Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
7541f1ad49 | |||
74cbbe5f35 | |||
52f0b9e2e3 | |||
29c26b88e7 | |||
f196b71e4d | |||
ab83872134 |
1
.hgtags
1
.hgtags
@ -37,3 +37,4 @@ d3876aa792923f9a95f7ad0c7f0134533404df35 3.2.2
|
|||||||
0f91934037b04221ff5d1ba3a6c39c1ff26e3661 3.3
|
0f91934037b04221ff5d1ba3a6c39c1ff26e3661 3.3
|
||||||
9ede7b2d2450537e750d5505789fbe63960e97e6 3.4
|
9ede7b2d2450537e750d5505789fbe63960e97e6 3.4
|
||||||
63ad05e7f9e1f4f1881fb02f529cb6c6ae81e693 3.5
|
63ad05e7f9e1f4f1881fb02f529cb6c6ae81e693 3.5
|
||||||
|
75b1b25fe0d7e29400baf30568153f668324928b 3.6
|
||||||
|
46
client.c
46
client.c
@ -170,38 +170,6 @@ focus(Client *c) {
|
|||||||
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
focusnext(Arg *arg) {
|
|
||||||
Client *c;
|
|
||||||
|
|
||||||
if(!sel)
|
|
||||||
return;
|
|
||||||
for(c = sel->next; c && !isvisible(c); c = c->next);
|
|
||||||
if(!c)
|
|
||||||
for(c = clients; c && !isvisible(c); c = c->next);
|
|
||||||
if(c) {
|
|
||||||
focus(c);
|
|
||||||
restack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
focusprev(Arg *arg) {
|
|
||||||
Client *c;
|
|
||||||
|
|
||||||
if(!sel)
|
|
||||||
return;
|
|
||||||
for(c = sel->prev; c && !isvisible(c); c = c->prev);
|
|
||||||
if(!c) {
|
|
||||||
for(c = clients; c && c->next; c = c->next);
|
|
||||||
for(; c && !isvisible(c); c = c->prev);
|
|
||||||
}
|
|
||||||
if(c) {
|
|
||||||
focus(c);
|
|
||||||
restack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
killclient(Arg *arg) {
|
killclient(Arg *arg) {
|
||||||
if(!sel)
|
if(!sel)
|
||||||
@ -266,12 +234,6 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
lt->arrange();
|
lt->arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
|
||||||
nexttiled(Client *c) {
|
|
||||||
for(; c && (c->isversatile || !isvisible(c)); c = c->next);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
||||||
float actual, dx, dy, max, min;
|
float actual, dx, dy, max, min;
|
||||||
@ -340,6 +302,14 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
toggleversatile(Arg *arg) {
|
||||||
|
if(!sel || lt->arrange == versatile)
|
||||||
|
return;
|
||||||
|
sel->isversatile = !sel->isversatile;
|
||||||
|
lt->arrange();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
updatesizehints(Client *c) {
|
updatesizehints(Client *c) {
|
||||||
long msize;
|
long msize;
|
||||||
|
30
config.arg.h
30
config.arg.h
@ -2,6 +2,7 @@
|
|||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
#define BORDERPX 1
|
#define BORDERPX 1
|
||||||
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
||||||
#define NORMBORDERCOLOR "#333"
|
#define NORMBORDERCOLOR "#333"
|
||||||
@ -10,23 +11,33 @@
|
|||||||
#define SELBORDERCOLOR "#69c"
|
#define SELBORDERCOLOR "#69c"
|
||||||
#define SELBGCOLOR "#555"
|
#define SELBGCOLOR "#555"
|
||||||
#define SELFGCOLOR "#fff"
|
#define SELFGCOLOR "#fff"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
|
||||||
#define MODKEY Mod1Mask
|
|
||||||
#define NMASTER 1 /* clients in master area */
|
|
||||||
#define SNAP 40 /* pixel */
|
|
||||||
#define TOPBAR True /* False */
|
#define TOPBAR True /* False */
|
||||||
|
|
||||||
|
/* behavior */
|
||||||
|
#define SNAP 40 /* pixel */
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
||||||
|
#define RULES \
|
||||||
|
static Rule rule[] = { \
|
||||||
|
/* class:instance:title regex tags regex isversatile */ \
|
||||||
|
{ "Firefox", "3", False }, \
|
||||||
|
{ "Gimp", NULL, True }, \
|
||||||
|
{ "MPlayer", NULL, True }, \
|
||||||
|
{ "Acroread", NULL, True }, \
|
||||||
|
};
|
||||||
|
|
||||||
|
/* layout(s) */
|
||||||
#define LAYOUTS \
|
#define LAYOUTS \
|
||||||
static Layout layout[] = { \
|
static Layout layout[] = { \
|
||||||
/* symbol function */ \
|
/* symbol function */ \
|
||||||
{ "[]=", tile }, /* first entry is default */ \
|
{ "[]=", tile }, /* first entry is default */ \
|
||||||
{ "><>", versatile }, \
|
{ "><>", versatile }, \
|
||||||
};
|
};
|
||||||
|
#define MASTER 600 /* per thousand */
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
|
|
||||||
|
/* key definitions */
|
||||||
|
#define MODKEY Mod1Mask
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
static Key key[] = { \
|
static Key key[] = { \
|
||||||
/* modifier key function argument */ \
|
/* modifier key function argument */ \
|
||||||
@ -86,12 +97,3 @@ static Key key[] = { \
|
|||||||
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RULES \
|
|
||||||
static Rule rule[] = { \
|
|
||||||
/* class:instance:title regex tags regex isversatile */ \
|
|
||||||
{ "Firefox", "3", False }, \
|
|
||||||
{ "Gimp", NULL, True }, \
|
|
||||||
{ "MPlayer", NULL, True }, \
|
|
||||||
{ "Acroread", NULL, True }, \
|
|
||||||
};
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
#define BORDERPX 1
|
#define BORDERPX 1
|
||||||
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
||||||
#define NORMBORDERCOLOR "#dddddd"
|
#define NORMBORDERCOLOR "#dddddd"
|
||||||
@ -10,23 +11,34 @@
|
|||||||
#define SELBORDERCOLOR "#ff0000"
|
#define SELBORDERCOLOR "#ff0000"
|
||||||
#define SELBGCOLOR "#006699"
|
#define SELBGCOLOR "#006699"
|
||||||
#define SELFGCOLOR "#ffffff"
|
#define SELFGCOLOR "#ffffff"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
|
||||||
#define MODKEY Mod1Mask
|
|
||||||
#define NMASTER 1 /* clients in master area */
|
|
||||||
#define SNAP 20 /* pixel */
|
|
||||||
#define TOPBAR True /* False */
|
#define TOPBAR True /* False */
|
||||||
|
|
||||||
|
/* behavior */
|
||||||
|
#define SNAP 20 /* pixel */
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
||||||
|
/* Query class:instance:title for regex matching info with following command:
|
||||||
|
* xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
|
||||||
|
#define RULES \
|
||||||
|
static Rule rule[] = { \
|
||||||
|
/* class:instance:title regex tags regex isversatile */ \
|
||||||
|
{ "Gimp", NULL, True }, \
|
||||||
|
{ "MPlayer", NULL, True }, \
|
||||||
|
{ "Acroread", NULL, True }, \
|
||||||
|
};
|
||||||
|
|
||||||
|
/* layout(s) */
|
||||||
#define LAYOUTS \
|
#define LAYOUTS \
|
||||||
Layout layout[] = { \
|
static Layout layout[] = { \
|
||||||
/* symbol function */ \
|
/* symbol function */ \
|
||||||
{ "[]=", tile }, /* first entry is default */ \
|
{ "[]=", tile }, /* first entry is default */ \
|
||||||
{ "><>", versatile }, \
|
{ "><>", versatile }, \
|
||||||
};
|
};
|
||||||
|
#define MASTER 600 /* per thousand */
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
|
|
||||||
|
/* key definitions */
|
||||||
|
#define MODKEY Mod1Mask
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
static Key key[] = { \
|
static Key key[] = { \
|
||||||
/* modifier key function argument */ \
|
/* modifier key function argument */ \
|
||||||
@ -81,13 +93,3 @@ static Key key[] = { \
|
|||||||
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Query class:instance:title for regex matching info with following command:
|
|
||||||
* xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
|
|
||||||
#define RULES \
|
|
||||||
static Rule rule[] = { \
|
|
||||||
/* class:instance:title regex tags regex isversatile */ \
|
|
||||||
{ "Gimp", NULL, True }, \
|
|
||||||
{ "MPlayer", NULL, True }, \
|
|
||||||
{ "Acroread", NULL, True }, \
|
|
||||||
};
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 3.6
|
VERSION = 3.6.1
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
10
dwm.h
10
dwm.h
@ -94,7 +94,7 @@ extern unsigned int master, nmaster; /* master percent, number of master client
|
|||||||
extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
|
extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
|
||||||
extern void (*handler[LASTEvent])(XEvent *); /* event handler */
|
extern void (*handler[LASTEvent])(XEvent *); /* event handler */
|
||||||
extern Atom wmatom[WMLast], netatom[NetLast];
|
extern Atom wmatom[WMLast], netatom[NetLast];
|
||||||
extern Bool running, selscreen, *seltag; /* seltag is array of Bool */
|
extern Bool selscreen, *seltag; /* seltag is array of Bool */
|
||||||
extern Client *clients, *sel, *stack; /* global client list and stack */
|
extern Client *clients, *sel, *stack; /* global client list and stack */
|
||||||
extern Cursor cursor[CurLast];
|
extern Cursor cursor[CurLast];
|
||||||
extern DC dc; /* global draw context */
|
extern DC dc; /* global draw context */
|
||||||
@ -105,13 +105,11 @@ extern Window root, barwin;
|
|||||||
/* client.c */
|
/* client.c */
|
||||||
extern void configure(Client *c); /* send synthetic configure event */
|
extern void configure(Client *c); /* send synthetic configure event */
|
||||||
extern void focus(Client *c); /* focus c, c may be NULL */
|
extern void focus(Client *c); /* focus c, c may be NULL */
|
||||||
extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */
|
|
||||||
extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */
|
|
||||||
extern void killclient(Arg *arg); /* kill c nicely */
|
extern void killclient(Arg *arg); /* kill c nicely */
|
||||||
extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
|
extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
|
||||||
extern Client *nexttiled(Client *c); /* returns tiled successor of c */
|
|
||||||
extern void resize(Client *c, int x, int y,
|
extern void resize(Client *c, int x, int y,
|
||||||
int w, int h, Bool sizehints); /* resize with given coordinates c*/
|
int w, int h, Bool sizehints); /* resize with given coordinates c*/
|
||||||
|
extern void toggleversatile(Arg *arg); /* toggles focused client between versatile/and non-versatile state */
|
||||||
extern void updatesizehints(Client *c); /* update the size hint variables of c */
|
extern void updatesizehints(Client *c); /* update the size hint variables of c */
|
||||||
extern void updatetitle(Client *c); /* update the name of c */
|
extern void updatetitle(Client *c); /* update the name of c */
|
||||||
extern void unmanage(Client *c); /* destroy c */
|
extern void unmanage(Client *c); /* destroy c */
|
||||||
@ -127,12 +125,14 @@ extern unsigned int textw(const char *text); /* return the width of text in px*/
|
|||||||
extern void grabkeys(void); /* grab all keys defined in config.h */
|
extern void grabkeys(void); /* grab all keys defined in config.h */
|
||||||
|
|
||||||
/* layout.c */
|
/* layout.c */
|
||||||
|
extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */
|
||||||
|
extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */
|
||||||
extern void incnmaster(Arg *arg); /* increments nmaster with arg's index value */
|
extern void incnmaster(Arg *arg); /* increments nmaster with arg's index value */
|
||||||
extern void initlayouts(void); /* initialize layout array */
|
extern void initlayouts(void); /* initialize layout array */
|
||||||
|
extern Client *nexttiled(Client *c); /* returns tiled successor of c */
|
||||||
extern void resizemaster(Arg *arg); /* resizes the master percent with arg's index value */
|
extern void resizemaster(Arg *arg); /* resizes the master percent with arg's index value */
|
||||||
extern void restack(void); /* restores z layers of all clients */
|
extern void restack(void); /* restores z layers of all clients */
|
||||||
extern void setlayout(Arg *arg); /* sets layout, -1 toggles */
|
extern void setlayout(Arg *arg); /* sets layout, -1 toggles */
|
||||||
extern void toggleversatile(Arg *arg); /* toggles focusesd client between versatile/and non-versatile state */
|
|
||||||
extern void versatile(void); /* arranges all windows versatile */
|
extern void versatile(void); /* arranges all windows versatile */
|
||||||
|
|
||||||
/* main.c */
|
/* main.c */
|
||||||
|
46
layout.c
46
layout.c
@ -68,6 +68,38 @@ LAYOUTS
|
|||||||
|
|
||||||
/* extern */
|
/* extern */
|
||||||
|
|
||||||
|
void
|
||||||
|
focusnext(Arg *arg) {
|
||||||
|
Client *c;
|
||||||
|
|
||||||
|
if(!sel)
|
||||||
|
return;
|
||||||
|
for(c = sel->next; c && !isvisible(c); c = c->next);
|
||||||
|
if(!c)
|
||||||
|
for(c = clients; c && !isvisible(c); c = c->next);
|
||||||
|
if(c) {
|
||||||
|
focus(c);
|
||||||
|
restack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
focusprev(Arg *arg) {
|
||||||
|
Client *c;
|
||||||
|
|
||||||
|
if(!sel)
|
||||||
|
return;
|
||||||
|
for(c = sel->prev; c && !isvisible(c); c = c->prev);
|
||||||
|
if(!c) {
|
||||||
|
for(c = clients; c && c->next; c = c->next);
|
||||||
|
for(; c && !isvisible(c); c = c->prev);
|
||||||
|
}
|
||||||
|
if(c) {
|
||||||
|
focus(c);
|
||||||
|
restack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
incnmaster(Arg *arg) {
|
incnmaster(Arg *arg) {
|
||||||
if((lt->arrange != tile) || (nmaster + arg->i < 1)
|
if((lt->arrange != tile) || (nmaster + arg->i < 1)
|
||||||
@ -93,6 +125,12 @@ initlayouts(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Client *
|
||||||
|
nexttiled(Client *c) {
|
||||||
|
for(; c && (c->isversatile || !isvisible(c)); c = c->next);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
resizemaster(Arg *arg) {
|
resizemaster(Arg *arg) {
|
||||||
if(lt->arrange != tile)
|
if(lt->arrange != tile)
|
||||||
@ -153,14 +191,6 @@ setlayout(Arg *arg) {
|
|||||||
drawstatus();
|
drawstatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
toggleversatile(Arg *arg) {
|
|
||||||
if(!sel || lt->arrange == versatile)
|
|
||||||
return;
|
|
||||||
sel->isversatile = !sel->isversatile;
|
|
||||||
lt->arrange();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
versatile(void) {
|
versatile(void) {
|
||||||
Client *c;
|
Client *c;
|
||||||
|
2
main.c
2
main.c
@ -21,7 +21,6 @@ char stext[256];
|
|||||||
int screen, sx, sy, sw, sh, wax, way, waw, wah;
|
int screen, sx, sy, sw, sh, wax, way, waw, wah;
|
||||||
unsigned int bh, ntags, numlockmask;
|
unsigned int bh, ntags, numlockmask;
|
||||||
Atom wmatom[WMLast], netatom[NetLast];
|
Atom wmatom[WMLast], netatom[NetLast];
|
||||||
Bool running = True;
|
|
||||||
Bool *seltag;
|
Bool *seltag;
|
||||||
Bool selscreen = True;
|
Bool selscreen = True;
|
||||||
Client *clients = NULL;
|
Client *clients = NULL;
|
||||||
@ -36,6 +35,7 @@ Window root, barwin;
|
|||||||
|
|
||||||
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||||
static Bool otherwm, readin;
|
static Bool otherwm, readin;
|
||||||
|
static Bool running = True;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cleanup(void) {
|
cleanup(void) {
|
||||||
|
Reference in New Issue
Block a user