sites

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

commit 5e4bcd713fc8c6ad1f9e8276c2cecdb7df2ec7a7
parent 1842ab48e290c62b0fbb58c1c89fff784d7527e6
Author: Mateus Auler <mateusauler@protonmail.com>
Date:   Fri, 17 Jul 2020 18:20:07 -0300

[dwm][patch] focusmaster - Ability to map a key combination to switch focus to
 the master window.

Diffstat:
Adwm.suckless.org/patches/focusmaster/dwm-focusmaster-20200717-bb2e722.diff | 44++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/focusmaster/index.md | 20++++++++++++++++++++
2 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-20200717-bb2e722.diff b/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-20200717-bb2e722.diff @@ -0,0 +1,44 @@ +From 3e020d93df3aaec92d2daa142cd1f0d5301b3197 Mon Sep 17 00:00:00 2001 +From: Mateus Auler <mateusauler@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 +@@ -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]; +@@ -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 @@ -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>