diff --git a/config.def.h b/config.def.h index e0e72703..a62c1d6c 100644 --- a/config.def.h +++ b/config.def.h @@ -356,7 +356,7 @@ static Key keys[] = { {Mod1Mask, XK_F4, killclient, {0}}, {MODKEY, XK_F1, spawn, {.v = helpcmd}}, {MODKEY, XK_F2, toggleprefix, {0}}, - {MODKEY, XK_t, setlayout, {.v = &layouts[0]}}, + {MODKEY, XK_t, settcltilelayout, {.v = &layouts[0]}}, {MODKEY, XK_f, setlayout, {.v = &layouts[2]}}, {MODKEY, XK_m, setlayout, {.v = &layouts[3]}}, {MODKEY|ShiftMask, XK_m, movemouse, {0}}, diff --git a/instantwm.c b/instantwm.c index bf981cad..68a5b2ce 100644 --- a/instantwm.c +++ b/instantwm.c @@ -4092,6 +4092,15 @@ commandlayout(const Arg *arg) { setlayout(larg); } +void +settcltilelayout(const Arg *arg) +{ + if (strcmp(selmon->lt[selmon->sellt]->symbol, layouts[0].symbol) != 0) + setlayout(arg); + else + setlayout(&((Arg) { .v = &layouts[4]})); +} + void setlayout(const Arg *arg) { diff --git a/instantwm.h b/instantwm.h index 8c11630d..7c5c698a 100644 --- a/instantwm.h +++ b/instantwm.h @@ -277,6 +277,7 @@ int getxtag(int ix); void setclientstate(Client *c, long state); void setfocus(Client *c); void setfullscreen(Client *c, int fullscreen); +void settcltilelayout(const Arg *arg); void setlayout(const Arg *arg); void commandlayout(const Arg *arg); void commandprefix(const Arg *arg);