|
|
|
@ -1,15 +1,15 @@
|
|
|
|
|
From 783e6d3e030333127d9a4c421c0a1e254ee30c6a Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 0db3b7291e407a2bf178d249fcd771cf5edfeb54 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: bakkeby <bakkeby@gmail.com>
|
|
|
|
|
Date: Sat, 19 Dec 2020 19:56:17 +0100
|
|
|
|
|
Subject: [PATCH] Named scratchpad variant
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
config.def.h | 13 ++++--
|
|
|
|
|
dwm.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
2 files changed, 122 insertions(+), 3 deletions(-)
|
|
|
|
|
dwm.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
2 files changed, 125 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/config.def.h b/config.def.h
|
|
|
|
|
index 1c0b587..150df49 100644
|
|
|
|
|
index 1c0b587..d05180d 100644
|
|
|
|
|
--- a/config.def.h
|
|
|
|
|
+++ b/config.def.h
|
|
|
|
|
@@ -26,9 +26,10 @@ static const Rule rules[] = {
|
|
|
|
@ -37,14 +37,14 @@ index 1c0b587..150df49 100644
|
|
|
|
|
/* modifier key function argument */
|
|
|
|
|
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
|
|
|
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
|
|
|
|
+ { MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } },
|
|
|
|
|
+ { MODKEY|ShiftMask, XK_grave, removescratch, {.v = scratchpadcmd } },
|
|
|
|
|
+ { MODKEY|ControlMask, XK_grave, setscratch, {.v = scratchpadcmd } },
|
|
|
|
|
+ { MODKEY, XK_g, togglescratch, {.v = scratchpadcmd } },
|
|
|
|
|
+ { MODKEY|ShiftMask, XK_g, removescratch, {.v = scratchpadcmd } },
|
|
|
|
|
+ { MODKEY|ControlMask, XK_g, setscratch, {.v = scratchpadcmd } },
|
|
|
|
|
{ MODKEY, XK_b, togglebar, {0} },
|
|
|
|
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
|
|
|
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
|
|
|
|
diff --git a/dwm.c b/dwm.c
|
|
|
|
|
index 4465af1..f005c7e 100644
|
|
|
|
|
index 4465af1..05d92bb 100644
|
|
|
|
|
--- a/dwm.c
|
|
|
|
|
+++ b/dwm.c
|
|
|
|
|
@@ -93,6 +93,7 @@ struct Client {
|
|
|
|
@ -148,7 +148,17 @@ index 4465af1..f005c7e 100644
|
|
|
|
|
void
|
|
|
|
|
setup(void)
|
|
|
|
|
{
|
|
|
|
|
@@ -1652,6 +1680,19 @@ spawn(const Arg *arg)
|
|
|
|
|
@@ -1622,6 +1650,9 @@ showhide(Client *c)
|
|
|
|
|
resize(c, c->x, c->y, c->w, c->h, 0);
|
|
|
|
|
showhide(c->snext);
|
|
|
|
|
} else {
|
|
|
|
|
+ /* optional: auto-hide scratchpads when moving to other tags */
|
|
|
|
|
+ if (c->scratchkey != 0 && c->tags != 0)
|
|
|
|
|
+ c->tags = 0;
|
|
|
|
|
/* hide clients bottom up */
|
|
|
|
|
showhide(c->snext);
|
|
|
|
|
XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
|
|
|
|
|
@@ -1652,6 +1683,19 @@ spawn(const Arg *arg)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -168,7 +178,7 @@ index 4465af1..f005c7e 100644
|
|
|
|
|
void
|
|
|
|
|
tag(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
@@ -1719,6 +1760,77 @@ togglefloating(const Arg *arg)
|
|
|
|
|
@@ -1719,6 +1763,77 @@ togglefloating(const Arg *arg)
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -237,7 +247,7 @@ index 4465af1..f005c7e 100644
|
|
|
|
|
+
|
|
|
|
|
+ if (found) {
|
|
|
|
|
+ arrange(selmon);
|
|
|
|
|
+ focus(ISVISIBLE(c) ? c : NULL);
|
|
|
|
|
+ focus(ISVISIBLE(found) ? found : NULL);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ spawnscratch(arg);
|
|
|
|
|
+ }
|
|
|
|
|