dwm

my heavily-patched and customized dwm build
git clone git://git.kocotian.pl/dwm.git
Log | Files | Refs | README | LICENSE

commit ec5b50cd868d84d23a7781158f4869196517159d
parent 6ff34615ee9bf58efaaf15e9118311c133ef27af
Author: kocotian <kocotian@kocotian.pl>
Date:   Thu, 25 Feb 2021 10:38:26 +0100

removed few comments, dynamic layout, few other changes

Diffstat:
Mconfig.def.h | 42++++++------------------------------------
Mdwm.c | 22+++++++++++++++++++---
2 files changed, 25 insertions(+), 39 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -19,41 +19,14 @@ static const char statussep = ';'; /* separator between status bars static const char *fonts[] = { "monospace:size=8:antialias=true:autohint=true", "JoyPixels:pixelsize=10:antialias=true:autohint=true" }; static const char dmenufont[] = "monospace:size=8:antialias=true:autohint=true"; -/* static const char col_gray1[] = "#222222"; */ -/* static const char col_gray2[] = "#444444"; */ -/* static const char col_gray3[] = "#aaaaaa"; */ -/* static const char col_gray4[] = "#ffffff"; */ -/* static const char col_acc1[] = "#a46600"; */ -/* static const char col_acc2[] = "#d79921"; */ - +/* color customization */ static const char col_gray1[] = "#000000"; static const char col_gray2[] = "#222222"; static const char col_gray3[] = "#aaaaaa"; static const char col_gray4[] = "#ffffff"; -/* static const char col_acc1[] = "#770077"; */ -/* static const char col_acc2[] = "#bb22dd"; */ static const char col_acc1[] = "#656407"; static const char col_acc2[] = "#98971a"; -/* static const char col_stat0[] = "#000000"; */ -/* static const char col_stat1[] = "#cc241d"; */ -/* static const char col_stat2[] = "#98971a"; */ -/* static const char col_stat3[] = "#d79921"; */ -/* static const char col_stat4[] = "#458588"; */ -/* static const char col_stat5[] = "#b16286"; */ -/* static const char col_stat6[] = "#689d6a"; */ -/* static const char col_stat7[] = "#a89984"; */ - -/* static const char col_stat0[] = "#928374"; */ -/* static const char col_stat1[] = "#fb4934"; */ -/* static const char col_stat2[] = "#b8bb26"; */ -/* static const char col_stat3[] = "#fabd2f"; */ -/* static const char col_stat4[] = "#83a598"; */ -/* static const char col_stat5[] = "#d3869b"; */ -/* static const char col_stat6[] = "#8ec07c"; */ -/* static const char col_stat7[] = "#ebdbb2"; */ - -/* gruvbox */ static const char col_stat0[] = "#000000"; static const char col_stat1[] = "#fb4934"; static const char col_stat2[] = "#98971a"; @@ -114,13 +87,14 @@ static const Rule rules[] = { /* layout(s) */ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 2; /* number of clients in master area */ +static const int nmaster = 1; /* number of clients in master area */ static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ static const Layout layouts[] = { /* symbol arrange function */ - { "TTT", bstack }, /* first entry is default */ + { "###", dynamiclayout }, /* first entry is default */ { "[]=", tile }, + { "TTT", bstack }, { "===", bstackhoriz }, { "[M]", monocle }, { "|M|", centeredmaster }, @@ -136,12 +110,6 @@ static const Direction directions[] = { { "-v-", attachbelow }, { "vvv", attachbottom }, { "^^^", attachtop }, - /* { "left", attach }, /1* first entry is default *1/ */ - /* { "up", attachabove }, */ - /* { "right", attachaside }, */ - /* { "down", attachbelow }, */ - /* { "bottom", attachbottom }, */ - /* { "top", attachtop }, */ }; /* key definitions */ @@ -240,6 +208,8 @@ static Key keys[] = { { MODKEY|Mod1Mask|ShiftMask, XK_j, tagmon, {.i = -1 } }, { MODKEY|Mod1Mask|ShiftMask, XK_k, tagmon, {.i = +1 } }, + { MODKEY, XK_semicolon, spawn, SHCMD("dmenize") }, + { MODKEY|ShiftMask, XK_semicolon, spawn, SHCMD("dmenize") }, { MODKEY, XK_apostrophe, spawn, SHCMD("st -e bc -l") }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, diff --git a/dwm.c b/dwm.c @@ -264,6 +264,7 @@ static void spawn(const Arg *arg); static void swaptags(const Arg *arg); static void tag(const Arg *arg); static void tagmon(const Arg *arg); +static void dynamiclayout(Monitor *m); static void tile(Monitor *); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); @@ -1931,15 +1932,16 @@ resetlayout(const Arg *arg) { Arg default_layout = {.v = &layouts[0]}; Arg default_mfact = {.f = mfact + 1}; - Arg default_attachment = {.i = -1}; + /* Arg default_attachment = {.i = -1}; */ setlayout(&default_layout); setmfact(&default_mfact); - setattach(&default_attachment); + /* setattach(&default_attachment); */ } void -reorganizetags(const Arg *arg) { +reorganizetags(const Arg *arg) +{ Client *c; unsigned int occ, unocc, i; unsigned int tagdest[LENGTH(tags)]; @@ -2548,6 +2550,20 @@ tagmon(const Arg *arg) } void +dynamiclayout(Monitor *m) +{ + unsigned int n; + Client *c; + + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + + if (n - m->nmaster > 2) + bstack(m); /* if there are (> 2) slave window, bottomstack em */ + else + tile(m); /* otherwise make default tile layout */ +} + +void tile(Monitor *m) { unsigned int i, n, h, mw, my, ty;