From 7c1d969be5b8c446e765b2ba15f6efd9e270cd7e Mon Sep 17 00:00:00 2001 From: guyuming76 Date: Mon, 8 Jan 2024 18:15:07 +0800 Subject: [PATCH] in tile mode, MOD+0 to view all tags, focus a specific client, and press MOD+T to call setlayout will switch to those tags associated with that focused client. This is useful when i do not use waybar --- dwl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dwl.c b/dwl.c index 632dabf..66123bf 100644 --- a/dwl.c +++ b/dwl.c @@ -2090,6 +2090,17 @@ setlayout(const Arg *arg) if (arg && arg->v) selmon->lt[selmon->sellt] = (Layout *)arg->v; strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol)); + + //if current tag is 0 and arg is &layout[0], that is, in tag 0, MOD+t is pressed, find the tag current focused window is associated and view that tag. + if (((selmon)->tagset[(selmon)->seltags]^TAGMASK)==0){ //if current selected tag is 1...111, XOR TAGMASK will be 0 + Client* current_focused_client = focustop(selmon); + if (current_focused_client){ + Arg tags_of_current_focused_client; + tags_of_current_focused_client.ui=current_focused_client->tags; + view(&tags_of_current_focused_client); + } + } + arrange(selmon); printstatus(); }