[wiki] [sites] [dwm][patch] focusmaster - Ability to map a key combination to switch focus to the master window. || Mateus Auler
commit 5e4bcd713fc8c6ad1f9e8276c2cecdb7df2ec7a7
Author: Mateus Auler <mateusauler_AT_protonmail.com>
Date: Fri Jul 17 18:20:07 2020 -0300
[dwm][patch] focusmaster - Ability to map a key combination to switch focus to
the master window.
diff --git a/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-20200717-bb2e722.diff b/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-20200717-bb2e722.diff
new file mode 100644
index 00000000..de49ddb5
--- /dev/null
+++ b/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-20200717-bb2e722.diff
_AT_@ -0,0 +1,44 @@
+From 3e020d93df3aaec92d2daa142cd1f0d5301b3197 Mon Sep 17 00:00:00 2001
+From: Mateus Auler <mateusauler_AT_protonmail.com>
+Date: Fri, 17 Jul 2020 12:36:36 -0300
+Subject: [PATCH] Ability to map a key combination to switch focus to
+ the master window.
+
+---
+ dwm.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 9fd0286..be01927 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -235,6 +235,8 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+ static void zoom(const Arg *arg);
+
++static void focusmaster(const Arg *arg);
++
+ /* variables */
+ static const char broken[] = "broken";
+ static char stext[256];
+_AT_@ -2150,3 +2152,17 @@ main(int argc, char *argv[])
+ XCloseDisplay(dpy);
+ return EXIT_SUCCESS;
+ }
++
++void
++focusmaster(const Arg *arg)
++{
++ Client *c;
++
++ if (selmon->nmaster < 1)
++ return;
++
++ c = nexttiled(selmon->clients);
++
++ if (c)
++ focus(c);
++}
+--
+2.27.0
+
diff --git a/dwm.suckless.org/patches/focusmaster/index.md b/dwm.suckless.org/patches/focusmaster/index.md
new file mode 100644
index 00000000..b0f3e427
--- /dev/null
+++ b/dwm.suckless.org/patches/focusmaster/index.md
_AT_@ -0,0 +1,20 @@
+focusmaster
+===========
+
+Description
+-----------
+Switch focus to the (tiled) master client from anywhere in the stack.
+
+Configuration
+-------------
+Add the following line to the keys array in your config.h (or config.def.h) to bind Mod+Ctrl+Space to focusmaster.
+
+ { MODKEY|ControlMask, XK_space, focusmaster, {0} },
+
+Download
+--------
+* [dwm-focusmaster-20200717-bb2e722.diff](dwm-focusmaster-20200717-bb2e722.diff) (2020.07.17)
+
+Author
+------
+* Mateus Auler - <mateusauler at protonmail dot com>
Received on Fri Jul 17 2020 - 23:26:27 CEST
This archive was generated by hypermail 2.3.0
: Fri Jul 17 2020 - 23:36:44 CEST