diff options
author | Malfurious <m@lfurio.us> | 2024-03-04 19:15:34 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2024-03-05 21:04:53 -0500 |
commit | d4ee7a81f7b908d7305b35918c61d4f497161ca8 (patch) | |
tree | 68baf6514e3f2c6e69523a0771290cfc48a39358 /config.def.h | |
parent | c487d2524a1c8429b74285ef05557fb408483da0 (diff) | |
download | dwm-d4ee7a81f7b908d7305b35918c61d4f497161ca8.tar.gz dwm-d4ee7a81f7b908d7305b35918c61d4f497161ca8.zip |
patch: scratchpadz
This patch enables the use of multiple pre-assigned scratchpad
terminals. This patch uses reserved tags for stowing scratchpads, these
are the tagmasks just beyond those defined for normal use.
DWM's rule system is used to handle spawning scratchpad windows. We use
one rule per scratchpad to define what SPTAG it belongs to, whether it
is floating, an instance identifier, and what program to exec in st
(your shell by default). Keybinds should be setup to call togglescratch
with a pointer to the rule struct which defines the scratchpad.
The togglescratch function uses the information in the rule to craft an
st command line to spawn. However, if some client is already open on
the rule's tagmask, it will just act like toggleview(tagmask).
Normal clients may be opened while viewing scratchpads, they are always
excluded from scratchpad tags.
This patch is inspired by the "scratchpad" and "scratchpads" patches
from suckless.org.
Diffstat (limited to 'config.def.h')
-rw-r--r-- | config.def.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index 9f6f41e..54d0c54 100644 --- a/config.def.h +++ b/config.def.h @@ -29,13 +29,16 @@ static const unsigned int alphas[][3] = { static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }; static const char *tagfmt = "[%s: %.30s]"; +static const char *scratchpad_size = "120x34"; static const Rule rules[] = { /* xprop(1): * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask isfloating monitor */ - { NULL, NULL, NULL, 0, 0, -1 }, + /* class instance title tags mask isfloating monitor scratchpad exec */ + { "st", "sp-shell", NULL, SPTAG(0), 1, -1, NULL }, + { "st", "sp-pythn", NULL, SPTAG(1), 1, -1, "ipython3" }, + { "st", "sp-mixer", NULL, SPTAG(2), 1, -1, "alsamixer" }, }; /* layout(s) */ @@ -113,6 +116,9 @@ static const Key keys[] = { { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + { MODKEY, XK_grave, togglescratch, {.v = &rules[0]} }, + { MODKEY, XK_equal, togglescratch, {.v = &rules[1]} }, + { MODKEY, XK_minus, togglescratch, {.v = &rules[2]} }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) |