diff options
| author | bakkeby <[email protected]> | 2020-08-11 10:25:19 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-08-11 10:25:19 +0200 |
| commit | 57e727b498e2916abdd7b819084c01c1db0f641b (patch) | |
| tree | 8eeea304450e03942ee6310e755d0906edb7d575 | |
| parent | 10f4d513ec5df78db1c2b83706c208c3032e64ca (diff) | |
| download | dwm-flexipatch-57e727b498e2916abdd7b819084c01c1db0f641b.tar.gz dwm-flexipatch-57e727b498e2916abdd7b819084c01c1db0f641b.zip | |
Adding focusmaster patch
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | config.def.h | 3 | ||||
| -rw-r--r-- | patch/focusmaster.c | 13 | ||||
| -rw-r--r-- | patch/focusmaster.h | 1 | ||||
| -rw-r--r-- | patch/include.c | 3 | ||||
| -rw-r--r-- | patch/include.h | 3 | ||||
| -rw-r--r-- | patches.def.h | 5 |
7 files changed, 31 insertions, 0 deletions
@@ -276,6 +276,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - provides the ability to focus the tag on the immediate left or right of the currently focused tag - it also allows to send the focused window either on the left or the right tag + - [focusmaster](https://dwm.suckless.org/patches/focusmaster/) + - a simple patch that just puts focus back to the master client + - [focusonclick](https://dwm.suckless.org/patches/focusonclick/) - this patch makes you switch focus only by mouse click and not sloppy (focus follows mouse pointer) diff --git a/config.def.h b/config.def.h index 72d08ab..17d6568 100644 --- a/config.def.h +++ b/config.def.h @@ -895,6 +895,9 @@ static Key keys[] = { { MODKEY, XK_p, spawn, {.v = dmenucmd } }, { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_b, togglebar, {0} }, + #if FOCUSMASTER_PATCH + { MODKEY|ControlMask, XK_space, focusmaster, {0} }, + #endif // FOCUSMASTER_PATCH #if STACKER_PATCH STACKKEYS(MODKEY, focus) STACKKEYS(MODKEY|ShiftMask, push) diff --git a/patch/focusmaster.c b/patch/focusmaster.c new file mode 100644 index 0000000..839fb43 --- /dev/null +++ b/patch/focusmaster.c @@ -0,0 +1,13 @@ +void +focusmaster(const Arg *arg) +{ + Client *c; + + if (selmon->nmaster < 1) + return; + + c = nexttiled(selmon->clients); + + if (c) + focus(c); +}
\ No newline at end of file diff --git a/patch/focusmaster.h b/patch/focusmaster.h new file mode 100644 index 0000000..5732e4b --- /dev/null +++ b/patch/focusmaster.h @@ -0,0 +1 @@ +static void focusmaster(const Arg *arg);
\ No newline at end of file diff --git a/patch/include.c b/patch/include.c index 68ff0c1..24293cd 100644 --- a/patch/include.c +++ b/patch/include.c @@ -105,6 +105,9 @@ #if FOCUSADJACENTTAG_PATCH #include "focusadjacenttag.c" #endif +#if FOCUSMASTER_PATCH +#include "focusmaster.c" +#endif #if FOCUSURGENT_PATCH #include "focusurgent.c" #endif diff --git a/patch/include.h b/patch/include.h index 6b695a1..2615109 100644 --- a/patch/include.h +++ b/patch/include.h @@ -105,6 +105,9 @@ #if FOCUSADJACENTTAG_PATCH #include "focusadjacenttag.h" #endif +#if FOCUSMASTER_PATCH +#include "focusmaster.h" +#endif #if FOCUSURGENT_PATCH #include "focusurgent.h" #endif diff --git a/patches.def.h b/patches.def.h index 797a14f..ce39c32 100644 --- a/patches.def.h +++ b/patches.def.h @@ -429,6 +429,11 @@ */ #define FOCUSADJACENTTAG_PATCH 0 +/* A simple patch that just puts focus back to the master client. + * https://dwm.suckless.org/patches/focusmaster/ + */ +#define FOCUSMASTER_PATCH 0 + /* Switch focus only by mouse click and not sloppy (focus follows mouse pointer). * https://dwm.suckless.org/patches/focusonclick/ */ |
