--- 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
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
]]>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.
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
]]>You only want the status bar on your primary monitor, irrespective of where the focus is?
Yes, but I think I just found what I am after - https://dwm.suckless.org/patches/staticstatus/
If that doesn't work, having the status information on all monitors will work. The status information switching monitors was too distracting.
So, my question is answered. Thanks for the reply.
]]>But what I was actually looking for was a patch (or command) that would only draw and update the status information on the main monitor. Does that exist?
]]>The desired behavior that I would like to have is whenever I kill one window, next in stack is focused if exists else the previous one. I was trying to write something myself but this is beyond me since I do not know C and I am not familiar with such programs like dwm.
Could you please help me out with this issue?
[EDIT 1]: Adding
restack(selmon);
in killclient looked like solution but I was wrong
[EDIT 2]: Adding:
for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
if (!c) {
for (i = selmon->clients; i != selmon->sel; i = i->next)
if (ISVISIBLE(i))
c = i;
if (!c)
for (; i; i = i->next)
if (ISVISIBLE(i))
c = i;
}
if (c) {
focus(c);
restack(selmon);
}
to killclient looks like it is working but now I am not sure if I need all that. This was taken from focusstack. Can I remove something or make it more efficient?
]]>Does anyone have a working runorraise patch for dwm-6.2?
]]>