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

18
dwm.c
View File

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

View File

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

View File

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

View File

@ -445,20 +445,20 @@
*/ */
#define SAVEFLOATS_PATCH 0 #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. * It is typically useful when one need to do some short typing.
* Upgraded to Christian Tenllado's multiple scratchpad version. * Upgraded to Christian Tenllado's multiple scratchpad version.
* https://lists.suckless.org/hackers/2004/17205.html * 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 /* 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 * 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 * 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. * 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 /* This alternative patch enables a scratchpad feature in dwm similar to the scratchpad
* feature in i3wm. * feature in i3wm.