aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2022-11-05 16:56:50 +0100
committertslil clingman <tslil@posteo.de>2022-11-05 16:59:34 +0100
commitc358e568642063a78aaf849972e8ecb55b082861 (patch)
treeb967724f07faf7a70036537e20794950170aae46
parentf1ced2b5e186789a142bd44d92075c83358cc3fd (diff)
Add pointless gaps and fix rtileHEADmain
-rw-r--r--README.md1
-rw-r--r--config.h35
-rw-r--r--monsterwm.c19
3 files changed, 31 insertions, 24 deletions
diff --git a/README.md b/README.md
index 3e5c6fe..5f27f54 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@ Maintaining my version of monsterwm. Changes:
- print status for lemonbar periodically (and on every update event)
- prevent running commands from writing to stdout (to preserve status)
- add RTILE for tiling with main window on the right (default)
+- add pointless gaps
→ tiny and monstrous!
---------------------
diff --git a/config.h b/config.h
index 2a520e9..5baa70a 100644
--- a/config.h
+++ b/config.h
@@ -21,6 +21,7 @@
#define CLICK_TO_FOCUS True /* focus an unfocused window when clicked */
#define FOCUS_BUTTON Button3 /* mouse button to be used along with CLICK_TO_FOCUS */
#define BORDER_WIDTH 1 /* window border width */
+#define GAP_WIDTH 6 /* pointless gap */
#define FOCUS "#ff950e" /* focused window border color */
#define UNFOCUS "#444444" /* unfocused window border color */
#define MINWSZ 50 /* minimum window size in pixels */
@@ -80,7 +81,7 @@ static Key keys[] = {
{ MOD4, XK_d, spawn, {.com = menucmd} },
{ MOD4|SHIFT, XK_space, spawn, {.com = albumbler } },
{ MOD4|SHIFT|CONTROL, XK_space, spawn, {.com = now_playing } },
- { MOD4, XK_h, spawn, {.com = lock } },
+ { MOD4, XK_x, spawn, {.com = lock } },
{ MOD4|SHIFT|CONTROL, XK_q, quit, {.i = 0} }, /* quit with exit value 0 */
// Multimedia
@@ -93,34 +94,34 @@ static Key keys[] = {
{ 0, XF86AudioNext, spawn, {.com = mpc_next } },
// Windows
- { MOD4, XK_n, next_win, {NULL} },
- { MOD4, XK_o, prev_win, {NULL} },
- { MOD4|SHIFT, XK_n, move_down, {NULL} },
- { MOD4|SHIFT, XK_o, move_up, {NULL} },
+ { MOD4, XK_c, next_win, {NULL} },
+ { MOD4, XK_i, prev_win, {NULL} },
+ { MOD4|SHIFT, XK_c, move_down, {NULL} },
+ { MOD4|SHIFT, XK_i, move_up, {NULL} },
{ MOD4|SHIFT, XK_k, killclient, {NULL} },
{ MOD4, XK_Return, swap_master, {NULL} },
{ MOD4, XK_BackSpace, focusurgent, {NULL} },
{ MOD4, XK_e, resize_master, {.i = +10} }, /* increase size in px */
- { MOD4, XK_i, resize_master, {.i = -10} }, /* decrease size in px */
+ { MOD4, XK_n, resize_master, {.i = -10} }, /* decrease size in px */
{ MOD4|SHIFT, XK_e, resize_stack, {.i = +10} }, /* increase size in px */
- { MOD4|SHIFT, XK_i, resize_stack, {.i = -10} }, /* decrease size in px */
+ { MOD4|SHIFT, XK_n, resize_stack, {.i = -10} }, /* decrease size in px */
// Desktops
{ MOD4, XK_Tab, last_desktop, {NULL} },
- DESKTOPCHANGE( XK_l, 0)
+ DESKTOPCHANGE( XK_f, 0)
DESKTOPCHANGE( XK_u, 1)
- DESKTOPCHANGE( XK_y, 2)
- DESKTOPCHANGE( XK_semicolon, 3)
- DESKTOPCHANGE( XK_q, 4)
- DESKTOPCHANGE( XK_w, 5)
- DESKTOPCHANGE( XK_f, 6)
- DESKTOPCHANGE( XK_p, 7)
+ DESKTOPCHANGE( XK_h, 2)
+ DESKTOPCHANGE( XK_period, 3)
+ DESKTOPCHANGE( XK_v, 4)
+ DESKTOPCHANGE( XK_l, 5)
+ DESKTOPCHANGE( XK_o, 6)
+ DESKTOPCHANGE( XK_m, 7)
// Layouts
- { MOD4, XK_a, switch_mode, {.i = RTILE} },
+ { MOD4, XK_s, switch_mode, {.i = RTILE} },
{ MOD4, XK_r, switch_mode, {.i = MONOCLE} },
- { MOD4, XK_s, switch_mode, {.i = BSTACK} },
- { MOD4|SHIFT, XK_a, switch_mode, {.i = TILE} },
+ { MOD4, XK_a, switch_mode, {.i = BSTACK} },
+ { MOD4|SHIFT, XK_s, switch_mode, {.i = TILE} },
{ MOD4|SHIFT, XK_r, switch_mode, {.i = FLOAT} },
{ MOD4, XK_b, togglepanel, {NULL} },
};
diff --git a/monsterwm.c b/monsterwm.c
index 2f2dbec..421a1bc 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -1187,20 +1187,25 @@ void stack(int x, int y, int w, int h, const Desktop *d) {
/* tile the first non-floating, non-fullscreen window to cover the master area */
if (b) XMoveResizeWindow(dis, c->win, x, y, w - 2*BORDER_WIDTH, ma - BORDER_WIDTH);
- else if (r) XMoveResizeWindow(dis, c->win, w - ma + BORDER_WIDTH, y, ma, h - 2*BORDER_WIDTH);
+ else if (r) XMoveResizeWindow(dis, c->win, w - ma - BORDER_WIDTH, y, ma - BORDER_WIDTH, h - 2*BORDER_WIDTH);
else XMoveResizeWindow(dis, c->win, x, y, ma - BORDER_WIDTH, h - 2*BORDER_WIDTH);
- /* tile the next non-floating, non-fullscreen (and first) stack window adding p */
+ /* tile the next non-floating, non-fullscreen (and first) stack window adding p - GAP_WIDTH */
for (c = c->next; c && ISFFT(c); c = c->next);
- int cw = (b ? h:w) - 2*BORDER_WIDTH - ma, ch = z - BORDER_WIDTH;
- if (b) XMoveResizeWindow(dis, c->win, x, y += ma, ch - BORDER_WIDTH + p, cw);
- else XMoveResizeWindow(dis, c->win, r ? x : (x += ma), y, cw, ch - BORDER_WIDTH + p);
+ int cw = (b ? h:w) - 2*BORDER_WIDTH - ma - GAP_WIDTH, ch = z - BORDER_WIDTH;
+ if (b) {
+ XMoveResizeWindow(dis, c->win, x, (y += ma + GAP_WIDTH), ch - BORDER_WIDTH + p, cw);
+ x += GAP_WIDTH;
+ } else {
+ XMoveResizeWindow(dis, c->win, r ? x : (x += ma + GAP_WIDTH), y, cw, ch - BORDER_WIDTH + p);
+ y += GAP_WIDTH;
+ }
/* tile the rest of the non-floating, non-fullscreen stack windows */
for (b ? (x += ch+p):(y += ch+p), c = c->next; c; c = c->next) {
if (ISFFT(c)) continue;
- if (b) { XMoveResizeWindow(dis, c->win, x, y, ch, cw); x += z; }
- else { XMoveResizeWindow(dis, c->win, x, y, cw, ch); y += z; }
+ if (b) { XMoveResizeWindow(dis, c->win, x, y, ch - GAP_WIDTH, cw); x += z; }
+ else { XMoveResizeWindow(dis, c->win, x, y, cw, ch - GAP_WIDTH); y += z; }
}
}