Renamed SCRATCHPAD_PATCH --> SCRATCHPADS_PATCH to match the naming of the suckless patches as the multiple scratchpads patch has its own location now

This commit is contained in:
bakkeby 2020-06-05 11:23:22 +02:00
parent 09a5fc9097
commit 6321b52a30
5 changed files with 23 additions and 23 deletions

View File

@ -256,7 +256,7 @@ char *colors[][ColCount] = {
};
#endif // VTCOLORS_PATCH / FLOAT_BORDER_COLOR_PATCH
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL };
const char *spcmd2[] = {"st", "-n", "spfm", "-g", "144x41", "-e", "ranger", NULL };
const char *spcmd3[] = {"keepassxc", NULL };
@ -266,7 +266,7 @@ static Sp scratchpads[] = {
{"spranger", spcmd2},
{"keepassxc", spcmd3},
};
#endif // SCRATCHPAD_PATCH
#endif // SCRATCHPADS_PATCH
/* tagging */
#if EWMHTAGS_PATCH
@ -430,11 +430,11 @@ static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
{ NULL, "spterm", NULL, SPTAG(0), 1, -1 },
{ NULL, "spfm", NULL, SPTAG(1), 1, -1 },
{ NULL, "keepassxc",NULL, SPTAG(2), 0, -1 },
#endif // SCRATCHPAD_PATCH
#endif // SCRATCHPADS_PATCH
#endif
};
@ -595,9 +595,9 @@ static Signal signals[] = {
{ "toggleverticalmax", toggleverticalmax },
{ "togglemax", togglemax },
#endif // MAXIMIZE_PATCH
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
{ "togglescratch", togglescratch },
#endif // SCRATCHPAD_PATCH
#endif // SCRATCHPADS_PATCH
#if UNFLOATVISIBLE_PATCH
{ "unfloatvisible", unfloatvisible },
#endif // UNFLOATVISIBLE_PATCH
@ -971,11 +971,11 @@ static Key keys[] = {
{ MODKEY|ControlMask|ShiftMask, XK_k, toggleverticalmax, {0} },
{ MODKEY|ControlMask, XK_m, togglemax, {0} },
#endif // MAXIMIZE_PATCH
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
{ MODKEY, XK_grave, togglescratch, {.ui = 0 } },
{ MODKEY|ControlMask, XK_grave, togglescratch, {.ui = 1 } },
{ MODKEY|ShiftMask, XK_grave, togglescratch, {.ui = 2 } },
#endif // SCRATCHPAD_PATCH
#endif // SCRATCHPADS_PATCH
#if UNFLOATVISIBLE_PATCH
{ MODKEY|Mod4Mask, XK_space, unfloatvisible, {0} },
{ MODKEY|ShiftMask, XK_t, unfloatvisible, {.v = &layouts[0]} },

18
dwm.c
View File

@ -75,14 +75,14 @@
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
#define NUMTAGS (LENGTH(tags) + LENGTH(scratchpads))
#define TAGMASK ((1 << NUMTAGS) - 1)
#define SPTAG(i) ((1 << LENGTH(tags)) << (i))
#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags))
#else
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#endif // SCRATCHPAD_PATCH
#endif // SCRATCHPADS_PATCH
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
/* enums */
@ -564,12 +564,12 @@ applyrules(Client *c)
#endif // SWALLOW_PATCH
c->isfloating = r->isfloating;
c->tags |= r->tags;
#if SCRATCHPAD_PATCH && !SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
#if SCRATCHPADS_PATCH && !SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
if ((r->tags & SPTAGMASK) && r->isfloating) {
c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2);
c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
}
#endif // SCRATCHPAD_PATCH | SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
#endif // SCRATCHPADS_PATCH | SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
for (m = mons; m && m->num != r->monitor; m = m->next);
if (m)
c->mon = m;
@ -608,15 +608,15 @@ applyrules(Client *c)
XFree(ch.res_name);
#if EMPTYVIEW_PATCH
if (c->tags & TAGMASK) c->tags = c->tags & TAGMASK;
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags] & ~SPTAGMASK;
#elif SCRATCHPAD_ALT_1_PATCH
else if (c->tags != SCRATCHPAD_MASK && c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags];
#else
else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags];
#endif // SCRATCHPAD_PATCH
#endif // SCRATCHPADS_PATCH
else c->tags = 1;
#elif SCRATCHPAD_PATCH
#elif SCRATCHPADS_PATCH
c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : (c->mon->tagset[c->mon->seltags] & ~SPTAGMASK);
#elif SCRATCHPAD_ALT_1_PATCH
if (c->tags != SCRATCHPAD_MASK)
@ -3114,12 +3114,12 @@ showhide(Client *c)
if (!c)
return;
if (ISVISIBLE(c)) {
#if SCRATCHPAD_PATCH && !SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
#if SCRATCHPADS_PATCH && !SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
if ((c->tags & SPTAGMASK) && c->isfloating) {
c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2);
c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
}
#endif // SCRATCHPAD_PATCH | SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
#endif // SCRATCHPADS_PATCH | SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH
/* show clients top down */
#if SAVEFLOATS_PATCH || EXRESIZE_PATCH
if (!c->mon->lt[c->mon->sellt]->arrange && c->sfx != -9999 && !c->isfullscreen) {

View File

@ -99,7 +99,7 @@
#if ROUNDED_CORNERS_PATCH
#include "roundedcorners.c"
#endif
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
#include "scratchpad.c"
#endif
#if SCRATCHPAD_ALT_1_PATCH

View File

@ -102,7 +102,7 @@
#if ROUNDED_CORNERS_PATCH
#include "roundedcorners.h"
#endif
#if SCRATCHPAD_PATCH
#if SCRATCHPADS_PATCH
#include "scratchpad.h"
#endif
#if SCRATCHPAD_ALT_1_PATCH

View File

@ -445,20 +445,20 @@
*/
#define SAVEFLOATS_PATCH 0
/* The scratchpad patch allows you to spawn or restore floating terminal windows.
/* The scratchpads patch allows you to spawn or restore floating terminal windows.
* It is typically useful when one need to do some short typing.
* Upgraded to Christian Tenllado's multiple scratchpad version.
* https://lists.suckless.org/hackers/2004/17205.html
* https://dwm.suckless.org/patches/scratchpad/
* https://dwm.suckless.org/patches/scratchpads/
*/
#define SCRATCHPAD_PATCH 0
#define SCRATCHPADS_PATCH 0
/* The scratchpad patch above automatically resizes and centers the scratchpad window every
* time you spawn it. This alteration of the patch disables that so that the size and position
* of the scratchpad window is retained when you respawn it. If you enable this then you may
* want to also take the centered patch and enable the iscentered flag for floating scratchpads.
*/
#define SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH 0
#define SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH 1
/* This alternative patch enables a scratchpad feature in dwm similar to the scratchpad
* feature in i3wm.