sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit b53b0393c5a8335e896ca0a3fb489b61399fb055
parent d49d49104ec69a3b70089f84c569db94274f316e
Author: GasparVardanyan <gaspar.vardanyan.mailbox@gmail.com>
Date:   Mon, 24 Jan 2022 05:29:32 +0400

[dwm][patch][multipledynamicscratchpads] some fixes

Diffstat:
Mdwm.suckless.org/patches/multipledynamicscratchpads/dwm-multiple-dynamic-scratchpads.diff | 22+++++++++++-----------
Mdwm.suckless.org/patches/multipledynamicscratchpads/index.md | 6+++---
2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/dwm.suckless.org/patches/multipledynamicscratchpads/dwm-multiple-dynamic-scratchpads.diff b/dwm.suckless.org/patches/multipledynamicscratchpads/dwm-multiple-dynamic-scratchpads.diff @@ -14,7 +14,7 @@ index a2ac963..1c82453 100644 + { MODKEY|ShiftMask, XK_u, scratchpad_hide, {.i = 3} }, + { MODKEY|ShiftMask, XK_r, scratchpad_remove, {0} }, }; - + /* button definitions */ diff --git a/dwm.c b/dwm.c index 5e4d494..8e6fe18 100644 @@ -35,22 +35,22 @@ index 5e4d494..8e6fe18 100644 @@ -269,11 +274,19 @@ static Drw *drw; static Monitor *mons, *selmon; static Window root, wmcheckwin; - + +/* scratchpad */ -+#define SCRATCHPAD_MASK_1 512 -+#define SCRATCHPAD_MASK_2 1024 -+#define SCRATCHPAD_MASK_3 2048 ++#define SCRATCHPAD_MASK_1 (1u << sizeof tags / sizeof * tags) ++#define SCRATCHPAD_MASK_2 (1u << (sizeof tags / sizeof * tags + 1)) ++#define SCRATCHPAD_MASK_3 (1u << (sizeof tags / sizeof * tags + 2)) +static int scratchpad_hide_flag = 0; +static Client *scratchpad_last_showed_1 = NULL; +static Client *scratchpad_last_showed_2 = NULL; +static Client *scratchpad_last_showed_3 = NULL; /* configuration, allows nested code to access above variables */ #include "config.h" - + /* compile-time check if all tags fit into an unsigned int bit array. */ -struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; -+struct NumTags { char limitexceeded[LENGTH(tags) > 30 ? -1 : 1]; }; - ++struct NumTags { char limitexceeded[LENGTH(tags) > 28 ? -1 : 1]; }; + /* function implementations */ void @@ -309,7 +322,9 @@ applyrules(Client *c) @@ -61,12 +61,12 @@ index 5e4d494..8e6fe18 100644 c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; + } } - + int @@ -1408,6 +1423,121 @@ scan(void) } } - + +static void scratchpad_hide(const Arg *arg) { + if(scratchpad_hide_flag < 4) { + if(arg->i == 1) { @@ -193,7 +193,7 @@ index 5e4d494..8e6fe18 100644 + scratchpad_last_showed_1 = NULL; + } + if(scratchpad_last_showed_2 == c) { -+ scratchpad_last_showed_2 = NULL; ++ scratchpad_last_showed_2 = NULL; + } + if(scratchpad_last_showed_3 == c) { + scratchpad_last_showed_3 = NULL; diff --git a/dwm.suckless.org/patches/multipledynamicscratchpads/index.md b/dwm.suckless.org/patches/multipledynamicscratchpads/index.md @@ -1,5 +1,5 @@ multipledynamicscratchpads -========== +========================== Description ----------- @@ -7,7 +7,7 @@ The scratchpad patch allows you to spawn or restore a multiple floating windows. It is usually useful to have multiple windows spawn and hidden quickly using individual keys. By default your keybinding are `MODKEY+XK_{s, y, u}` to to show scratchpad, -`MODKEY|ShiftMask+XK_{s, y, u}` to create a scratchpad and +`MODKEY|ShiftMask+XK_{s, y, u}` to create a scratchpad and `MODKEY|ShiftMask+XK_r` to remove scratchpad. A `config.def.h` change is included in the patch. @@ -18,4 +18,4 @@ Download Authors ------- -* Anukul Adhikari <hi@anukul.com.np> +* Anukul Adhikari <hi@anukul.com.np>