From 6321b52a302dded8224390a81bb60a7073bec2f3 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 5 Jun 2020 11:23:22 +0200 Subject: [PATCH] Renamed SCRATCHPAD_PATCH --> SCRATCHPADS_PATCH to match the naming of the suckless patches as the multiple scratchpads patch has its own location now --- config.def.h | 16 ++++++++-------- dwm.c | 18 +++++++++--------- patch/include.c | 2 +- patch/include.h | 2 +- patches.def.h | 8 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/config.def.h b/config.def.h index 3319c70..3ce81e8 100644 --- a/config.def.h +++ b/config.def.h @@ -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]} }, diff --git a/dwm.c b/dwm.c index 8c4097f..b49c6d3 100644 --- a/dwm.c +++ b/dwm.c @@ -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) { diff --git a/patch/include.c b/patch/include.c index 49785da..9d88b94 100644 --- a/patch/include.c +++ b/patch/include.c @@ -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 diff --git a/patch/include.h b/patch/include.h index d26d740..bb91ee2 100644 --- a/patch/include.h +++ b/patch/include.h @@ -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 diff --git a/patches.def.h b/patches.def.h index 967749a..dfffcbe 100644 --- a/patches.def.h +++ b/patches.def.h @@ -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.