Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
22399a3bc0 | |||
ad2508f957 | |||
b078599833 | |||
1e80207876 | |||
464fc2cd18 | |||
be8d6d40f6 | |||
f0c2353393 | |||
a730213c3b | |||
399993c6b5 | |||
4d318060a2 | |||
540d5eed46 | |||
7d071ce2bd | |||
93aeaa53c9 | |||
06f9f346e6 | |||
5c48012ad2 | |||
a686c9ccd2 | |||
9ca5c3b108 | |||
bab5b1178d | |||
ee8fb0c6e4 | |||
0d9d3e79e9 |
3
.hgtags
3
.hgtags
@ -39,3 +39,6 @@ d3876aa792923f9a95f7ad0c7f0134533404df35 3.2.2
|
|||||||
63ad05e7f9e1f4f1881fb02f529cb6c6ae81e693 3.5
|
63ad05e7f9e1f4f1881fb02f529cb6c6ae81e693 3.5
|
||||||
75b1b25fe0d7e29400baf30568153f668324928b 3.6
|
75b1b25fe0d7e29400baf30568153f668324928b 3.6
|
||||||
20ec6976cee1fcfee0c2f354ae382ee3f9f68efa 3.6.1
|
20ec6976cee1fcfee0c2f354ae382ee3f9f68efa 3.6.1
|
||||||
|
baee494346e520f8dee2cee9491b8350064770d2 3.7
|
||||||
|
2ea201354cf016407ea93e1e390d1422940d29b0 3.8
|
||||||
|
55478328b2422c700c5404a774c85e77322f41a3 3.9
|
||||||
|
4
LICENSE
4
LICENSE
@ -1,7 +1,7 @@
|
|||||||
MIT/X Consortium License
|
MIT/X Consortium License
|
||||||
|
|
||||||
(C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
© 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
(C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
© 2006-2007 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-MMVII Anselm R. Garbe
|
# © 2006-2007 Anselm R. Garbe, Sander van Dijk
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
|
105
client.c
105
client.c
@ -1,6 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -154,18 +154,28 @@ focus(Client *c) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
killclient(const char *arg) {
|
killclient(const char *arg) {
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
if(isprotodel(sel))
|
if(isprotodel(sel)) {
|
||||||
sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
|
ev.type = ClientMessage;
|
||||||
|
ev.xclient.window = sel->win;
|
||||||
|
ev.xclient.message_type = wmatom[WMProtocols];
|
||||||
|
ev.xclient.format = 32;
|
||||||
|
ev.xclient.data.l[0] = wmatom[WMDelete];
|
||||||
|
ev.xclient.data.l[1] = CurrentTime;
|
||||||
|
XSendEvent(dpy, sel->win, False, NoEventMask, &ev);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
XKillClient(dpy, sel->win);
|
XKillClient(dpy, sel->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
manage(Window w, XWindowAttributes *wa) {
|
manage(Window w, XWindowAttributes *wa) {
|
||||||
Client *c, *t;
|
Client *c, *t = NULL;
|
||||||
Window trans;
|
Window trans;
|
||||||
|
Status rettrans;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
c = emallocz(sizeof(Client));
|
c = emallocz(sizeof(Client));
|
||||||
@ -175,13 +185,13 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
c->y = wa->y;
|
c->y = wa->y;
|
||||||
c->w = wa->width;
|
c->w = wa->width;
|
||||||
c->h = wa->height;
|
c->h = wa->height;
|
||||||
|
c->oldborder = wa->border_width;
|
||||||
if(c->w == sw && c->h == sh) {
|
if(c->w == sw && c->h == sh) {
|
||||||
c->border = 0;
|
|
||||||
c->x = sx;
|
c->x = sx;
|
||||||
c->y = sy;
|
c->y = sy;
|
||||||
|
c->border = wa->border_width;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
c->border = BORDERPX;
|
|
||||||
if(c->x + c->w + 2 * c->border > wax + waw)
|
if(c->x + c->w + 2 * c->border > wax + waw)
|
||||||
c->x = wax + waw - c->w - 2 * c->border;
|
c->x = wax + waw - c->w - 2 * c->border;
|
||||||
if(c->y + c->h + 2 * c->border > way + wah)
|
if(c->y + c->h + 2 * c->border > way + wah)
|
||||||
@ -190,21 +200,22 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
c->x = wax;
|
c->x = wax;
|
||||||
if(c->y < way)
|
if(c->y < way)
|
||||||
c->y = way;
|
c->y = way;
|
||||||
|
c->border = BORDERPX;
|
||||||
}
|
}
|
||||||
updatesizehints(c);
|
|
||||||
XSelectInput(dpy, w,
|
|
||||||
StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
|
|
||||||
XGetTransientForHint(dpy, w, &trans);
|
|
||||||
grabbuttons(c, False);
|
|
||||||
wc.border_width = c->border;
|
wc.border_width = c->border;
|
||||||
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
||||||
XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
|
XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
|
||||||
configure(c); /* propagates border_width, if size doesn't change */
|
configure(c); /* propagates border_width, if size doesn't change */
|
||||||
|
updatesizehints(c);
|
||||||
|
XSelectInput(dpy, w,
|
||||||
|
StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
|
||||||
|
grabbuttons(c, False);
|
||||||
updatetitle(c);
|
updatetitle(c);
|
||||||
|
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
|
||||||
for(t = clients; t && t->win != trans; t = t->next);
|
for(t = clients; t && t->win != trans; t = t->next);
|
||||||
settags(c, t);
|
settags(c, t);
|
||||||
if(!c->isfloating)
|
if(!c->isfloating)
|
||||||
c->isfloating = (t != NULL) || c->isfixed;
|
c->isfloating = (rettrans == Success) || c->isfixed;
|
||||||
attach(c);
|
attach(c);
|
||||||
attachstack(c);
|
attachstack(c);
|
||||||
c->isbanned = True;
|
c->isbanned = True;
|
||||||
@ -218,12 +229,33 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
|
|
||||||
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 dx, dy, max, min, ratio;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
if(w <= 0 || h <= 0)
|
if(w <= 0 || h <= 0)
|
||||||
return;
|
return;
|
||||||
if(sizehints) {
|
if(sizehints) {
|
||||||
|
if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0) {
|
||||||
|
dx = (float)(w - c->basew);
|
||||||
|
dy = (float)(h - c->baseh);
|
||||||
|
min = (float)(c->minax) / (float)(c->minay);
|
||||||
|
max = (float)(c->maxax) / (float)(c->maxay);
|
||||||
|
ratio = dx / dy;
|
||||||
|
if(max > 0 && min > 0 && ratio > 0) {
|
||||||
|
if(ratio < min) {
|
||||||
|
dy = (dx * min + dy) / (min * min + 1);
|
||||||
|
dx = dy * min;
|
||||||
|
w = (int)dx + c->basew;
|
||||||
|
h = (int)dy + c->baseh;
|
||||||
|
}
|
||||||
|
else if(ratio > max) {
|
||||||
|
dy = (dx * min + dy) / (max * max + 1);
|
||||||
|
dx = dy * min;
|
||||||
|
w = (int)dx + c->basew;
|
||||||
|
h = (int)dy + c->baseh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(c->minw && w < c->minw)
|
if(c->minw && w < c->minw)
|
||||||
w = c->minw;
|
w = c->minw;
|
||||||
if(c->minh && h < c->minh)
|
if(c->minh && h < c->minh)
|
||||||
@ -232,37 +264,13 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
|||||||
w = c->maxw;
|
w = c->maxw;
|
||||||
if(c->maxh && h > c->maxh)
|
if(c->maxh && h > c->maxh)
|
||||||
h = c->maxh;
|
h = c->maxh;
|
||||||
/* inspired by algorithm from fluxbox */
|
|
||||||
if(c->minay > 0 && c->maxay && (h - c->baseh) > 0) {
|
|
||||||
dx = (float)(w - c->basew);
|
|
||||||
dy = (float)(h - c->baseh);
|
|
||||||
min = (float)(c->minax) / (float)(c->minay);
|
|
||||||
max = (float)(c->maxax) / (float)(c->maxay);
|
|
||||||
actual = dx / dy;
|
|
||||||
if(max > 0 && min > 0 && actual > 0) {
|
|
||||||
if(actual < min) {
|
|
||||||
dy = (dx * min + dy) / (min * min + 1);
|
|
||||||
dx = dy * min;
|
|
||||||
w = (int)dx + c->basew;
|
|
||||||
h = (int)dy + c->baseh;
|
|
||||||
}
|
|
||||||
else if(actual > max) {
|
|
||||||
dy = (dx * min + dy) / (max * max + 1);
|
|
||||||
dx = dy * min;
|
|
||||||
w = (int)dx + c->basew;
|
|
||||||
h = (int)dy + c->baseh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(c->incw)
|
if(c->incw)
|
||||||
w -= (w - c->basew) % c->incw;
|
w -= (w - c->basew) % c->incw;
|
||||||
if(c->inch)
|
if(c->inch)
|
||||||
h -= (h - c->baseh) % c->inch;
|
h -= (h - c->baseh) % c->inch;
|
||||||
}
|
}
|
||||||
if(w == sw && h == sh)
|
if(w <= 0 || h <= 0)
|
||||||
c->border = 0;
|
return;
|
||||||
else
|
|
||||||
c->border = BORDERPX;
|
|
||||||
/* offscreen appearance fixes */
|
/* offscreen appearance fixes */
|
||||||
if(x > sw)
|
if(x > sw)
|
||||||
x = sw - w - 2 * c->border;
|
x = sw - w - 2 * c->border;
|
||||||
@ -304,6 +312,10 @@ updatesizehints(Client *c) {
|
|||||||
c->basew = size.base_width;
|
c->basew = size.base_width;
|
||||||
c->baseh = size.base_height;
|
c->baseh = size.base_height;
|
||||||
}
|
}
|
||||||
|
else if(c->flags & PMinSize) {
|
||||||
|
c->basew = size.min_width;
|
||||||
|
c->baseh = size.min_height;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
c->basew = c->baseh = 0;
|
c->basew = c->baseh = 0;
|
||||||
if(c->flags & PResizeInc) {
|
if(c->flags & PResizeInc) {
|
||||||
@ -322,16 +334,20 @@ updatesizehints(Client *c) {
|
|||||||
c->minw = size.min_width;
|
c->minw = size.min_width;
|
||||||
c->minh = size.min_height;
|
c->minh = size.min_height;
|
||||||
}
|
}
|
||||||
|
else if(c->flags & PBaseSize) {
|
||||||
|
c->minw = size.base_width;
|
||||||
|
c->minh = size.base_height;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
c->minw = c->minh = 0;
|
c->minw = c->minh = 0;
|
||||||
if(c->flags & PAspect) {
|
if(c->flags & PAspect) {
|
||||||
c->minax = size.min_aspect.x;
|
c->minax = size.min_aspect.x;
|
||||||
c->minay = size.min_aspect.y;
|
|
||||||
c->maxax = size.max_aspect.x;
|
c->maxax = size.max_aspect.x;
|
||||||
|
c->minay = size.min_aspect.y;
|
||||||
c->maxay = size.max_aspect.y;
|
c->maxay = size.max_aspect.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->minax = c->minay = c->maxax = c->maxay = 0;
|
c->minax = c->maxax = c->minay = c->maxay = 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);
|
||||||
}
|
}
|
||||||
@ -365,10 +381,13 @@ updatetitle(Client *c) {
|
|||||||
void
|
void
|
||||||
unmanage(Client *c) {
|
unmanage(Client *c) {
|
||||||
Client *nc;
|
Client *nc;
|
||||||
|
XWindowChanges wc;
|
||||||
|
|
||||||
|
wc.border_width = c->oldborder;
|
||||||
/* The server grab construct avoids race conditions. */
|
/* The server grab construct avoids race conditions. */
|
||||||
XGrabServer(dpy);
|
XGrabServer(dpy);
|
||||||
XSetErrorHandler(xerrordummy);
|
XSetErrorHandler(xerrordummy);
|
||||||
|
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
|
||||||
detach(c);
|
detach(c);
|
||||||
detachstack(c);
|
detachstack(c);
|
||||||
if(sel == c) {
|
if(sel == c) {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
#define BORDERPX 1
|
#define BORDERPX 1
|
||||||
#define FONT "-*-proggyclean-medium-r-*-*-13-*-*-*-*-*-*-*"
|
#define FONT "-*-pixelcarnage monospace-*-r-*-*-14-*-*-*-*-*-*-*"
|
||||||
#define NORMBORDERCOLOR "#333"
|
#define NORMBORDERCOLOR "#333"
|
||||||
#define NORMBGCOLOR "#222"
|
#define NORMBGCOLOR "#222"
|
||||||
#define NORMFGCOLOR "#ccc"
|
#define NORMFGCOLOR "#ccc"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
#define BORDERPX 1
|
#define BORDERPX 1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 3.7
|
VERSION = 4.0
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
18
draw.c
18
draw.c
@ -1,6 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -95,7 +95,6 @@ drawtext(const char *text, unsigned long col[ColLast]) {
|
|||||||
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;
|
|
||||||
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
|
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
|
||||||
|
|
||||||
XSetForeground(dpy, dc.gc, col[ColBG]);
|
XSetForeground(dpy, dc.gc, col[ColBG]);
|
||||||
@ -124,16 +123,11 @@ drawtext(const char *text, unsigned long col[ColLast]) {
|
|||||||
}
|
}
|
||||||
if(w > dc.w)
|
if(w > dc.w)
|
||||||
return; /* too long */
|
return; /* too long */
|
||||||
gcv.foreground = col[ColFG];
|
XSetForeground(dpy, dc.gc, col[ColFG]);
|
||||||
if(dc.font.set) {
|
if(dc.font.set)
|
||||||
XChangeGC(dpy, dc.gc, GCForeground, &gcv);
|
|
||||||
XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
|
XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
gcv.font = dc.font.xfont->fid;
|
|
||||||
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);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
|
50
dwm.1
50
dwm.1
@ -1,4 +1,4 @@
|
|||||||
.TH DWM 1 dwm-VERSION
|
.TH DWM 1 dwm\-VERSION
|
||||||
.SH NAME
|
.SH NAME
|
||||||
dwm \- dynamic window manager
|
dwm \- dynamic window manager
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -45,87 +45,87 @@ label toggles between tiled and floating layout.
|
|||||||
.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 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
|
||||||
.B Mod1-Button3
|
.B Mod1\-Button3
|
||||||
click on a tag label adds/removes that tag to/from the focused window.
|
click on a tag label adds/removes that tag to/from the focused window.
|
||||||
.SS Keyboard commands
|
.SS Keyboard commands
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-Return
|
.B Mod1\-Shift\-Return
|
||||||
Start
|
Start
|
||||||
.BR xterm.
|
.BR xterm.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Return
|
.B Mod1\-Return
|
||||||
Zooms/cycles current window to/from master area (tiled layout only).
|
Zooms/cycles current window to/from master area (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-j
|
.B Mod1\-j
|
||||||
Focus next window.
|
Focus next window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-k
|
.B Mod1\-k
|
||||||
Focus previous window.
|
Focus previous window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-j
|
.B Mod1\-Shift\-j
|
||||||
Increase the number of windows in the master area (tiled layout only).
|
Increase the number of windows in the master area (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-k
|
.B Mod1\-Shift\-k
|
||||||
Decrease the number of windows in the master area (tiled layout only).
|
Decrease the number of windows in the master area (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-l
|
.B Mod1\-l
|
||||||
Increase master area width (tiled layout only).
|
Increase master area width (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-h
|
.B Mod1\-h
|
||||||
Decrease master area width (tiled layout only).
|
Decrease master area width (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-m
|
.B Mod1\-m
|
||||||
Toggles maximization of current window (floating layout only).
|
Toggles maximization of current window (floating layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-[1..n]
|
.B Mod1\-Shift\-[1..n]
|
||||||
Apply
|
Apply
|
||||||
.RB nth
|
.RB nth
|
||||||
tag to current window.
|
tag to current window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-0
|
.B Mod1\-Shift\-0
|
||||||
Apply all tags to current window.
|
Apply all tags to current window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Control-Shift-[1..n]
|
.B Mod1\-Control\-Shift\-[1..n]
|
||||||
Add/remove
|
Add/remove
|
||||||
.B nth
|
.B nth
|
||||||
tag to/from current window.
|
tag to/from current window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-c
|
.B Mod1\-Shift\-c
|
||||||
Close focused window.
|
Close focused window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-space
|
.B Mod1\-space
|
||||||
Toggle between tiled and floating layout (affects all windows).
|
Toggle between tiled and floating layout (affects all windows).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-space
|
.B Mod1\-Shift\-space
|
||||||
Toggle focused window between tiled and floating state (tiled layout only).
|
Toggle focused window between tiled and floating state (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-[1..n]
|
.B Mod1\-[1..n]
|
||||||
View all windows with
|
View all windows with
|
||||||
.BR nth
|
.BR nth
|
||||||
tag.
|
tag.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-0
|
.B Mod1\-0
|
||||||
View all windows with any tag.
|
View all windows with any tag.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Control-[1..n]
|
.B Mod1\-Control\-[1..n]
|
||||||
Add/remove all windows with
|
Add/remove all windows with
|
||||||
.BR nth
|
.BR nth
|
||||||
tag to/from the view.
|
tag to/from the view.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-q
|
.B Mod1\-Shift\-q
|
||||||
Quit dwm.
|
Quit dwm.
|
||||||
.SS Mouse commands
|
.SS Mouse commands
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Button1
|
.B Mod1\-Button1
|
||||||
Move current window while dragging (floating layout only).
|
Move current window while dragging (floating layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Button2
|
.B Mod1\-Button2
|
||||||
Zooms/cycles current window to/from master area (tiled layout only).
|
Zooms/cycles current window to/from master area (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Button3
|
.B Mod1\-Button3
|
||||||
Resize current window while dragging (floating layout only).
|
Resize current window while dragging (floating layout only).
|
||||||
.SH CUSTOMIZATION
|
.SH CUSTOMIZATION
|
||||||
dwm is customized by creating a custom config.h and (re)compiling the source
|
dwm is customized by creating a custom config.h and (re)compiling the source
|
||||||
|
8
dwm.h
8
dwm.h
@ -1,4 +1,5 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk 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
|
||||||
@ -47,9 +48,9 @@ struct Client {
|
|||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
int rx, ry, rw, rh; /* revert geometry */
|
int rx, ry, rw, rh; /* revert geometry */
|
||||||
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
||||||
int minax, minay, maxax, maxay;
|
int minax, maxax, minay, maxay;
|
||||||
long flags;
|
long flags;
|
||||||
unsigned int border;
|
unsigned int border, oldborder;
|
||||||
Bool isbanned, isfixed, ismax, isfloating;
|
Bool isbanned, isfixed, ismax, isfloating;
|
||||||
Bool *tags;
|
Bool *tags;
|
||||||
Client *next;
|
Client *next;
|
||||||
@ -130,7 +131,6 @@ void zoom(const char *arg); /* zooms the focused client to master area, arg is
|
|||||||
|
|
||||||
/* main.c */
|
/* main.c */
|
||||||
void quit(const char *arg); /* quit dwm nicely */
|
void quit(const char *arg); /* quit dwm nicely */
|
||||||
void sendevent(Window w, Atom a, long value); /* send synthetic event to w */
|
|
||||||
int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
|
int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
|
||||||
|
|
||||||
/* tag.c */
|
/* tag.c */
|
||||||
|
6
event.c
6
event.c
@ -1,6 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
20
layout.c
20
layout.c
@ -1,6 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@ -38,18 +38,18 @@ tile(void) {
|
|||||||
ny = way;
|
ny = way;
|
||||||
if(i < nmaster) {
|
if(i < nmaster) {
|
||||||
ny += i * mh;
|
ny += i * mh;
|
||||||
nw = mw - 2 * BORDERPX;
|
nw = mw - 2 * c->border;
|
||||||
nh = mh - 2 * BORDERPX;
|
nh = mh - 2 * c->border;
|
||||||
}
|
}
|
||||||
else { /* tile window */
|
else { /* tile window */
|
||||||
nx += mw;
|
nx += mw;
|
||||||
nw = tw - 2 * BORDERPX;
|
nw = tw - 2 * c->border;
|
||||||
if(th > 2 * BORDERPX) {
|
if(th > 2 * c->border) {
|
||||||
ny += (i - nmaster) * th;
|
ny += (i - nmaster) * th;
|
||||||
nh = th - 2 * BORDERPX;
|
nh = th - 2 * c->border;
|
||||||
}
|
}
|
||||||
else /* fallback if th <= 2 * BORDERPX */
|
else /* fallback if th <= 2 * c->border */
|
||||||
nh = wah - 2 * BORDERPX;
|
nh = wah - 2 * c->border;
|
||||||
}
|
}
|
||||||
resize(c, nx, ny, nw, nh, False);
|
resize(c, nx, ny, nw, nh, False);
|
||||||
i++;
|
i++;
|
||||||
|
27
main.c
27
main.c
@ -1,7 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
|
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
@ -82,7 +81,7 @@ initfont(const char *fontstr) {
|
|||||||
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
|
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
|
||||||
if(missing) {
|
if(missing) {
|
||||||
while(n--)
|
while(n--)
|
||||||
fprintf(stderr, "missing fontset: %s\n", missing[n]);
|
fprintf(stderr, "dwm: missing fontset: %s\n", missing[n]);
|
||||||
XFreeStringList(missing);
|
XFreeStringList(missing);
|
||||||
}
|
}
|
||||||
if(dc.font.set) {
|
if(dc.font.set) {
|
||||||
@ -205,6 +204,8 @@ setup(void) {
|
|||||||
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
|
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
|
||||||
dc.gc = XCreateGC(dpy, root, 0, 0);
|
dc.gc = XCreateGC(dpy, root, 0, 0);
|
||||||
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
|
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
|
if(!dc.font.set)
|
||||||
|
XSetFont(dpy, dc.gc, dc.font.xfont->fid);
|
||||||
/* multihead support */
|
/* multihead support */
|
||||||
selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
|
selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
|
||||||
}
|
}
|
||||||
@ -221,20 +222,6 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
|
|||||||
|
|
||||||
/* extern */
|
/* extern */
|
||||||
|
|
||||||
void
|
|
||||||
sendevent(Window w, Atom a, long value) {
|
|
||||||
XEvent e;
|
|
||||||
|
|
||||||
e.type = ClientMessage;
|
|
||||||
e.xclient.window = w;
|
|
||||||
e.xclient.message_type = a;
|
|
||||||
e.xclient.format = 32;
|
|
||||||
e.xclient.data.l[0] = value;
|
|
||||||
e.xclient.data.l[1] = CurrentTime;
|
|
||||||
XSendEvent(dpy, w, False, NoEventMask, &e);
|
|
||||||
XSync(dpy, False);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
quit(const char *arg) {
|
quit(const char *arg) {
|
||||||
readin = running = False;
|
readin = running = False;
|
||||||
@ -268,7 +255,7 @@ main(int argc, char *argv[]) {
|
|||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
if(argc == 2 && !strncmp("-v", argv[1], 3))
|
if(argc == 2 && !strncmp("-v", argv[1], 3))
|
||||||
eprint("dwm-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n");
|
eprint("dwm-"VERSION", © 2004-2007 Anselm R. Garbe, Sander van Dijk\n");
|
||||||
else if(argc != 1)
|
else if(argc != 1)
|
||||||
eprint("usage: dwm [-v]\n");
|
eprint("usage: dwm [-v]\n");
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
|
6
tag.c
6
tag.c
@ -1,6 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
6
util.c
6
util.c
@ -1,6 +1,6 @@
|
|||||||
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
*/
|
* See LICENSE file for license details. */
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
Reference in New Issue
Block a user