Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
b5d297f02f | |||
9056d7ea88 | |||
ebd17e4827 | |||
7e59c89250 | |||
9e4e4d9022 | |||
71fd06f843 | |||
58e6866d86 | |||
c7da124149 | |||
21bd90d7d3 | |||
c8f96b5b4c | |||
ded60365d4 | |||
629647dfee | |||
4ca3d861f0 | |||
069e7a6e24 | |||
ac6e34ea06 | |||
a308b7507a | |||
630e7ff26f | |||
3764ab471b | |||
a3319c6f8e | |||
66c699a701 | |||
aaf1e44da9 | |||
1ef2307ec4 | |||
d42c3ba2dc | |||
4b06155873 | |||
857d825eeb | |||
6b345353e3 | |||
ab3b3a8f61 | |||
71b82fb1f6 | |||
9bd9ea423e | |||
99964398e7 | |||
7009ebfa69 | |||
760e23dd3a | |||
c53d9d516a | |||
7739e6b466 | |||
4881857458 | |||
c73d5cb7b6 | |||
6458803d21 | |||
6e72d781f7 | |||
4e926a9ef2 | |||
4ba3cfaee9 | |||
e655e8a7d5 | |||
c34e4e4b39 | |||
a678ee6365 | |||
49f0ee329d | |||
0c9d9a3d94 | |||
89e1acb0bb | |||
c2ed26b711 | |||
42fd392e05 | |||
e06447ee88 | |||
683dabe5e6 | |||
3aff96177c | |||
0a915eba8f | |||
19dcbc5717 | |||
d2a4952956 | |||
0c97b21b61 | |||
19390b1a91 | |||
8dc86051df | |||
46d5f9d1bf | |||
35e96b8deb | |||
2210ea7e3b | |||
61a1910f91 | |||
27ef73507b | |||
2b35fb643e | |||
478f6f95f1 | |||
44411d2d48 | |||
a2175cf71a |
6
.hgtags
6
.hgtags
@ -21,3 +21,9 @@ a5567a0d30112822db2627a04a2e7aa3b6c38148 1.9
|
|||||||
12deea36603da407e3f32640048846a3bd74a9ec 2.0
|
12deea36603da407e3f32640048846a3bd74a9ec 2.0
|
||||||
a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
|
a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
|
||||||
7e92f58754ae6edb3225f26d754bd89c1ff458cf 2.2
|
7e92f58754ae6edb3225f26d754bd89c1ff458cf 2.2
|
||||||
|
719b37b37b0df829d7cf017ac70e353088fe5849 2.3
|
||||||
|
32b246925086910d63147483160281a91a47479f 2.4
|
||||||
|
dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5
|
||||||
|
c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1
|
||||||
|
5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6
|
||||||
|
21951c0dfbae5af68ed77821a4d87253ee91803f 2.7
|
||||||
|
64
client.c
64
client.c
@ -131,58 +131,6 @@ getctitle(Window w) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gravitate(Client *c, Bool invert) {
|
|
||||||
int dx = 0, dy = 0;
|
|
||||||
|
|
||||||
switch(c->grav) {
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
case StaticGravity:
|
|
||||||
case NorthWestGravity:
|
|
||||||
case NorthGravity:
|
|
||||||
case NorthEastGravity:
|
|
||||||
dy = c->border;
|
|
||||||
break;
|
|
||||||
case EastGravity:
|
|
||||||
case CenterGravity:
|
|
||||||
case WestGravity:
|
|
||||||
dy = -(c->h / 2) + c->border;
|
|
||||||
break;
|
|
||||||
case SouthEastGravity:
|
|
||||||
case SouthGravity:
|
|
||||||
case SouthWestGravity:
|
|
||||||
dy = -(c->h);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
switch (c->grav) {
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
case StaticGravity:
|
|
||||||
case NorthWestGravity:
|
|
||||||
case WestGravity:
|
|
||||||
case SouthWestGravity:
|
|
||||||
dx = c->border;
|
|
||||||
break;
|
|
||||||
case NorthGravity:
|
|
||||||
case CenterGravity:
|
|
||||||
case SouthGravity:
|
|
||||||
dx = -(c->w / 2) + c->border;
|
|
||||||
break;
|
|
||||||
case NorthEastGravity:
|
|
||||||
case EastGravity:
|
|
||||||
case SouthEastGravity:
|
|
||||||
dx = -(c->w + c->border);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(invert) {
|
|
||||||
dx = -dx;
|
|
||||||
dy = -dy;
|
|
||||||
}
|
|
||||||
c->x += dx;
|
|
||||||
c->y += dy;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
killclient(Arg *arg) {
|
killclient(Arg *arg) {
|
||||||
if(!sel)
|
if(!sel)
|
||||||
@ -208,7 +156,7 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
c->w = c->tw = wa->width;
|
c->w = c->tw = wa->width;
|
||||||
c->h = wa->height;
|
c->h = wa->height;
|
||||||
c->th = bh;
|
c->th = bh;
|
||||||
updatesize(c);
|
updatesizehints(c);
|
||||||
if(c->x + c->w + 2 * BORDERPX > sw)
|
if(c->x + c->w + 2 * BORDERPX > sw)
|
||||||
c->x = sw - c->w - 2 * BORDERPX;
|
c->x = sw - c->w - 2 * BORDERPX;
|
||||||
if(c->x < sx)
|
if(c->x < sx)
|
||||||
@ -308,7 +256,7 @@ resizetitle(Client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
updatesize(Client *c) {
|
updatesizehints(Client *c) {
|
||||||
long msize;
|
long msize;
|
||||||
XSizeHints size;
|
XSizeHints size;
|
||||||
|
|
||||||
@ -341,10 +289,6 @@ updatesize(Client *c) {
|
|||||||
c->minw = c->minh = 0;
|
c->minw = c->minh = 0;
|
||||||
c->isfixed = (c->maxw && c->minw && c->maxh && c->minh &&
|
c->isfixed = (c->maxw && c->minw && c->maxh && c->minh &&
|
||||||
c->maxw == c->minw && c->maxh == c->minh);
|
c->maxw == c->minw && c->maxh == c->minh);
|
||||||
if(c->flags & PWinGravity)
|
|
||||||
c->grav = size.win_gravity;
|
|
||||||
else
|
|
||||||
c->grav = NorthWestGravity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -361,12 +305,12 @@ updatetitle(Client *c) {
|
|||||||
if(!name.nitems)
|
if(!name.nitems)
|
||||||
return;
|
return;
|
||||||
if(name.encoding == XA_STRING)
|
if(name.encoding == XA_STRING)
|
||||||
strncpy(c->name, (char *)name.value, sizeof(c->name));
|
strncpy(c->name, (char *)name.value, sizeof c->name);
|
||||||
else {
|
else {
|
||||||
if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
|
if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
|
||||||
&& n > 0 && *list)
|
&& n > 0 && *list)
|
||||||
{
|
{
|
||||||
strncpy(c->name, *list, sizeof(c->name));
|
strncpy(c->name, *list, sizeof c->name);
|
||||||
XFreeStringList(list);
|
XFreeStringList(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
22
config.arg.h
22
config.arg.h
@ -9,32 +9,33 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL };
|
|||||||
#define FLOATSYMBOL "><>"
|
#define FLOATSYMBOL "><>"
|
||||||
#define TILESYMBOL "[]="
|
#define TILESYMBOL "[]="
|
||||||
|
|
||||||
#define FONT "-*-terminus-medium-*-*-*-14-*-*-*-*-*-iso10646-*"
|
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
||||||
#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"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
#define MASTER 600 /* per thousand */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
#define SNAP 40 /* pixel */
|
#define SNAP 40 /* pixel */
|
||||||
|
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
static Key key[] = { \
|
static Key key[] = { \
|
||||||
/* modifier key function arguments */ \
|
/* modifier key function argument */ \
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
||||||
{ .cmd = "exec urxvtc -tr -bg black -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
|
{ .cmd = "exec uxterm -bg black -fg '#eeeeee' -cr '#eeeeee' +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 -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \
|
" | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' " \
|
||||||
"-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \
|
"-sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"')\" && exec $exe" } }, \
|
||||||
{ MODKEY, XK_j, focusnext, { 0 } }, \
|
{ MODKEY, XK_j, focusnext, { 0 } }, \
|
||||||
{ MODKEY, XK_k, focusprev, { 0 } }, \
|
{ MODKEY, XK_k, focusprev, { 0 } }, \
|
||||||
{ 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 } }, \
|
||||||
@ -45,7 +46,8 @@ static Key key[] = { \
|
|||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
{ MODKEY, XK_0, viewall, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloat, { 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 } }, \
|
||||||
|
@ -9,7 +9,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL };
|
|||||||
#define FLOATSYMBOL "><>"
|
#define FLOATSYMBOL "><>"
|
||||||
#define TILESYMBOL "[]="
|
#define TILESYMBOL "[]="
|
||||||
|
|
||||||
#define FONT "fixed"
|
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
||||||
#define NORMBGCOLOR "#333366"
|
#define NORMBGCOLOR "#333366"
|
||||||
#define NORMFGCOLOR "#cccccc"
|
#define NORMFGCOLOR "#cccccc"
|
||||||
#define SELBGCOLOR "#666699"
|
#define SELBGCOLOR "#666699"
|
||||||
@ -17,19 +17,20 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL };
|
|||||||
#define STATUSBGCOLOR "#dddddd"
|
#define STATUSBGCOLOR "#dddddd"
|
||||||
#define STATUSFGCOLOR "#222222"
|
#define STATUSFGCOLOR "#222222"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
#define MASTER 600 /* per thousand */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
#define SNAP 20 /* pixel */
|
#define SNAP 20 /* pixel */
|
||||||
|
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
static Key key[] = { \
|
static Key key[] = { \
|
||||||
/* modifier key function arguments */ \
|
/* modifier key function argument */ \
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, { .cmd = "exec xterm" } }, \
|
{ MODKEY|ShiftMask, XK_Return, spawn, { .cmd = "exec xterm" } }, \
|
||||||
{ MODKEY, XK_Tab, focusnext, { 0 } }, \
|
{ MODKEY, XK_Tab, focusnext, { 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \
|
||||||
{ 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 } }, \
|
||||||
@ -42,7 +43,8 @@ static Key key[] = { \
|
|||||||
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
{ MODKEY, XK_0, viewall, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloat, { 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.3
|
VERSION = 2.8
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
@ -20,6 +20,11 @@ LDFLAGS = ${LIBS}
|
|||||||
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
|
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
|
||||||
#LDFLAGS = -g ${LIBS}
|
#LDFLAGS = -g ${LIBS}
|
||||||
|
|
||||||
|
# Solaris
|
||||||
|
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||||
|
#LDFLAGS = ${LIBS}
|
||||||
|
#CFLAGS += -xtarget=ultra
|
||||||
|
|
||||||
# compiler and linker
|
# compiler and linker
|
||||||
CC = cc
|
CC = cc
|
||||||
LD = ${CC}
|
LD = ${CC}
|
||||||
|
48
draw.c
48
draw.c
@ -4,7 +4,6 @@
|
|||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <X11/Xlocale.h>
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
|
||||||
@ -30,12 +29,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);
|
||||||
@ -43,8 +43,8 @@ drawtext(const char *text, unsigned long col[ColLast], Bool ldot, Bool rdot) {
|
|||||||
return;
|
return;
|
||||||
w = 0;
|
w = 0;
|
||||||
olen = len = strlen(text);
|
olen = len = strlen(text);
|
||||||
if(len >= sizeof(buf))
|
if(len >= sizeof buf)
|
||||||
len = sizeof(buf) - 1;
|
len = sizeof buf - 1;
|
||||||
memcpy(buf, text, len);
|
memcpy(buf, text, len);
|
||||||
buf[len] = 0;
|
buf[len] = 0;
|
||||||
h = dc.font.ascent + dc.font.descent;
|
h = dc.font.ascent + dc.font.descent;
|
||||||
@ -73,17 +73,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,11 +166,10 @@ getcolor(const char *colstr) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
setfont(const char *fontstr) {
|
setfont(const char *fontstr) {
|
||||||
char **missing, *def;
|
char *def, **missing;
|
||||||
int i, n;
|
int i, n;
|
||||||
|
|
||||||
missing = NULL;
|
missing = NULL;
|
||||||
setlocale(LC_ALL, "");
|
|
||||||
if(dc.font.set)
|
if(dc.font.set)
|
||||||
XFreeFontSet(dpy, dc.font.set);
|
XFreeFontSet(dpy, dc.font.set);
|
||||||
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
|
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
|
||||||
@ -170,10 +177,6 @@ setfont(const char *fontstr) {
|
|||||||
while(n--)
|
while(n--)
|
||||||
fprintf(stderr, "missing fontset: %s\n", missing[n]);
|
fprintf(stderr, "missing fontset: %s\n", missing[n]);
|
||||||
XFreeStringList(missing);
|
XFreeStringList(missing);
|
||||||
if(dc.font.set) {
|
|
||||||
XFreeFontSet(dpy, dc.font.set);
|
|
||||||
dc.font.set = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(dc.font.set) {
|
if(dc.font.set) {
|
||||||
XFontSetExtents *font_extents;
|
XFontSetExtents *font_extents;
|
||||||
@ -194,11 +197,8 @@ setfont(const char *fontstr) {
|
|||||||
if(dc.font.xfont)
|
if(dc.font.xfont)
|
||||||
XFreeFont(dpy, dc.font.xfont);
|
XFreeFont(dpy, dc.font.xfont);
|
||||||
dc.font.xfont = NULL;
|
dc.font.xfont = NULL;
|
||||||
dc.font.xfont = XLoadQueryFont(dpy, fontstr);
|
if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)))
|
||||||
if (!dc.font.xfont)
|
eprint("error, cannot load font: '%s'\n", fontstr);
|
||||||
dc.font.xfont = XLoadQueryFont(dpy, "fixed");
|
|
||||||
if (!dc.font.xfont)
|
|
||||||
eprint("error, cannot init 'fixed' font\n");
|
|
||||||
dc.font.ascent = dc.font.xfont->ascent;
|
dc.font.ascent = dc.font.xfont->ascent;
|
||||||
dc.font.descent = dc.font.xfont->descent;
|
dc.font.descent = dc.font.xfont->descent;
|
||||||
}
|
}
|
||||||
|
26
dwm.1
26
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 by any client are indicated with a small point in the bottom
|
which are applied to one or more windows 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
|
||||||
@ -86,6 +89,9 @@ Close focused window.
|
|||||||
.B Mod1-space
|
.B Mod1-space
|
||||||
Toggle between tiling and floating mode (affects all windows).
|
Toggle between tiling and floating mode (affects all windows).
|
||||||
.TP
|
.TP
|
||||||
|
.B Mod1-Shift-space
|
||||||
|
Toggle focused window between floating and non-floating state (tiling mode only).
|
||||||
|
.TP
|
||||||
.B Mod1-[1..n]
|
.B Mod1-[1..n]
|
||||||
View all windows with
|
View all windows with
|
||||||
.BR nth
|
.BR nth
|
||||||
@ -116,9 +122,17 @@ dwm is customized by creating a custom config.h and (re)compiling the source
|
|||||||
code. This keeps it fast, secure and simple.
|
code. This keeps it fast, secure and simple.
|
||||||
.SH CAVEATS
|
.SH CAVEATS
|
||||||
The status bar may display
|
The status bar may display
|
||||||
.BR "broken pipe"
|
.BR "EOF"
|
||||||
when dwm has been started by
|
when dwm has been started by an X session manager like
|
||||||
.BR xdm (1),
|
.BR xdm (1),
|
||||||
because it closes standard output before executing dwm.
|
because those close standard output before executing dwm.
|
||||||
|
.P
|
||||||
|
Java applications which use the XToolkit/XAWT backend may draw grey windows
|
||||||
|
only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early
|
||||||
|
JDK 1.6 versions, because it assumes a reparenting window manager. As a workaround
|
||||||
|
you can use JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or you
|
||||||
|
can set the following environment variable (to use the older Motif
|
||||||
|
backend instead):
|
||||||
|
.BR AWT_TOOLKIT=MToolkit .
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR dmenu (1)
|
.BR dmenu (1)
|
||||||
|
6
dwm.h
6
dwm.h
@ -80,7 +80,6 @@ struct Client {
|
|||||||
int rx, ry, rw, rh; /* revert geometry */
|
int rx, ry, rw, rh; /* revert geometry */
|
||||||
int tx, ty, tw, th; /* title window geometry */
|
int tx, ty, tw, th; /* title window geometry */
|
||||||
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
||||||
int grav;
|
|
||||||
long flags;
|
long flags;
|
||||||
unsigned int border;
|
unsigned int border;
|
||||||
Bool isfloat, isfixed, ismax;
|
Bool isfloat, isfixed, ismax;
|
||||||
@ -114,12 +113,11 @@ 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 Client *getclient(Window w); /* return client of w */
|
extern Client *getclient(Window w); /* return client of w */
|
||||||
extern Client *getctitle(Window w); /* return client of title window */
|
extern Client *getctitle(Window w); /* return client of title window */
|
||||||
extern void gravitate(Client *c, Bool invert); /* gravitate c */
|
|
||||||
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 void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
|
extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
|
||||||
extern void resizetitle(Client *c); /* resizes c->twin correctly */
|
extern void resizetitle(Client *c); /* resizes c->twin correctly */
|
||||||
extern void updatesize(Client *c); /* update the size structs 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 */
|
||||||
|
|
||||||
@ -164,8 +162,8 @@ extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ign
|
|||||||
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 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 */
|
||||||
|
9
event.c
9
event.c
@ -161,7 +161,6 @@ configurerequest(XEvent *e) {
|
|||||||
|
|
||||||
if((c = getclient(ev->window))) {
|
if((c = getclient(ev->window))) {
|
||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
gravitate(c, True);
|
|
||||||
if(ev->value_mask & CWX)
|
if(ev->value_mask & CWX)
|
||||||
c->x = ev->x;
|
c->x = ev->x;
|
||||||
if(ev->value_mask & CWY)
|
if(ev->value_mask & CWY)
|
||||||
@ -172,7 +171,6 @@ configurerequest(XEvent *e) {
|
|||||||
c->h = ev->height;
|
c->h = ev->height;
|
||||||
if(ev->value_mask & CWBorderWidth)
|
if(ev->value_mask & CWBorderWidth)
|
||||||
c->border = ev->border_width;
|
c->border = ev->border_width;
|
||||||
gravitate(c, False);
|
|
||||||
wc.x = c->x;
|
wc.x = c->x;
|
||||||
wc.y = c->y;
|
wc.y = c->y;
|
||||||
wc.width = c->w;
|
wc.width = c->w;
|
||||||
@ -244,7 +242,7 @@ expose(XEvent *e) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
keypress(XEvent *e) {
|
keypress(XEvent *e) {
|
||||||
static unsigned int len = sizeof(key) / sizeof(key[0]);
|
static unsigned int len = sizeof key / sizeof key[0];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
XKeyEvent *ev = &e->xkey;
|
XKeyEvent *ev = &e->xkey;
|
||||||
@ -256,7 +254,6 @@ keypress(XEvent *e) {
|
|||||||
{
|
{
|
||||||
if(key[i].func)
|
if(key[i].func)
|
||||||
key[i].func(&key[i].arg);
|
key[i].func(&key[i].arg);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -317,7 +314,7 @@ propertynotify(XEvent *e) {
|
|||||||
arrange();
|
arrange();
|
||||||
break;
|
break;
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XA_WM_NORMAL_HINTS:
|
||||||
updatesize(c);
|
updatesizehints(c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
|
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
|
||||||
@ -355,7 +352,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
|
|||||||
|
|
||||||
void
|
void
|
||||||
grabkeys(void) {
|
grabkeys(void) {
|
||||||
static unsigned int len = sizeof(key) / sizeof(key[0]);
|
static unsigned int len = sizeof key / sizeof key[0];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
KeyCode code;
|
KeyCode code;
|
||||||
|
|
||||||
|
54
main.c
54
main.c
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <locale.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -39,9 +40,9 @@ static Bool otherwm, readin;
|
|||||||
static void
|
static void
|
||||||
cleanup(void) {
|
cleanup(void) {
|
||||||
close(STDIN_FILENO);
|
close(STDIN_FILENO);
|
||||||
while(sel) {
|
while(clients) {
|
||||||
resize(sel, True, TopLeft);
|
resize(clients, True, TopLeft);
|
||||||
unmanage(sel);
|
unmanage(clients);
|
||||||
}
|
}
|
||||||
if(dc.font.set)
|
if(dc.font.set)
|
||||||
XFreeFontSet(dpy, dc.font.set);
|
XFreeFontSet(dpy, dc.font.set);
|
||||||
@ -51,6 +52,9 @@ cleanup(void) {
|
|||||||
XFreePixmap(dpy, dc.drawable);
|
XFreePixmap(dpy, dc.drawable);
|
||||||
XFreeGC(dpy, dc.gc);
|
XFreeGC(dpy, dc.gc);
|
||||||
XDestroyWindow(dpy, barwin);
|
XDestroyWindow(dpy, barwin);
|
||||||
|
XFreeCursor(dpy, cursor[CurNormal]);
|
||||||
|
XFreeCursor(dpy, cursor[CurResize]);
|
||||||
|
XFreeCursor(dpy, cursor[CurMove]);
|
||||||
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
free(seltag);
|
free(seltag);
|
||||||
@ -104,7 +108,7 @@ setup(void) {
|
|||||||
numlockmask = (1 << i);
|
numlockmask = (1 << i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XFree(modmap);
|
XFreeModifiermap(modmap);
|
||||||
/* select for events */
|
/* select for events */
|
||||||
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
|
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
|
||||||
| EnterWindowMask | LeaveWindowMask;
|
| EnterWindowMask | LeaveWindowMask;
|
||||||
@ -227,6 +231,7 @@ xerror(Display *dpy, XErrorEvent *ee) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
|
char *p;
|
||||||
int r, xfd;
|
int r, xfd;
|
||||||
fd_set rd;
|
fd_set rd;
|
||||||
|
|
||||||
@ -236,6 +241,7 @@ main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
else if(argc != 1)
|
else if(argc != 1)
|
||||||
eprint("usage: dwm [-v]\n");
|
eprint("usage: dwm [-v]\n");
|
||||||
|
setlocale(LC_CTYPE, "");
|
||||||
dpy = XOpenDisplay(0);
|
dpy = XOpenDisplay(0);
|
||||||
if(!dpy)
|
if(!dpy)
|
||||||
eprint("dwm: cannot open display\n");
|
eprint("dwm: cannot open display\n");
|
||||||
@ -267,22 +273,32 @@ main(int argc, char *argv[]) {
|
|||||||
if(readin)
|
if(readin)
|
||||||
FD_SET(STDIN_FILENO, &rd);
|
FD_SET(STDIN_FILENO, &rd);
|
||||||
FD_SET(xfd, &rd);
|
FD_SET(xfd, &rd);
|
||||||
r = select(xfd + 1, &rd, NULL, NULL, NULL);
|
if(select(xfd + 1, &rd, NULL, NULL, NULL) == -1) {
|
||||||
if((r == -1) && (errno == EINTR))
|
if(errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
if(r > 0) {
|
|
||||||
if(readin && FD_ISSET(STDIN_FILENO, &rd)) {
|
|
||||||
readin = NULL != fgets(stext, sizeof(stext), stdin);
|
|
||||||
if(readin)
|
|
||||||
stext[strlen(stext) - 1] = 0;
|
|
||||||
else
|
|
||||||
strcpy(stext, "broken pipe");
|
|
||||||
drawstatus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(r < 0)
|
|
||||||
eprint("select failed\n");
|
eprint("select failed\n");
|
||||||
procevent();
|
}
|
||||||
|
if(FD_ISSET(STDIN_FILENO, &rd)) {
|
||||||
|
switch(r = read(STDIN_FILENO, stext, sizeof stext - 1)) {
|
||||||
|
case -1:
|
||||||
|
strncpy(stext, strerror(errno), sizeof stext - 1);
|
||||||
|
stext[sizeof stext - 1] = '\0';
|
||||||
|
readin = False;
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
strncpy(stext, "EOF", 4);
|
||||||
|
readin = False;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0');
|
||||||
|
for(p = stext + strlen(stext) - 1; p >= stext && *p != '\n'; --p);
|
||||||
|
if(p > stext)
|
||||||
|
strncpy(stext, p + 1, sizeof stext);
|
||||||
|
}
|
||||||
|
drawstatus();
|
||||||
|
}
|
||||||
|
if(FD_ISSET(xfd, &rd))
|
||||||
|
procevent();
|
||||||
}
|
}
|
||||||
cleanup();
|
cleanup();
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
|
15
tag.c
15
tag.c
@ -50,19 +50,19 @@ initrregs(void) {
|
|||||||
|
|
||||||
if(rreg)
|
if(rreg)
|
||||||
return;
|
return;
|
||||||
len = sizeof(rule) / sizeof(rule[0]);
|
len = sizeof rule / sizeof rule[0];
|
||||||
rreg = emallocz(len * sizeof(RReg));
|
rreg = emallocz(len * sizeof(RReg));
|
||||||
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;
|
||||||
@ -83,10 +83,10 @@ settags(Client *c, Client *trans) {
|
|||||||
c->tags[i] = trans->tags[i];
|
c->tags[i] = trans->tags[i];
|
||||||
}
|
}
|
||||||
else if(XGetClassHint(dpy, c->win, &ch)) {
|
else if(XGetClassHint(dpy, c->win, &ch)) {
|
||||||
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,8 +113,9 @@ 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;
|
if(arg->i >= 0 && arg->i < ntags)
|
||||||
|
sel->tags[arg->i] = True;
|
||||||
arrange();
|
arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
35
view.c
35
view.c
@ -69,13 +69,12 @@ dofloat(void) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
dotile(void) {
|
dotile(void) {
|
||||||
unsigned int i, n, mpx, stackw, th;
|
unsigned int i, n, mpw, 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++;
|
||||||
mpx = (waw * master) / 1000;
|
mpw = (waw * master) / 1000;
|
||||||
stackw = waw - mpx;
|
|
||||||
|
|
||||||
for(i = 0, c = clients; c; c = c->next)
|
for(i = 0, c = clients; c; c = c->next)
|
||||||
if(isvisible(c)) {
|
if(isvisible(c)) {
|
||||||
@ -91,15 +90,15 @@ dotile(void) {
|
|||||||
c->h = wah - 2 * BORDERPX;
|
c->h = wah - 2 * BORDERPX;
|
||||||
}
|
}
|
||||||
else if(i == 0) { /* master window */
|
else if(i == 0) { /* master window */
|
||||||
c->w = waw - stackw - 2 * BORDERPX;
|
c->w = mpw - 2 * BORDERPX;
|
||||||
c->h = wah - 2 * BORDERPX;
|
c->h = wah - 2 * BORDERPX;
|
||||||
th = wah / (n - 1);
|
th = wah / (n - 1);
|
||||||
}
|
}
|
||||||
else { /* tile window */
|
else { /* tile window */
|
||||||
c->x += mpx;
|
c->x += mpw;
|
||||||
c->w = stackw - 2 * BORDERPX;
|
c->w = (waw - mpw) - 2 * BORDERPX;
|
||||||
if(th > bh) {
|
if(th > bh) {
|
||||||
c->y = way + (i - 1) * th;
|
c->y += (i - 1) * th;
|
||||||
c->h = th - 2 * BORDERPX;
|
c->h = th - 2 * BORDERPX;
|
||||||
}
|
}
|
||||||
else /* fallback if th < bh */
|
else /* fallback if th < bh */
|
||||||
@ -200,6 +199,14 @@ restack(void) {
|
|||||||
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
togglefloat(Arg *arg) {
|
||||||
|
if (!sel || arrange == dofloat)
|
||||||
|
return;
|
||||||
|
sel->isfloat = !sel->isfloat;
|
||||||
|
arrange();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
togglemode(Arg *arg) {
|
togglemode(Arg *arg) {
|
||||||
arrange = (arrange == dofloat) ? dotile : dofloat;
|
arrange = (arrange == dofloat) ? dotile : dofloat;
|
||||||
@ -225,17 +232,9 @@ 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;
|
if(arg->i >= 0 && arg->i < ntags)
|
||||||
arrange();
|
seltag[arg->i] = True;
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
viewall(Arg *arg) {
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for(i = 0; i < ntags; i++)
|
|
||||||
seltag[i] = True;
|
|
||||||
arrange();
|
arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user