commit 6f872bcd148d87d37856971c7d281c919e6fb9e9
parent d1fc0193c691d9469a7a11ef744a22161f157d18
Author: Alex Balgavy <alexander.balgavy@spaceapplications.com>
Date: Fri, 26 Jan 2024 16:01:15 +0100
When viewing all tags, allow jumping to first tag associated with client
Diffstat:
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/config.h b/config.h
@@ -176,7 +176,7 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_s, togglesticky, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
- { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ { MODKEY|ShiftMask, XK_0, jumptotag, {0} },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
diff --git a/dwm.c b/dwm.c
@@ -281,6 +281,7 @@ static void zoom(const Arg *arg);
static void load_xresources(void);
static void livereload_xresources(const Arg *arg);
static void resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst);
+static void jumptotag(const Arg *arg);
static pid_t getparentprocess(pid_t p);
static int isdescprocess(pid_t p, pid_t c);
@@ -2751,6 +2752,20 @@ livereload_xresources(const Arg *arg)
arrange(NULL);
}
+void
+jumptotag(const Arg *arg) {
+ if (selmon->pertag->curtag != 0)
+ return;
+
+ for (int i = 0; i < LENGTH(tags); i++) {
+ if (selmon->sel->tags & 1 << i) {
+ Arg a = {.ui = 1 << i};
+ view(&a);
+ return;
+ }
+ }
+}
+
int