Update tag formats and add new layout

- Change tag label formats to use hyphens and remove brackets
- Enable lowercase tag labels
- Add new layout '><>' and corresponding key binding (MODKEY + XK_f)
This commit is contained in:
Sam 2024-11-02 15:14:36 +00:00
parent d138c1a59c
commit d795f9e155
2 changed files with 7 additions and 4 deletions

View File

@ -55,9 +55,9 @@ static Sp scratchpads[] = {
/* tagging */ /* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const char ptagf[] = "[%s %s]"; /* format of a tag label */ static const char ptagf[] = "%s-%s"; /* format of a tag label */
static const char etagf[] = "[%s]"; /* format of an empty tag */ static const char etagf[] = "%s"; /* format of an empty tag */
static const int lcaselbl = 0; /* 1 means make tag label lowercase */ static const int lcaselbl = 1; /* 1 means make tag label lowercase */
static const Rule rules[] = { static const Rule rules[] = {
/* class instance title tags mask isfloating isterminal noswallow monitor */ /* class instance title tags mask isfloating isterminal noswallow monitor */
{ "St", NULL, NULL, 0, 0, 1, 0, -1 }, { "St", NULL, NULL, 0, 0, 1, 0, -1 },
@ -81,6 +81,7 @@ static const Layout layouts[] = {
/* symbol arrange function */ /* symbol arrange function */
{ "[]=", tile }, /* first entry is default */ { "[]=", tile }, /* first entry is default */
{ "[M]", monocle }, { "[M]", monocle },
{ "><>", NULL },
}; };
/* key definitions */ /* key definitions */
@ -141,6 +142,7 @@ static const Key keys[] = {
{ MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_q, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} }, { MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} }, { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },

3
dwm.c
View File

@ -1301,7 +1301,8 @@ monocle(Monitor *m)
snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
if (selmon->pertag->drawwithgaps[selmon->pertag->curtag]) if (selmon->pertag->drawwithgaps[selmon->pertag->curtag])
resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); resize(c, m->wx + gappx[0], m->wy + gappx[0], m->ww - 2 * c->bw - gappx[0] * 2, m->wh - 2 * c->bw - gappx[0] * 2, 0);
// resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
else else
resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False); resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
} }