1
0

renamed monocle into maxmise, documented the keybindings in dwm(1)

This commit is contained in:
anselm@anselm1 2008-03-04 21:40:49 +00:00
parent 96ee9d888c
commit 39af3c2607
3 changed files with 31 additions and 23 deletions

View File

@ -11,8 +11,8 @@
#define SELBGCOLOR "#0066ff" #define SELBGCOLOR "#0066ff"
#define SELFGCOLOR "#ffffff" #define SELFGCOLOR "#ffffff"
/* old */ /* tagging */
const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; const char tags[][MAXLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
Rule rules[] = { Rule rules[] = {
/* class:instance:title substr tags ref isfloating */ /* class:instance:title substr tags ref isfloating */
@ -26,11 +26,12 @@ Rule rules[] = {
#define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */
#define RESIZEHINTS True /* False - respect size hints in tiled resizals */ #define RESIZEHINTS True /* False - respect size hints in tiled resizals */
#define SNAP 32 /* snap pixel */ #define SNAP 32 /* snap pixel */
Layout layouts[] = { Layout layouts[] = {
/* symbol function */ /* symbol function */
{ "[]=", tile }, /* first entry is default */ { "[]=", tile }, /* first entry is default */
{ "><>", floating }, { "><>", floating },
{ "[M]", monocle }, { "[M]", maximise },
}; };
/* key definitions */ /* key definitions */
@ -40,14 +41,15 @@ Key keys[] = {
{ MODKEY, XK_p, spawn, { MODKEY, XK_p, spawn,
"exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" }, "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
{ MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" }, { MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" },
{ MODKEY, XK_space, setlayout, NULL },
{ MODKEY, XK_b, togglebar, NULL }, { MODKEY, XK_b, togglebar, NULL },
{ MODKEY, XK_t, setlayout, "[]=" },
{ MODKEY, XK_f, setlayout, "><>" },
{ MODKEY, XK_m , setlayout, "[M]" },
{ MODKEY, XK_j, focusnext, NULL }, { MODKEY, XK_j, focusnext, NULL },
{ MODKEY, XK_k, focusprev, NULL }, { MODKEY, XK_k, focusprev, NULL },
{ MODKEY, XK_h, setmwfact, "-0.05" }, { MODKEY, XK_h, setmwfact, "-0.05" },
{ MODKEY, XK_l, setmwfact, "+0.05" }, { MODKEY, XK_l, setmwfact, "+0.05" },
{ MODKEY, XK_r, reapply, NULL }, { MODKEY, XK_r, reapply, NULL },
{ MODKEY, XK_m, setlayout, "[M]" },
{ MODKEY, XK_Return, zoom, NULL }, { MODKEY, XK_Return, zoom, NULL },
{ MODKEY, XK_Tab, viewprevtag, NULL }, { MODKEY, XK_Tab, viewprevtag, NULL },
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, { MODKEY|ShiftMask, XK_space, togglefloating, NULL },

31
dwm.1
View File

@ -5,22 +5,23 @@ dwm \- dynamic window manager
.B dwm .B dwm
.RB [ \-v ] .RB [ \-v ]
.SH DESCRIPTION .SH DESCRIPTION
dwm is a dynamic window manager for X. It manages windows in tiled and dwm is a dynamic window manager for X. It manages windows in tiled, maximised
floating layouts. Either layout can be applied dynamically, optimizing the and floating layouts. Either layout can be applied dynamically, optimising the
environment for the application in use and the task performed. environment for the application in use and the task performed.
.P .P
In tiled layout windows are managed in a master and stacking area. The master In tiled layout 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 window which currently needs most attention, whereas the
stacking area contains all other windows. In floating layout windows can be stacking area contains all other windows. In maximised layout all windows are
resized and moved freely. Dialog windows are always managed floating, maximised to the screen size. In floating layout windows can be resized and
regardless of the layout applied. moved freely. Dialog windows are always managed floating, regardless of the
layout 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.
.P .P
dwm contains a small status bar which displays all available tags, the layout, dwm contains a small status bar which displays all available tags, the layout,
the title of the focused window, and the text read from standard input. A the title of the focused window, and the text read from standard input. A
floating window is indicated with an empty square and a maximized floating window is indicated with an empty square and a maximised
floating window is indicated with a filled square before the windows floating window is indicated with a filled square before the windows
title. The selected tags are indicated with a different color. The tags of title. The selected tags are indicated with a different color. The tags of
the focused window are indicated with a filled square in the top left the focused window are indicated with a filled square in the top left
@ -62,6 +63,18 @@ Zooms/cycles current window to/from master area (tiled layout only).
.B Mod1\-Tab .B Mod1\-Tab
Toggles to the previously selected tags. Toggles to the previously selected tags.
.TP .TP
.B Mod1\-t
Applies tiled layout.
.TP
.B Mod1\-f
Applies loating layout.
.TP
.B Mod1\-m
Applies maximised layout.
.TP
.B Mod1\-space
Toggles between layouts.
.TP
.B Mod1\-b .B Mod1\-b
Shows/hides the status bar. Shows/hides the status bar.
.TP .TP
@ -77,9 +90,6 @@ Focus previous window.
.B Mod1\-l .B Mod1\-l
Increases the master area width about 5% (tiled layout only). Increases the master area width about 5% (tiled layout only).
.TP .TP
.B Mod1\-m
Maximizes current window (floating layout/window only).
.TP
.B Mod1\-r .B Mod1\-r
Re-applies tagging rules to all windows. Re-applies tagging rules to all windows.
.TP .TP
@ -99,9 +109,6 @@ tag to/from current window.
.B Mod1\-Shift\-c .B Mod1\-Shift\-c
Close focused window. Close focused window.
.TP .TP
.B Mod1\-space
Toggle between tiled and floating layout (affects all windows).
.TP
.B Mod1\-Shift\-space .B Mod1\-Shift\-space
Toggle focused window between tiled and floating state. Toggle focused window between tiled and floating state.
.TP .TP

9
dwm.c
View File

@ -48,7 +48,7 @@
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask)) #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))
#define LENGTH(x) (sizeof x / sizeof x[0]) #define LENGTH(x) (sizeof x / sizeof x[0])
#define MAXTAGLEN 16 #define MAXLEN 16
#define MOUSEMASK (BUTTONMASK|PointerMotionMask) #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
@ -153,7 +153,7 @@ void killclient(const char *arg);
void manage(Window w, XWindowAttributes *wa); void manage(Window w, XWindowAttributes *wa);
void mappingnotify(XEvent *e); void mappingnotify(XEvent *e);
void maprequest(XEvent *e); void maprequest(XEvent *e);
void monocle(void); void maximise(void);
void movemouse(Client *c); void movemouse(Client *c);
Client *nexttiled(Client *c); Client *nexttiled(Client *c);
void propertynotify(XEvent *e); void propertynotify(XEvent *e);
@ -1073,12 +1073,11 @@ maprequest(XEvent *e) {
} }
void void
monocle(void) { maximise(void) {
Client *c; Client *c;
domwfact = dozoom = False; domwfact = dozoom = False;
for(c = clients; c; c = c->next) for(c = nexttiled(clients); c; c = nexttiled(c->next))
if(isvisible(c))
resize(c, wax, way, waw - 2 * c->border, wah - 2 * c->border, RESIZEHINTS); resize(c, wax, way, waw - 2 * c->border, wah - 2 * c->border, RESIZEHINTS);
} }