Skip to content

Commit

Permalink
Incorporated default layout patch into my combined patch (original patch
Browse files Browse the repository at this point in the history
posted unmodified in patches folder).
  • Loading branch information
sfauzia committed Aug 18, 2011
1 parent ac21e72 commit 49d1290
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 12 deletions.
11 changes: 6 additions & 5 deletions config.h
Expand Up @@ -15,7 +15,8 @@ static Bool showbar = True; /* False means no bar */
static Bool topbar = True; /* False means bottom bar */

/* tagging */
static const char *tags[] = { "surf", "1", "2", "3", "4", "5", "6", "7", "8" };
static const char *tags[] = { "surf", "1", "2", "3", "4", "5", "6", "7", "8" };
static const int taglayouts[] = {1, 0, 0, 0, 0, 0, 0, 0, 0};

static const Rule rules[] = {
/* class instance title tags mask flags monitor */
Expand All @@ -30,8 +31,8 @@ static const Bool resizehints = False; /* True means respect size hints in tiled

static const Layout layouts[] = {
/* symbol arrange function */
{ "[M]", monocle }, /* first entry is default */
{ "[]=", tile },
{ "[]=", tile }, /* first entry is default */
{ "[M]", monocle },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "TTT", bstack },
{ "===", bstackhoriz },
Expand Down Expand Up @@ -89,8 +90,8 @@ static Key keys[] = {
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_u, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_s, setlayout, {.v = &layouts[3]} },
{ MODKEY, XK_r, setlayout, {.v = &layouts[4]} },
Expand Down
36 changes: 29 additions & 7 deletions dwm-5.8.2-combined.diff
Expand Up @@ -37,7 +37,7 @@ diff -aur dwm-5.7.2.orig/config.mk dwm-5.7.2.patched/config.mk
# flags
CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
--- a/dwm.c 2010-06-04 06:39:15.000000000 -0400
+++ b/dwm.c 2011-08-18 11:30:01.076356508 -0400
+++ b/dwm.c 2011-08-18 12:36:50.258547218 -0400
@@ -36,6 +36,10 @@
#include <X11/Xlib.h>
#include <X11/Xproto.h>
Expand Down Expand Up @@ -465,13 +465,13 @@ diff -aur dwm-5.7.2.orig/config.mk dwm-5.7.2.patched/config.mk
drawtext(NULL, dc.norm, False);
+ break;
+ }
+ }
}
+
+ if(m == selmon && m->sel && ISVISIBLE(m->sel)) {
+ dc = seldc;
+ drawtext(m->sel->name, col, False);
+ drawsquare(m->sel->isfixed, m->sel->isfloating, True, col);
}
+ }
+
XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
XSync(dpy, False);
Expand Down Expand Up @@ -1032,7 +1032,29 @@ diff -aur dwm-5.7.2.orig/config.mk dwm-5.7.2.patched/config.mk
updatebars();
updatestatus();
/* EWMH support per view */
@@ -1625,13 +1942,10 @@
@@ -1569,6 +1886,21 @@
XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
XSelectInput(dpy, root, wa.event_mask);
grabkeys();
+
+ /* set default tag layouts */
+ for (int i = 0; i < LENGTH(tags); i++)
+ {
+ if (taglayouts[i]!=0)
+ {
+ Layout *l;
+ view(&((Arg) { .ui = 1 << i }));
+ l = (Layout *)layouts;
+ for (int j = 0; j < taglayouts[i]; j++)
+ l++;
+ setlayout(&((Arg) { .v = l }));
+ }
+ }
+ view(&((Arg) { .ui = 1 << 0 }));
}

void
@@ -1625,13 +1957,10 @@

int
textnw(const char *text, unsigned int len) {
Expand All @@ -1050,7 +1072,7 @@ diff -aur dwm-5.7.2.orig/config.mk dwm-5.7.2.patched/config.mk
}

void
@@ -1665,8 +1979,114 @@
@@ -1665,8 +1994,114 @@
}

void
Expand Down Expand Up @@ -1166,7 +1188,7 @@ diff -aur dwm-5.7.2.orig/config.mk dwm-5.7.2.patched/config.mk
updatebarpos(selmon);
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
arrange(selmon);
@@ -1686,12 +2106,27 @@
@@ -1686,12 +2121,27 @@
void
toggletag(const Arg *arg) {
unsigned int newtags;
Expand Down Expand Up @@ -1194,7 +1216,7 @@ diff -aur dwm-5.7.2.orig/config.mk dwm-5.7.2.patched/config.mk
arrange(selmon);
}
}
@@ -1953,17 +2388,37 @@
@@ -1953,17 +2403,37 @@
}
else
c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
Expand Down
38 changes: 38 additions & 0 deletions patches/dwm-defaultlayout.diff
@@ -0,0 +1,38 @@
diff --git a/dwm/config.h b/dwm/config.h
index 126c864..a29f170 100644
--- a/dwm/config.h
+++ b/dwm/config.h
@@ -22,6 +22,7 @@ static const Bool topbar = True; /* False means bottom bar */

/* tagging */
static const char *tags[] = { "web", "media", "msg", "4", "5"};
+static const int taglayouts[] = {2, 2, 0, 0, 0};

static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
diff --git a/dwm/dwm.c b/dwm/dwm.c
index ef8db79..3f2ac21 100644
--- a/dwm/dwm.c
+++ b/dwm/dwm.c
@@ -1645,6 +1645,21 @@ setup(void) {
XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
XSelectInput(dpy, root, wa.event_mask);
grabkeys();
+
+ /* set default tag layouts */
+ for (int i = 0; i < LENGTH(tags); i++)
+ {
+ if (taglayouts[i]!=0)
+ {
+ Layout *l;
+ view(&((Arg) { .ui = 1 << i }));
+ l = (Layout *)layouts;
+ for (int j = 0; j < taglayouts[i]; j++)
+ l++;
+ setlayout(&((Arg) { .v = l }));
+ }
+ }
+ view(&((Arg) { .ui = 1 << 0 }));
}

void

0 comments on commit 49d1290

Please sign in to comment.