You are not logged in.
Hello,
I've been patching and customizing DWM to my likings but there's one thing I didn't manage to find. I've seen several persons ask it before but never got a working reply. I am looking for a way to focus the last active window. Not the "view" function which opens last used tag, but a way to switch the focus between the two last active windows, no matter in which tag they are. Those two last windows could be in the same tag, it would then switch focus between the two apps inside the same tag, or in different tags and it would swap between the tags giving focus to each app.
Did you see a patch to achieve something like this?
Thank you in advance
Offline
Hi, i'm looking for a patch that will make floating window, when it's switched from tiled to floating, centered and resized to become smaller. Thx for help.
Offline
Hi, i'm looking for a patch that will make floating window, when it's switched from tiled to floating, centered and resized to become smaller. Thx for help.
That's what you are looking for.
https://dwm.suckless.org/patches/save_floats
It resizes the windows to their original size and places them centered. I use it all the time.
Offline
Hello,
I've been patching and customizing DWM to my likings but there's one thing I didn't manage to find. I've seen several persons ask it before but never got a working reply. I am looking for a way to focus the last active window. Not the "view" function which opens last used tag, but a way to switch the focus between the two last active windows, no matter in which tag they are. Those two last windows could be in the same tag, it would then switch focus between the two apps inside the same tag, or in different tags and it would swap between the tags giving focus to each app.
Did you see a patch to achieve something like this?
Thank you in advance
I'm very sure I've had such a patch applied a few years ago but cannot remember its name. Have you tried all patches on https://dwm.suckless.org/patches ?
edit: That one? https://dwm.suckless.org/patches/swapfocus
Last edited by sekret (2021-11-24 17:25:21)
Offline
I have one inconvenience using dwm since I recently started using transparent terminal. The monocle layout is actually displaying windows behind the current one and that is quite distracting.
Is there a way to use monocle layout with multiple transparent windows stacked without background windows being shown?
Offline
Alfodr, either use pseudo-transparency rather than real transparency with the added benefit of it using fewer resource (cpu / ram), or edit the monocole layout function to only place the first window in monocle position, and all the others off screen.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Trilby I do not know how to make edits in monocle function. I would guess when we are iterating through clients, I would need to somehow set 0 size or something to all but front window (monitor->sel is first maybe?)
Offline
Untested, but this should do it:
--- old/dwm.c
+++ new/dwm.c
@@ -1115,8 +1115,10 @@
n++;
if (n > 0) /* override layout symbol */
snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
- for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
+ c = nexttiled(m->clients);
+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
+ for (; c; c = nexttiled(c->next))
+ XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
}
void
EDIT: in hindsight, the first client from "nexttiled" may be the first in the stack, but not the focused window. If that is the case, then the resize would have to be applied to a different client prehaps m->sel ... it's been ages since I messed with dwm code. Though if there are floating windows, m->sel might be one of them ... So this is probably better:
--- old/dwm.c
+++ new/dwm.c
@@ -1116,7 +1116,8 @@
if (n > 0) /* override layout symbol */
snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
+ if (c == m->sel) resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
+ else XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
}
void
Last edited by Trilby (2021-12-24 20:53:45)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
First code was hiding all but I was able to cycle between invisible windows and enter text. The second one is looking right but I cannot rotate stack. If I close he first one, next is placed ok
Offline