summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil clingman <>2021-07-14 18:25:44 -0400
committertslil clingman <>2021-07-14 18:25:44 -0400
commit0da02b29d9f7a90c6bfd6fadf299d12ea0142b92 (patch)
tree48efabaa043fb68dce34c4b65b5d7747742f95af
parentd1c07f805637c2cb0df893a87805c2756275e47e (diff)
Gaps!
-rw-r--r--dwm-6.2/config.def.h1
-rw-r--r--dwm-6.2/config.h6
-rw-r--r--dwm-6.2/dwm.c24
3 files changed, 24 insertions, 7 deletions
diff --git a/dwm-6.2/config.def.h b/dwm-6.2/config.def.h
index 2d824d1..47f0981 100644
--- a/dwm-6.2/config.def.h
+++ b/dwm-6.2/config.def.h
@@ -2,6 +2,7 @@
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int gappx = 6; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayspacing = 2; /* systray spacing */
diff --git a/dwm-6.2/config.h b/dwm-6.2/config.h
index 4f37f05..db80e04 100644
--- a/dwm-6.2/config.h
+++ b/dwm-6.2/config.h
@@ -2,6 +2,7 @@
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int gappx = 6; /* gaps between windows */
static const unsigned int snap = 16; /* snap pixel */
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayspacing = 2; /* systray spacing */
@@ -77,7 +78,8 @@ static const char *vol_up[] = { "pactl", "set-sink-volume", "0", "+5%", NULL };
static const char *vol_mt[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
#define XF86ScreenSaver 0x1008ff2d
-static const char *lock[] = { "lock", NULL };
+static const char *lock[] = {"lock", NULL};
+static const char *toggle_autolock[] = { "toggle_autolock", NULL };
static Key keys[] = {
/* modifier key function argument */
@@ -88,6 +90,8 @@ static Key keys[] = {
{ 0, XF86AudioRaiseVolume, spawn, {.v = vol_up } },
{ 0, XF86AudioMute, spawn, {.v = vol_mt } },
{ 0, XF86ScreenSaver, spawn, {.v = lock } },
+ { MODKEY, XK_h, spawn, {.v = lock } },
+ { MODKEY|ShiftMask, XK_h, spawn, {.v = toggle_autolock } },
/*
{ 0, XF86MonBrightnessDown, spawn, {.v = brightness_dn } },
{ 0, XF86MonBrightnessUp, spawn, {.v = brightness_up } },
diff --git a/dwm-6.2/dwm.c b/dwm-6.2/dwm.c
index 2cd02b3..370f484 100644
--- a/dwm-6.2/dwm.c
+++ b/dwm-6.2/dwm.c
@@ -53,8 +53,8 @@
#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
#define LENGTH(X) (sizeof X / sizeof X[0])
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
-#define WIDTH(X) ((X)->w + 2 * (X)->bw)
-#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
+#define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx)
+#define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx)
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
@@ -1464,12 +1464,24 @@ void
resizeclient(Client *c, int x, int y, int w, int h)
{
XWindowChanges wc;
+ unsigned int gapoffset;
+ unsigned int gapincr;
- c->oldx = c->x; c->x = wc.x = x;
- c->oldy = c->y; c->y = wc.y = y;
- c->oldw = c->w; c->w = wc.width = w;
- c->oldh = c->h; c->h = wc.height = h;
wc.border_width = c->bw;
+
+ /* Do nothing if layout is floating */
+ if (c->isfloating || c->mon->lt[c->mon->sellt]->arrange == NULL) {
+ gapincr = gapoffset = 0;
+ } else {
+ gapoffset = gappx;
+ gapincr = 2 * gappx;
+ }
+
+ c->oldx = c->x; c->x = wc.x = x + gapoffset;
+ c->oldy = c->y; c->y = wc.y = y + gapoffset;
+ c->oldw = c->w; c->w = wc.width = w - gapincr;
+ c->oldh = c->h; c->h = wc.height = h - gapincr;
+
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
configure(c);
XSync(dpy, False);