Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to show hidden clients when BAR_AWESOMEBAR_PATCH enabled #339

Open
ST-Saint opened this issue Feb 14, 2023 · 3 comments
Open

how to show hidden clients when BAR_AWESOMEBAR_PATCH enabled #339

ST-Saint opened this issue Feb 14, 2023 · 3 comments

Comments

@ST-Saint
Copy link

I noticed that Mod+ctrl+z could hide a client but the focus also shifts. Currently, focusstack will skip hidden clients and there is no way to focus a hidden client unless there is no other client.

I wonder if it is possible to show a hidden client still except click it at the bar.

Thanks.

@vide0hanz
Copy link

vide0hanz commented May 2, 2023

@bakkeby perhaps it is worth documenting this easter egg :)

Assuming the BAR_WINTITLE_ACTIONS patch is applied, the focusstack should resemble the following:

void
focusstack(const Arg *arg)
{
	Client *c = NULL, *i;

	if (!selmon->sel)
		return;
	if (arg->i > 0) {
		for (c = selmon->sel->next; c && (!ISVISIBLE(c) || (arg->i == 1 && HIDDEN(c))); c = c->next);
		if (!c)
			for (c = selmon->clients; c && (!ISVISIBLE(c) || (arg->i == 1 && HIDDEN(c))); c = c->next);
	} else {
		for (i = selmon->clients; i != selmon->sel; i = i->next)
			if (ISVISIBLE(i) && !(arg->i == -1 && HIDDEN(i)))
				c = i;
		if (!c)
			for (; i; i = i->next)
				if (ISVISIBLE(i) && !(arg->i == -1 && HIDDEN(i)))
					c = i;
	}
	if (c) {
		focus(c);
		force_warp = 1;
		restack(selmon);
	}
}

@ST-Saint In my config.h file, I have the following bindings for focusstack, where the values +2 and -2 focus on next and previous client regardless of whether the client is hidden or not.

{ MODKEY,                       XK_j,          focusstack,             {.i = +1 } },
{ MODKEY,                       XK_k,          focusstack,             {.i = -1 } },
{ MODKEY|Mod1Mask,              XK_j,          focusstack,             {.i = +2 } },
{ MODKEY|Mod1Mask,              XK_k,          focusstack,             {.i = -2 } },

@bakkeby
Copy link
Owner

bakkeby commented May 2, 2023

That was indeed the intention. In practice though it is better to have a standalone function that only focuses on hidden clients. The +/-2 may work fine as long as the hidden clients are arranged alongside visible clients, but not so much if they are arranged separately.

@vide0hanz
Copy link

Yes I agree that having a standalone function is the better solution, this was just to demonstrate to @ST-Saint that it could be done as-is. I find this to be the more intuitive approach, but I don't group clients together and sometimes I like to perform other actions on hidden clients like placing them elsewhere in the stack. This method is nice for visual feedback as to where a hidden client is and where I can expect it to be once I un-hide it.

To each their own though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants