Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
7009ebfa69 | |||
760e23dd3a | |||
c53d9d516a | |||
7739e6b466 | |||
4881857458 | |||
c73d5cb7b6 | |||
6458803d21 | |||
6e72d781f7 | |||
4e926a9ef2 | |||
4ba3cfaee9 | |||
e655e8a7d5 | |||
c34e4e4b39 | |||
a678ee6365 | |||
49f0ee329d | |||
0c9d9a3d94 | |||
89e1acb0bb | |||
c2ed26b711 | |||
42fd392e05 | |||
e06447ee88 |
2
.hgtags
2
.hgtags
@ -22,3 +22,5 @@ a5567a0d30112822db2627a04a2e7aa3b6c38148 1.9
|
||||
a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
|
||||
7e92f58754ae6edb3225f26d754bd89c1ff458cf 2.2
|
||||
719b37b37b0df829d7cf017ac70e353088fe5849 2.3
|
||||
32b246925086910d63147483160281a91a47479f 2.4
|
||||
dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5
|
||||
|
@ -11,9 +11,9 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL };
|
||||
|
||||
#define FONT "-*-terminus-medium-*-*-*-14-*-*-*-*-*-iso10646-*"
|
||||
#define NORMBGCOLOR "#333333"
|
||||
#define NORMFGCOLOR "#dddddd"
|
||||
#define NORMFGCOLOR "#cccccc"
|
||||
#define SELBGCOLOR "#336699"
|
||||
#define SELFGCOLOR "#eeeeee"
|
||||
#define SELFGCOLOR "#dddddd"
|
||||
#define STATUSBGCOLOR "#222222"
|
||||
#define STATUSFGCOLOR "#99ccff"
|
||||
|
||||
@ -35,6 +35,7 @@ static Key key[] = { \
|
||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
||||
{ MODKEY, XK_g, 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_2, tag, { .i = 1 } }, \
|
||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
||||
@ -46,7 +47,7 @@ static Key key[] = { \
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||
{ MODKEY, XK_space, togglemode, { 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_2, view, { .i = 1 } }, \
|
||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||
|
@ -30,6 +30,7 @@ static Key key[] = { \
|
||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
||||
{ MODKEY, XK_g, 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_2, tag, { .i = 1 } }, \
|
||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
||||
@ -43,7 +44,7 @@ static Key key[] = { \
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||
{ MODKEY, XK_space, togglemode, { 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_2, view, { .i = 1 } }, \
|
||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||
|
@ -1,5 +1,5 @@
|
||||
# dwm version
|
||||
VERSION = 2.4
|
||||
VERSION = 2.5.1
|
||||
|
||||
# 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
|
||||
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;
|
||||
static char buf[256];
|
||||
unsigned int len, olen;
|
||||
XGCValues gcv;
|
||||
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
|
||||
XPoint pt[5];
|
||||
|
||||
XSetForeground(dpy, dc.gc, col[ColBG]);
|
||||
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);
|
||||
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
|
||||
}
|
||||
if(ldot) {
|
||||
r.x = dc.x + 2;
|
||||
r.y = dc.y + 2;
|
||||
r.width = r.height = (h + 2) / 4;
|
||||
x = (h + 2) / 4;
|
||||
if(filledsquare) {
|
||||
r.x = dc.x + 1;
|
||||
r.y = dc.y + 1;
|
||||
r.width = r.height = x + 1;
|
||||
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
|
||||
}
|
||||
if(rdot) {
|
||||
r.width = r.height = (h + 2) / 4;
|
||||
r.x = dc.x + dc.w - r.width - 2;
|
||||
r.y = dc.y + dc.h - r.height - 2;
|
||||
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
|
||||
else if(emptysquare) {
|
||||
pt[0].x = dc.x + 1;
|
||||
pt[0].y = dc.y + 1;
|
||||
pt[1].x = x;
|
||||
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,
|
||||
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
|
||||
window are indicated with a small point in the top left corner. The tags which
|
||||
are applied to one or more clients are indicated with a small point in the bottom
|
||||
right corner.
|
||||
window are indicated with a filled square in the top left corner. The tags
|
||||
which are applied to one or more clients are indicated with an empty square in
|
||||
the top left corner.
|
||||
.P
|
||||
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.
|
||||
@ -75,6 +75,9 @@ Apply
|
||||
.RB nth
|
||||
tag to current window.
|
||||
.TP
|
||||
.B Mod1-Shift-0
|
||||
Apply all tags to current window.
|
||||
.TP
|
||||
.B Mod1-Control-Shift-[1..n]
|
||||
Add/remove
|
||||
.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 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 viewall(Arg *arg); /* views all tags, arg is ignored */
|
||||
extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */
|
||||
|
11
tag.c
11
tag.c
@ -55,14 +55,14 @@ initrregs(void) {
|
||||
for(i = 0; i < len; i++) {
|
||||
if(rule[i].clpattern) {
|
||||
reg = emallocz(sizeof(regex_t));
|
||||
if(regcomp(reg, rule[i].clpattern, 0))
|
||||
if(regcomp(reg, rule[i].clpattern, REG_EXTENDED))
|
||||
free(reg);
|
||||
else
|
||||
rreg[i].clregex = reg;
|
||||
}
|
||||
if(rule[i].tpattern) {
|
||||
reg = emallocz(sizeof(regex_t));
|
||||
if(regcomp(reg, rule[i].tpattern, 0))
|
||||
if(regcomp(reg, rule[i].tpattern, REG_EXTENDED))
|
||||
free(reg);
|
||||
else
|
||||
rreg[i].tregex = reg;
|
||||
@ -86,7 +86,7 @@ settags(Client *c, Client *trans) {
|
||||
snprintf(prop, sizeof prop, "%s:%s:%s",
|
||||
ch.res_class ? ch.res_class : "",
|
||||
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)) {
|
||||
c->isfloat = rule[i].isfloat;
|
||||
for(j = 0; rreg[i].tregex && j < ntags; j++) {
|
||||
@ -113,8 +113,9 @@ tag(Arg *arg) {
|
||||
if(!sel)
|
||||
return;
|
||||
for(i = 0; i < ntags; i++)
|
||||
sel->tags[i] = False;
|
||||
sel->tags[arg->i] = True;
|
||||
sel->tags[i] = (arg->i == -1) ? True : False;
|
||||
if(arg->i >= 0 && arg->i < ntags)
|
||||
sel->tags[arg->i] = True;
|
||||
arrange();
|
||||
}
|
||||
|
||||
|
14
view.c
14
view.c
@ -233,17 +233,9 @@ view(Arg *arg) {
|
||||
unsigned int i;
|
||||
|
||||
for(i = 0; i < ntags; i++)
|
||||
seltag[i] = False;
|
||||
seltag[arg->i] = True;
|
||||
arrange();
|
||||
}
|
||||
|
||||
void
|
||||
viewall(Arg *arg) {
|
||||
unsigned int i;
|
||||
|
||||
for(i = 0; i < ntags; i++)
|
||||
seltag[i] = True;
|
||||
seltag[i] = (arg->i == -1) ? True : False;
|
||||
if(arg->i >= 0 && arg->i < ntags)
|
||||
seltag[arg->i] = True;
|
||||
arrange();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user