Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
c53d9d516a | |||
7739e6b466 | |||
4881857458 | |||
c73d5cb7b6 | |||
6458803d21 | |||
6e72d781f7 | |||
4e926a9ef2 | |||
4ba3cfaee9 | |||
e655e8a7d5 | |||
c34e4e4b39 | |||
a678ee6365 | |||
49f0ee329d | |||
0c9d9a3d94 | |||
89e1acb0bb | |||
c2ed26b711 | |||
42fd392e05 | |||
e06447ee88 |
1
.hgtags
1
.hgtags
@ -22,3 +22,4 @@ a5567a0d30112822db2627a04a2e7aa3b6c38148 1.9
|
|||||||
a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
|
a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
|
||||||
7e92f58754ae6edb3225f26d754bd89c1ff458cf 2.2
|
7e92f58754ae6edb3225f26d754bd89c1ff458cf 2.2
|
||||||
719b37b37b0df829d7cf017ac70e353088fe5849 2.3
|
719b37b37b0df829d7cf017ac70e353088fe5849 2.3
|
||||||
|
32b246925086910d63147483160281a91a47479f 2.4
|
||||||
|
@ -11,9 +11,9 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL };
|
|||||||
|
|
||||||
#define FONT "-*-terminus-medium-*-*-*-14-*-*-*-*-*-iso10646-*"
|
#define FONT "-*-terminus-medium-*-*-*-14-*-*-*-*-*-iso10646-*"
|
||||||
#define NORMBGCOLOR "#333333"
|
#define NORMBGCOLOR "#333333"
|
||||||
#define NORMFGCOLOR "#dddddd"
|
#define NORMFGCOLOR "#cccccc"
|
||||||
#define SELBGCOLOR "#336699"
|
#define SELBGCOLOR "#336699"
|
||||||
#define SELFGCOLOR "#eeeeee"
|
#define SELFGCOLOR "#dddddd"
|
||||||
#define STATUSBGCOLOR "#222222"
|
#define STATUSBGCOLOR "#222222"
|
||||||
#define STATUSFGCOLOR "#99ccff"
|
#define STATUSFGCOLOR "#99ccff"
|
||||||
|
|
||||||
@ -35,6 +35,7 @@ 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|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 } }, \
|
||||||
@ -46,7 +47,7 @@ static Key key[] = { \
|
|||||||
{ 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 } }, \
|
||||||
{ MODKEY, XK_0, viewall, { 0 } }, \
|
{ MODKEY, XK_0, view, { .i = -1 } }, \
|
||||||
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
|
@ -30,6 +30,7 @@ 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|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 } }, \
|
||||||
@ -43,7 +44,7 @@ static Key key[] = { \
|
|||||||
{ 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 } }, \
|
||||||
{ MODKEY, XK_0, viewall, { 0 } }, \
|
{ MODKEY, XK_0, view, { .i = -1 } }, \
|
||||||
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 2.4
|
VERSION = 2.5
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
29
draw.c
29
draw.c
@ -30,12 +30,13 @@ textnw(const char *text, unsigned int len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawtext(const char *text, unsigned long col[ColLast], Bool ldot, Bool rdot) {
|
drawtext(const char *text, unsigned long col[ColLast], Bool filledsquare, Bool emptysquare) {
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
unsigned int len, olen;
|
unsigned int len, olen;
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
|
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
|
||||||
|
XPoint pt[5];
|
||||||
|
|
||||||
XSetForeground(dpy, dc.gc, col[ColBG]);
|
XSetForeground(dpy, dc.gc, col[ColBG]);
|
||||||
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
|
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
|
||||||
@ -73,17 +74,25 @@ drawtext(const char *text, unsigned long col[ColLast], Bool ldot, Bool rdot) {
|
|||||||
XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv);
|
XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv);
|
||||||
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
|
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
|
||||||
}
|
}
|
||||||
if(ldot) {
|
x = (h + 2) / 4;
|
||||||
r.x = dc.x + 2;
|
if(filledsquare) {
|
||||||
r.y = dc.y + 2;
|
r.x = dc.x + 1;
|
||||||
r.width = r.height = (h + 2) / 4;
|
r.y = dc.y + 1;
|
||||||
|
r.width = r.height = x + 1;
|
||||||
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
|
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
|
||||||
}
|
}
|
||||||
if(rdot) {
|
else if(emptysquare) {
|
||||||
r.width = r.height = (h + 2) / 4;
|
pt[0].x = dc.x + 1;
|
||||||
r.x = dc.x + dc.w - r.width - 2;
|
pt[0].y = dc.y + 1;
|
||||||
r.y = dc.y + dc.h - r.height - 2;
|
pt[1].x = x;
|
||||||
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
|
pt[1].y = 0;
|
||||||
|
pt[2].x = 0;
|
||||||
|
pt[2].y = x;
|
||||||
|
pt[3].x = -x;
|
||||||
|
pt[3].y = 0;
|
||||||
|
pt[4].x = 0;
|
||||||
|
pt[4].y = -x;
|
||||||
|
XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
dwm.1
9
dwm.1
@ -21,9 +21,9 @@ tags. Selecting certain tags displays all windows with these tags.
|
|||||||
dwm contains a small status bar which displays all available tags, the mode,
|
dwm contains a small status bar which displays all available tags, the mode,
|
||||||
the title of the focused window, and the text read from standard input. The
|
the title of the focused window, and the text read from standard input. The
|
||||||
selected tags are indicated with a different color. The tags of the focused
|
selected tags are indicated with a different color. The tags of the focused
|
||||||
window are indicated with a small point in the top left corner. The tags which
|
window are indicated with a filled square in the top left corner. The tags
|
||||||
are applied to one or more clients are indicated with a small point in the bottom
|
which are applied to one or more clients are indicated with an empty square in
|
||||||
right corner.
|
the top left corner.
|
||||||
.P
|
.P
|
||||||
dwm draws a 1-pixel border around windows to indicate the focus state.
|
dwm draws a 1-pixel border around windows to indicate the focus state.
|
||||||
Unfocused windows contain a small bar in front of them displaying their title.
|
Unfocused windows contain a small bar in front of them displaying their title.
|
||||||
@ -75,6 +75,9 @@ Apply
|
|||||||
.RB nth
|
.RB nth
|
||||||
tag to current window.
|
tag to current window.
|
||||||
.TP
|
.TP
|
||||||
|
.B Mod1-Shift-0
|
||||||
|
Apply all tags to current window.
|
||||||
|
.TP
|
||||||
.B Mod1-Control-Shift-[1..n]
|
.B Mod1-Control-Shift-[1..n]
|
||||||
Add/remove
|
Add/remove
|
||||||
.B nth
|
.B nth
|
||||||
|
1
dwm.h
1
dwm.h
@ -168,5 +168,4 @@ extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/
|
|||||||
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 view(Arg *arg); /* views the tag with arg's index */
|
extern void view(Arg *arg); /* views the tag with arg's index */
|
||||||
extern void viewall(Arg *arg); /* views all tags, arg is ignored */
|
|
||||||
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 */
|
||||||
|
8
tag.c
8
tag.c
@ -55,14 +55,14 @@ initrregs(void) {
|
|||||||
for(i = 0; i < len; i++) {
|
for(i = 0; i < len; i++) {
|
||||||
if(rule[i].clpattern) {
|
if(rule[i].clpattern) {
|
||||||
reg = emallocz(sizeof(regex_t));
|
reg = emallocz(sizeof(regex_t));
|
||||||
if(regcomp(reg, rule[i].clpattern, 0))
|
if(regcomp(reg, rule[i].clpattern, REG_EXTENDED))
|
||||||
free(reg);
|
free(reg);
|
||||||
else
|
else
|
||||||
rreg[i].clregex = reg;
|
rreg[i].clregex = reg;
|
||||||
}
|
}
|
||||||
if(rule[i].tpattern) {
|
if(rule[i].tpattern) {
|
||||||
reg = emallocz(sizeof(regex_t));
|
reg = emallocz(sizeof(regex_t));
|
||||||
if(regcomp(reg, rule[i].tpattern, 0))
|
if(regcomp(reg, rule[i].tpattern, REG_EXTENDED))
|
||||||
free(reg);
|
free(reg);
|
||||||
else
|
else
|
||||||
rreg[i].tregex = reg;
|
rreg[i].tregex = reg;
|
||||||
@ -86,7 +86,7 @@ settags(Client *c, Client *trans) {
|
|||||||
snprintf(prop, sizeof prop, "%s:%s:%s",
|
snprintf(prop, sizeof prop, "%s:%s:%s",
|
||||||
ch.res_class ? ch.res_class : "",
|
ch.res_class ? ch.res_class : "",
|
||||||
ch.res_name ? ch.res_name : "", c->name);
|
ch.res_name ? ch.res_name : "", c->name);
|
||||||
for(i = 0; !matched && i < len; i++)
|
for(i = 0; i < len; i++)
|
||||||
if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
|
if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
|
||||||
c->isfloat = rule[i].isfloat;
|
c->isfloat = rule[i].isfloat;
|
||||||
for(j = 0; rreg[i].tregex && j < ntags; j++) {
|
for(j = 0; rreg[i].tregex && j < ntags; j++) {
|
||||||
@ -113,7 +113,7 @@ tag(Arg *arg) {
|
|||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
for(i = 0; i < ntags; i++)
|
for(i = 0; i < ntags; i++)
|
||||||
sel->tags[i] = False;
|
sel->tags[i] = (arg->i == -1) ? True : False;
|
||||||
sel->tags[arg->i] = True;
|
sel->tags[arg->i] = True;
|
||||||
arrange();
|
arrange();
|
||||||
}
|
}
|
||||||
|
11
view.c
11
view.c
@ -233,20 +233,11 @@ view(Arg *arg) {
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for(i = 0; i < ntags; i++)
|
for(i = 0; i < ntags; i++)
|
||||||
seltag[i] = False;
|
seltag[i] = (arg->i == -1) ? True : False;
|
||||||
seltag[arg->i] = True;
|
seltag[arg->i] = True;
|
||||||
arrange();
|
arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
viewall(Arg *arg) {
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for(i = 0; i < ntags; i++)
|
|
||||||
seltag[i] = True;
|
|
||||||
arrange();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
zoom(Arg *arg) {
|
zoom(Arg *arg) {
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
|
Reference in New Issue
Block a user