From 6b396d0d8428092363f73d867a122150e0f72ce8 Mon Sep 17 00:00:00 2001 From: Jon Glueckstein Date: Mon, 8 Mar 2021 08:57:59 -0500 Subject: [PATCH] Added function to toggle smartgaps and bound it to Super+Shift+apostrophe. --- config.h | 1 + vanitygaps.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/config.h b/config.h index 424aaeb..e8c48a6 100644 --- a/config.h +++ b/config.h @@ -201,6 +201,7 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_semicolon, shifttag, { .i = 1 } }, { MODKEY, XK_apostrophe, togglescratch, {.ui = 1} }, /* { MODKEY|ShiftMask, XK_apostrophe, spawn, SHCMD("") }, */ + { MODKEY|ShiftMask, XK_apostrophe, togglesmartgaps, {0} }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY|ShiftMask, XK_Return, togglescratch, {.ui = 0} }, diff --git a/vanitygaps.c b/vanitygaps.c index 7245e74..4c98e69 100644 --- a/vanitygaps.c +++ b/vanitygaps.c @@ -8,6 +8,7 @@ static void incrgaps(const Arg *arg); /* static void incrihgaps(const Arg *arg); */ /* static void incrivgaps(const Arg *arg); */ static void togglegaps(const Arg *arg); +static void togglesmartgaps(const Arg *arg); /* Layouts */ static void bstack(Monitor *m); @@ -48,6 +49,13 @@ togglegaps(const Arg *arg) arrange(NULL); } +static void +togglesmartgaps(const Arg *arg) +{ + smartgaps = !smartgaps; + arrange(NULL); +} + static void defaultgaps(const Arg *arg) {