Merge pull request #13 from E-Almqvist/dev

Added togglegaps functionality
pull/15/head
E. Almqvist 4 years ago committed by GitHub
commit 07897d1e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/config.h
  2. 12
      src/dwm.c

@ -112,9 +112,10 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_x, spawn, {.v = betterlockscreencmd}}, { MODKEY|ShiftMask, XK_x, spawn, {.v = betterlockscreencmd} },
{ MODKEY, XK_Print, spawn, {.v = spectaclecmd}}, { MODKEY, XK_Print, spawn, {.v = spectaclecmd} },
{ MODKEY, XK_u, spawn, {.v = cmuspausecmd}}, { MODKEY, XK_u, spawn, {.v = cmuspausecmd} },
{ MODKEY, XK_g, togglegaps, {0} },
TAGKEYS( XK_1, 0) TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1) TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2) TAGKEYS( XK_3, 2)

@ -227,6 +227,7 @@ static void setclientstate(Client *c, long state);
static void setfocus(Client *c); static void setfocus(Client *c);
static void setfullscreen(Client *c, int fullscreen); static void setfullscreen(Client *c, int fullscreen);
static void setgaps(const Arg *arg); static void setgaps(const Arg *arg);
static void togglegaps(const Arg *arg);
static void setlayout(const Arg *arg); static void setlayout(const Arg *arg);
static void setlayoutsafe(const Arg *arg); static void setlayoutsafe(const Arg *arg);
static void setmfact(const Arg *arg); static void setmfact(const Arg *arg);
@ -1687,6 +1688,17 @@ setgaps(const Arg *arg)
arrange(selmon); arrange(selmon);
} }
void
togglegaps(const Arg *arg)
{
if(selmon->gappx == 0) {
selmon->gappx = gappx;
} else {
selmon->gappx = 0;
}
arrange(selmon);
}
void void
setlayout(const Arg *arg) setlayout(const Arg *arg)
{ {

Loading…
Cancel
Save