dwm

my build of dwm
git clone git://git.ckyln.com/~cem/dwm.git
Log | Files | Refs | README | LICENSE

commit 0474da328d0d15f1edf0055ed36ef75b8bfc2633
parent 4996f330f65e3ee016aed2a39c9637140d5f7f5d
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri,  4 Oct 2019 12:23:34 +0300

add fullscreen patch

Diffstat:
Mconfig.h | 1+
Mdwm.c | 14++++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/config.h b/config.h @@ -135,6 +135,7 @@ static Key keys[] = { { WINKEY, XK_m, setlayout, {.v = &layouts[2]} }, { WINKEY, XK_s, setlayout, {.v = &layouts[3]} }, { WINKEY, XK_d, setlayout, {.v = &layouts[4]} }, + { WINKEY|ShiftMask, XK_f, fullscreen, {0} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, diff --git a/dwm.c b/dwm.c @@ -220,6 +220,7 @@ static void sendmon(Client *c, Monitor *m); static void setclientstate(Client *c, long state); static void setfocus(Client *c); static void setfullscreen(Client *c, int fullscreen); +static void fullscreen(const Arg *arg); static void setgaps(const Arg *arg); static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); @@ -1577,6 +1578,19 @@ setgaps(const Arg *arg) arrange(selmon); } +Layout *last_layout; +void +fullscreen(const Arg *arg) +{ + if (selmon->showbar) { + for(last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++); + setlayout(&((Arg) { .v = &layouts[2] })); + } else { + setlayout(&((Arg) { .v = last_layout })); + } + togglebar(arg); +} + void setlayout(const Arg *arg) {