summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2024-08-18 20:40:13 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-05-27 23:51:38 +0400
commit6f13ca6f9e7bc92aa1b6689341ef0dd33d86323a (patch)
treed02152074858fefa763dc4e391a50ce88a8f90a5
parent219ffa6873831fdd993707d6e60bcc183c7e616b (diff)
focusmaster patched and keybinds added
-rw-r--r--config.h3
-rw-r--r--dwm.c18
2 files changed, 21 insertions, 0 deletions
diff --git a/config.h b/config.h
index 827889f..398c0b9 100644
--- a/config.h
+++ b/config.h
@@ -102,6 +102,9 @@ static const Key keys[] = {
{ MODKEY, XK_minus, setgaps, {.i = -1 } },
{ MODKEY, XK_equal, setgaps, {.i = +1 } },
+ { MODKEY, XK_a, focusmaster, {0} },
+
+
{ MODKEY, XK_s, togglescratch, {.v = scratchpadcmd } },
diff --git a/dwm.c b/dwm.c
index da04bac..51a20d0 100644
--- a/dwm.c
+++ b/dwm.c
@@ -240,6 +240,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];
@@ -2255,3 +2257,19 @@ main(int argc, char *argv[])
XCloseDisplay(dpy);
return EXIT_SUCCESS;
}
+
+void
+focusmaster(const Arg *arg)
+{
+ Client *c;
+
+ if (selmon->nmaster < 1)
+ return;
+ if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
+ return;
+
+ c = nexttiled(selmon->clients);
+
+ if (c)
+ focus(c);
+}