Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
f679125206 | |||
58beead14d | |||
e1811c37ca | |||
a24a6701c8 | |||
d108cfa7fc | |||
92cb5ebb7c | |||
653826572d | |||
5a5851bac2 | |||
1d4a24dae0 | |||
a768ea93fd | |||
c95fe6e24b | |||
c75168186b | |||
3a96c9a8d5 | |||
1617b95598 | |||
726ae5bf6d | |||
3e11b38349 | |||
16ed879524 | |||
20d7b5d058 | |||
11a08b9cfc | |||
c2b753d917 | |||
6c767072a3 | |||
e9cfae7aba | |||
7ac0de8350 | |||
0b7c0f10ee | |||
51f6405b0d | |||
6096f8a113 | |||
d939f301fa | |||
8c4623da80 | |||
0faaba04a5 | |||
ec7a5ffff1 | |||
98afb7b9d0 | |||
06bae9dfb7 | |||
0b80d1842d | |||
d7ec23a5db | |||
2cf8ef9520 | |||
184471b4bb | |||
21898c6049 | |||
6a9300e815 | |||
ac24f132db | |||
cb4aa5bc35 | |||
beac539f31 |
2
.hgtags
2
.hgtags
@ -27,3 +27,5 @@ dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5
|
|||||||
c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1
|
c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1
|
||||||
5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6
|
5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6
|
||||||
21951c0dfbae5af68ed77821a4d87253ee91803f 2.7
|
21951c0dfbae5af68ed77821a4d87253ee91803f 2.7
|
||||||
|
107719a9ce3bd0c79f9f1f626596eb338a276561 2.8
|
||||||
|
3a5910fac3ccb522a98aeeba7af7008530b25092 2.9
|
||||||
|
4
LICENSE
4
LICENSE
@ -1,7 +1,7 @@
|
|||||||
MIT/X Consortium License
|
MIT/X Consortium License
|
||||||
|
|
||||||
(C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
(C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
(C)opyright MMVI Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
(C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
# dwm - dynamic window manager
|
# dwm - dynamic window manager
|
||||||
# (C)opyright MMVI Anselm R. Garbe
|
# (C)opyright MMVII Anselm R. Garbe
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
|
6
client.c
6
client.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
@ -96,7 +96,7 @@ focus(Client *c) {
|
|||||||
sel = c;
|
sel = c;
|
||||||
if(old) {
|
if(old) {
|
||||||
grabbuttons(old, False);
|
grabbuttons(old, False);
|
||||||
drawtitle(old);
|
drawclient(old);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(c) {
|
if(c) {
|
||||||
@ -104,7 +104,7 @@ focus(Client *c) {
|
|||||||
c->snext = stack;
|
c->snext = stack;
|
||||||
stack = c;
|
stack = c;
|
||||||
grabbuttons(c, True);
|
grabbuttons(c, True);
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
45
config.arg.h
45
config.arg.h
@ -1,31 +1,32 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "dev", "work", "net", "fnord", NULL };
|
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
||||||
|
|
||||||
#define DEFMODE dotile /* dofloat */
|
#define DEFMODE dotile /* dofloat */
|
||||||
#define FLOATSYMBOL "><>"
|
#define FLOATSYMBOL "><>"
|
||||||
#define TILESYMBOL "[]="
|
#define TILESYMBOL "[%u]=" /* %u is replaced with nmaster */
|
||||||
|
|
||||||
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
||||||
#define NORMBGCOLOR "#333333"
|
#define NORMBGCOLOR "#222"
|
||||||
#define NORMFGCOLOR "#cccccc"
|
#define NORMFGCOLOR "#ccc"
|
||||||
#define SELBGCOLOR "#336699"
|
#define SELBGCOLOR "#444"
|
||||||
#define SELFGCOLOR "#dddddd"
|
#define SELFGCOLOR "#fff"
|
||||||
#define STATUSBGCOLOR "#222222"
|
#define STATUSBGCOLOR "#333"
|
||||||
#define STATUSFGCOLOR "#99ccff"
|
#define STATUSFGCOLOR "#9cf"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
#define MASTER 600 /* per thousand */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
#define SNAP 40 /* pixel */
|
#define SNAP 40 /* pixel */
|
||||||
|
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
static Key key[] = { \
|
static Key key[] = { \
|
||||||
/* modifier key function argument */ \
|
/* modifier key function argument */ \
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
||||||
{ .cmd = "exec uxterm -bg black -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
|
{ .cmd = "exec uxterm -bg '#222' -fg '#eee' -cr '#eee' +sb -fn '"FONT"'" } }, \
|
||||||
{ MODKEY, XK_p, spawn, \
|
{ MODKEY, XK_p, spawn, \
|
||||||
{ .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \
|
{ .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \
|
||||||
" | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' " \
|
" | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' " \
|
||||||
@ -35,15 +36,27 @@ static Key key[] = { \
|
|||||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
||||||
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
||||||
{ MODKEY, XK_s, resizemaster, { .i = -15 } }, \
|
{ MODKEY, XK_s, resizemaster, { .i = -15 } }, \
|
||||||
|
{ MODKEY, XK_i, incnmaster, { .i = 1 } }, \
|
||||||
|
{ MODKEY, XK_d, incnmaster, { .i = -1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, { .i = -1 } }, \
|
{ MODKEY|ShiftMask, XK_0, tag, { .i = -1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_6, tag, { .i = 5 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_7, tag, { .i = 6 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_8, tag, { .i = 7 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_9, tag, { .i = 8 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, { .i = 5 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, { .i = 6 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, { .i = 7 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, { .i = 8 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
||||||
@ -52,17 +65,27 @@ static Key key[] = { \
|
|||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
||||||
|
{ MODKEY, XK_5, view, { .i = 4 } }, \
|
||||||
|
{ MODKEY, XK_6, view, { .i = 5 } }, \
|
||||||
|
{ MODKEY, XK_7, view, { .i = 6 } }, \
|
||||||
|
{ MODKEY, XK_8, view, { .i = 7 } }, \
|
||||||
|
{ MODKEY, XK_9, view, { .i = 8 } }, \
|
||||||
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_6, toggleview, { .i = 5 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_7, toggleview, { .i = 6 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_8, toggleview, { .i = 7 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RULES \
|
#define RULES \
|
||||||
static Rule rule[] = { \
|
static Rule rule[] = { \
|
||||||
/* class:instance:title regex tags regex isfloat */ \
|
/* class:instance:title regex tags regex isfloat */ \
|
||||||
{ "Firefox.*", "net", False }, \
|
{ "Firefox.*", "3", False }, \
|
||||||
{ "Gimp.*", NULL, True }, \
|
{ "Gimp.*", NULL, True }, \
|
||||||
{ "MPlayer.*", NULL, True }, \
|
{ "MPlayer.*", NULL, True }, \
|
||||||
{ "Acroread.*", NULL, True }, \
|
{ "Acroread.*", NULL, True }, \
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "1", "2", "3", "4", "5", NULL };
|
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
||||||
|
|
||||||
#define DEFMODE dotile /* dofloat */
|
#define DEFMODE dotile /* dofloat */
|
||||||
#define FLOATSYMBOL "><>"
|
#define FLOATSYMBOL "><>"
|
||||||
#define TILESYMBOL "[]="
|
#define TILESYMBOL "[%u]=" /* %u is replaced with nmaster */
|
||||||
|
|
||||||
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
||||||
#define NORMBGCOLOR "#333366"
|
#define NORMBGCOLOR "#333366"
|
||||||
@ -19,6 +19,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL };
|
|||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
#define MASTER 600 /* per thousand */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
#define SNAP 20 /* pixel */
|
#define SNAP 20 /* pixel */
|
||||||
|
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
@ -30,17 +31,27 @@ static Key key[] = { \
|
|||||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
||||||
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
||||||
{ MODKEY, XK_s, resizemaster, { .i = -15 } }, \
|
{ MODKEY, XK_s, resizemaster, { .i = -15 } }, \
|
||||||
|
{ MODKEY, XK_i, incnmaster, { .i = 1 } }, \
|
||||||
|
{ MODKEY, XK_d, incnmaster, { .i = -1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, { .i = -1 } }, \
|
{ MODKEY|ShiftMask, XK_0, tag, { .i = -1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
|
{ MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_6, tag, { .i = 5 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_7, tag, { .i = 6 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_8, tag, { .i = 7 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_9, tag, { .i = 8 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, { .i = 5 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, { .i = 6 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, { .i = 7 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, { .i = 8 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
||||||
@ -50,11 +61,19 @@ static Key key[] = { \
|
|||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
||||||
{ MODKEY, XK_5, view, { .i = 4 } }, \
|
{ MODKEY, XK_5, view, { .i = 4 } }, \
|
||||||
|
{ MODKEY, XK_6, view, { .i = 5 } }, \
|
||||||
|
{ MODKEY, XK_7, view, { .i = 6 } }, \
|
||||||
|
{ MODKEY, XK_8, view, { .i = 7 } }, \
|
||||||
|
{ MODKEY, XK_9, view, { .i = 8 } }, \
|
||||||
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
||||||
{ MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
|
{ MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_6, toggleview, { .i = 5 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_7, toggleview, { .i = 6 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_8, toggleview, { .i = 7 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 2.8
|
VERSION = 3.0
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
8
draw.c
8
draw.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMIV-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
@ -102,7 +102,7 @@ drawall(void) {
|
|||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
for(c = clients; c; c = getnext(c->next))
|
for(c = clients; c; c = getnext(c->next))
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
drawstatus();
|
drawstatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ drawstatus(void) {
|
|||||||
dc.x += dc.w;
|
dc.x += dc.w;
|
||||||
}
|
}
|
||||||
dc.w = bmw;
|
dc.w = bmw;
|
||||||
drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False, False);
|
drawtext(mtext, dc.status, False, False);
|
||||||
x = dc.x + dc.w;
|
x = dc.x + dc.w;
|
||||||
dc.w = textw(stext);
|
dc.w = textw(stext);
|
||||||
dc.x = bw - dc.w;
|
dc.x = bw - dc.w;
|
||||||
@ -138,7 +138,7 @@ drawstatus(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
drawtitle(Client *c) {
|
drawclient(Client *c) {
|
||||||
if(c == sel && issel) {
|
if(c == sel && issel) {
|
||||||
drawstatus();
|
drawstatus();
|
||||||
XUnmapWindow(dpy, c->twin);
|
XUnmapWindow(dpy, c->twin);
|
||||||
|
16
dwm.1
16
dwm.1
@ -10,10 +10,10 @@ floating modes. Either mode can be applied dynamically, optimizing the
|
|||||||
environment for the application in use and the task performed.
|
environment for the application in use and the task performed.
|
||||||
.P
|
.P
|
||||||
In tiling mode windows are managed in a master and stacking area. The master
|
In tiling mode windows are managed in a master and stacking area. The master
|
||||||
area contains the window which currently needs most attention, whereas the
|
area contains the windows which currently need most attention, whereas the
|
||||||
stacking area contains all other windows. In floating mode windows can be
|
stacking area contains all other windows. In floating mode windows can be
|
||||||
resized and moved freely. Dialog windows are always managed floating,
|
resized and moved freely. Dialog windows are always managed floating,
|
||||||
regardless of the mode selected.
|
regardless of the mode applied.
|
||||||
.P
|
.P
|
||||||
Windows are grouped by tags. Each window can be tagged with one or multiple
|
Windows are grouped by tags. Each window can be tagged with one or multiple
|
||||||
tags. Selecting certain tags displays all windows with these tags.
|
tags. Selecting certain tags displays all windows with these tags.
|
||||||
@ -44,6 +44,12 @@ label toggles between tiling and floating mode.
|
|||||||
.B Button3
|
.B Button3
|
||||||
click on a tag label adds/removes all windows with that tag to/from the view.
|
click on a tag label adds/removes all windows with that tag to/from the view.
|
||||||
.TP
|
.TP
|
||||||
|
.B Button4
|
||||||
|
click on the mode label increases the number of windows in the master area (tiling mode only).
|
||||||
|
.TP
|
||||||
|
.B Button5
|
||||||
|
click on the mode label decreases the number of windows in the master area (tiling mode only).
|
||||||
|
.TP
|
||||||
.B Mod1-Button1
|
.B Mod1-Button1
|
||||||
click on a tag label applies that tag to the focused window.
|
click on a tag label applies that tag to the focused window.
|
||||||
.TP
|
.TP
|
||||||
@ -70,6 +76,12 @@ Grow master area (tiling mode only).
|
|||||||
.B Mod1-s
|
.B Mod1-s
|
||||||
Shrink master area (tiling mode only).
|
Shrink master area (tiling mode only).
|
||||||
.TP
|
.TP
|
||||||
|
.B Mod1-i
|
||||||
|
Increase the number of windows in the master area (tiling mode only).
|
||||||
|
.TP
|
||||||
|
.B Mod1-d
|
||||||
|
Decrease the number of windows in the master area (tiling mode only).
|
||||||
|
.TP
|
||||||
.B Mod1-Shift-[1..n]
|
.B Mod1-Shift-[1..n]
|
||||||
Apply
|
Apply
|
||||||
.RB nth
|
.RB nth
|
||||||
|
10
dwm.h
10
dwm.h
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*
|
*
|
||||||
* dynamic window manager is designed like any other X client as well. It is
|
* dynamic window manager is designed like any other X client as well. It is
|
||||||
@ -93,10 +93,12 @@ struct Client {
|
|||||||
|
|
||||||
extern const char *tags[]; /* all tags */
|
extern const char *tags[]; /* all tags */
|
||||||
extern char stext[1024]; /* status text */
|
extern char stext[1024]; /* status text */
|
||||||
|
extern char mtext[32]; /* mode text */
|
||||||
extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */
|
extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */
|
||||||
extern int screen, sx, sy, sw, sh; /* screen geometry */
|
extern int screen, sx, sy, sw, sh; /* screen geometry */
|
||||||
extern int wax, way, wah, waw; /* windowarea geometry */
|
extern int wax, way, wah, waw; /* windowarea geometry */
|
||||||
extern unsigned int master, ntags, numlockmask; /* master percent, number of tags, dynamic lock mask */
|
extern unsigned int master, nmaster; /* master percent, number of master clients */
|
||||||
|
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 void (*arrange)(void); /* arrange function, indicates mode */
|
extern void (*arrange)(void); /* arrange function, indicates mode */
|
||||||
extern Atom wmatom[WMLast], netatom[NetLast];
|
extern Atom wmatom[WMLast], netatom[NetLast];
|
||||||
@ -124,7 +126,7 @@ extern void unmanage(Client *c); /* destroy c */
|
|||||||
/* draw.c */
|
/* draw.c */
|
||||||
extern void drawall(void); /* draw all visible client titles and the bar */
|
extern void drawall(void); /* draw all visible client titles and the bar */
|
||||||
extern void drawstatus(void); /* draw the bar */
|
extern void drawstatus(void); /* draw the bar */
|
||||||
extern void drawtitle(Client *c); /* draw title of c */
|
extern void drawclient(Client *c); /* draw title and set border of c */
|
||||||
extern unsigned long getcolor(const char *colstr); /* return color of colstr */
|
extern unsigned long getcolor(const char *colstr); /* return color of colstr */
|
||||||
extern void setfont(const char *fontstr); /* set the font for DC */
|
extern void setfont(const char *fontstr); /* set the font for DC */
|
||||||
extern unsigned int textw(const char *text); /* return the width of text in px*/
|
extern unsigned int textw(const char *text); /* return the width of text in px*/
|
||||||
@ -159,11 +161,13 @@ extern void dofloat(void); /* arranges all windows floating */
|
|||||||
extern void dotile(void); /* arranges all windows tiled */
|
extern void dotile(void); /* arranges all windows tiled */
|
||||||
extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */
|
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 focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */
|
||||||
|
extern void incnmaster(Arg *arg); /* increments nmaster with arg's index value */
|
||||||
extern Bool isvisible(Client *c); /* returns True if client is visible */
|
extern Bool isvisible(Client *c); /* returns True if client is visible */
|
||||||
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 togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */
|
extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */
|
||||||
extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */
|
extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */
|
||||||
extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */
|
extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */
|
||||||
|
extern void updatemodetext(void); /* updates mtext */
|
||||||
extern void view(Arg *arg); /* views the tag with arg's index */
|
extern void view(Arg *arg); /* views the tag with arg's index */
|
||||||
extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */
|
extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */
|
||||||
|
22
event.c
22
event.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
@ -131,8 +131,20 @@ buttonpress(XEvent *e) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((ev->x < x + bmw) && (ev->button == Button1))
|
if(ev->x < x + bmw)
|
||||||
togglemode(NULL);
|
switch(ev->button) {
|
||||||
|
case Button1:
|
||||||
|
togglemode(NULL);
|
||||||
|
break;
|
||||||
|
case Button4:
|
||||||
|
a.i = 1;
|
||||||
|
incnmaster(&a);
|
||||||
|
break;
|
||||||
|
case Button5:
|
||||||
|
a.i = -1;
|
||||||
|
incnmaster(&a);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if((c = getclient(ev->window))) {
|
else if((c = getclient(ev->window))) {
|
||||||
focus(c);
|
focus(c);
|
||||||
@ -236,7 +248,7 @@ expose(XEvent *e) {
|
|||||||
if(barwin == ev->window)
|
if(barwin == ev->window)
|
||||||
drawstatus();
|
drawstatus();
|
||||||
else if((c = getctitle(ev->window)))
|
else if((c = getctitle(ev->window)))
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +332,7 @@ propertynotify(XEvent *e) {
|
|||||||
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
|
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
|
||||||
updatetitle(c);
|
updatetitle(c);
|
||||||
resizetitle(c);
|
resizetitle(c);
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
18
main.c
18
main.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
/* extern */
|
/* extern */
|
||||||
|
|
||||||
char stext[1024];
|
char stext[1024], mtext[32];
|
||||||
Bool *seltag;
|
Bool *seltag;
|
||||||
int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah;
|
int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah;
|
||||||
unsigned int master, ntags, numlockmask;
|
unsigned int master, nmaster, ntags, numlockmask;
|
||||||
Atom wmatom[WMLast], netatom[NetLast];
|
Atom wmatom[WMLast], netatom[NetLast];
|
||||||
Bool running = True;
|
Bool running = True;
|
||||||
Bool issel = True;
|
Bool issel = True;
|
||||||
@ -40,9 +40,9 @@ static Bool otherwm, readin;
|
|||||||
static void
|
static void
|
||||||
cleanup(void) {
|
cleanup(void) {
|
||||||
close(STDIN_FILENO);
|
close(STDIN_FILENO);
|
||||||
while(clients) {
|
while(stack) {
|
||||||
resize(clients, True, TopLeft);
|
resize(stack, True, TopLeft);
|
||||||
unmanage(clients);
|
unmanage(stack);
|
||||||
}
|
}
|
||||||
if(dc.font.set)
|
if(dc.font.set)
|
||||||
XFreeFontSet(dpy, dc.font.set);
|
XFreeFontSet(dpy, dc.font.set);
|
||||||
@ -101,6 +101,7 @@ setup(void) {
|
|||||||
cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
|
cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
|
||||||
cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
|
cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
|
||||||
/* init modifier map */
|
/* init modifier map */
|
||||||
|
numlockmask = 0;
|
||||||
modmap = XGetModifierMapping(dpy);
|
modmap = XGetModifierMapping(dpy);
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
for (j = 0; j < modmap->max_keypermod; j++) {
|
for (j = 0; j < modmap->max_keypermod; j++) {
|
||||||
@ -128,11 +129,12 @@ setup(void) {
|
|||||||
dc.status[ColFG] = getcolor(STATUSFGCOLOR);
|
dc.status[ColFG] = getcolor(STATUSFGCOLOR);
|
||||||
setfont(FONT);
|
setfont(FONT);
|
||||||
/* geometry */
|
/* geometry */
|
||||||
bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL);
|
|
||||||
sx = sy = 0;
|
sx = sy = 0;
|
||||||
sw = DisplayWidth(dpy, screen);
|
sw = DisplayWidth(dpy, screen);
|
||||||
sh = DisplayHeight(dpy, screen);
|
sh = DisplayHeight(dpy, screen);
|
||||||
master = MASTER;
|
master = MASTER;
|
||||||
|
nmaster = NMASTER;
|
||||||
|
updatemodetext();
|
||||||
/* bar */
|
/* bar */
|
||||||
bx = sx;
|
bx = sx;
|
||||||
by = sy;
|
by = sy;
|
||||||
@ -236,7 +238,7 @@ main(int argc, char *argv[]) {
|
|||||||
fd_set rd;
|
fd_set rd;
|
||||||
|
|
||||||
if(argc == 2 && !strncmp("-v", argv[1], 3)) {
|
if(argc == 2 && !strncmp("-v", argv[1], 3)) {
|
||||||
fputs("dwm-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
|
fputs("dwm-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n", stdout);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
else if(argc != 1)
|
else if(argc != 1)
|
||||||
|
2
tag.c
2
tag.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
|
2
util.c
2
util.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
|
56
view.c
56
view.c
@ -1,7 +1,8 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
|
||||||
@ -69,12 +70,16 @@ dofloat(void) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
dotile(void) {
|
dotile(void) {
|
||||||
unsigned int i, n, mpw, th;
|
unsigned int i, n, mw, mh, tw, th;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
||||||
n++;
|
n++;
|
||||||
mpw = (waw * master) / 1000;
|
/* window geoms */
|
||||||
|
mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
|
||||||
|
mw = (n > nmaster) ? (waw * master) / 1000 : waw;
|
||||||
|
th = (n > nmaster) ? wah / (n - nmaster) : 0;
|
||||||
|
tw = waw - mw;
|
||||||
|
|
||||||
for(i = 0, c = clients; c; c = c->next)
|
for(i = 0, c = clients; c; c = c->next)
|
||||||
if(isvisible(c)) {
|
if(isvisible(c)) {
|
||||||
@ -85,20 +90,16 @@ dotile(void) {
|
|||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
c->x = wax;
|
c->x = wax;
|
||||||
c->y = way;
|
c->y = way;
|
||||||
if(n == 1) { /* only 1 window */
|
if(i < nmaster) {
|
||||||
c->w = waw - 2 * BORDERPX;
|
c->y += i * mh;
|
||||||
c->h = wah - 2 * BORDERPX;
|
c->w = mw - 2 * BORDERPX;
|
||||||
}
|
c->h = mh - 2 * BORDERPX;
|
||||||
else if(i == 0) { /* master window */
|
|
||||||
c->w = mpw - 2 * BORDERPX;
|
|
||||||
c->h = wah - 2 * BORDERPX;
|
|
||||||
th = wah / (n - 1);
|
|
||||||
}
|
}
|
||||||
else { /* tile window */
|
else { /* tile window */
|
||||||
c->x += mpw;
|
c->x += mw;
|
||||||
c->w = (waw - mpw) - 2 * BORDERPX;
|
c->w = tw - 2 * BORDERPX;
|
||||||
if(th > bh) {
|
if(th > bh) {
|
||||||
c->y += (i - 1) * th;
|
c->y += (i - nmaster) * th;
|
||||||
c->h = th - 2 * BORDERPX;
|
c->h = th - 2 * BORDERPX;
|
||||||
}
|
}
|
||||||
else /* fallback if th < bh */
|
else /* fallback if th < bh */
|
||||||
@ -147,6 +148,18 @@ focusprev(Arg *arg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
incnmaster(Arg *arg) {
|
||||||
|
if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
|
||||||
|
return;
|
||||||
|
nmaster += arg->i;
|
||||||
|
updatemodetext();
|
||||||
|
if(sel)
|
||||||
|
arrange();
|
||||||
|
else
|
||||||
|
drawstatus();
|
||||||
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
isvisible(Client *c) {
|
isvisible(Client *c) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -210,6 +223,7 @@ togglefloat(Arg *arg) {
|
|||||||
void
|
void
|
||||||
togglemode(Arg *arg) {
|
togglemode(Arg *arg) {
|
||||||
arrange = (arrange == dofloat) ? dotile : dofloat;
|
arrange = (arrange == dofloat) ? dotile : dofloat;
|
||||||
|
updatemodetext();
|
||||||
if(sel)
|
if(sel)
|
||||||
arrange();
|
arrange();
|
||||||
else
|
else
|
||||||
@ -227,6 +241,12 @@ toggleview(Arg *arg) {
|
|||||||
arrange();
|
arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
updatemodetext() {
|
||||||
|
snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
|
||||||
|
bmw = textw(mtext);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
view(Arg *arg) {
|
view(Arg *arg) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -249,11 +269,9 @@ zoom(Arg *arg) {
|
|||||||
togglemax(sel);
|
togglemax(sel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(n = 0, c = clients; c; c = c->next)
|
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
||||||
if(isvisible(c) && !c->isfloat)
|
n++;
|
||||||
n++;
|
|
||||||
if(n < 2 || (arrange == dofloat))
|
|
||||||
return;
|
|
||||||
if((c = sel) == nexttiled(clients))
|
if((c = sel) == nexttiled(clients))
|
||||||
if(!(c = nexttiled(c->next)))
|
if(!(c = nexttiled(c->next)))
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user