You are not logged in.

#1551 2019-12-05 23:48:04

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 2,965

Re: DWM Hackers Unite! Share (or request) dwm patches.

zanculmarktum wrote:

How about having `dwm -q` creating a file called ~/.dwm/quit to give dwm a signal to quit? Can you please do that?

Don't make this more complicated than it needs to be.

Trilby wrote:

How about just `killall dwm`?  Or similarly, `killall xinit` (or startx depending on which you use).  Or you could just use a different key binding that you're less likely to hit by accident.

Offline

#1552 2019-12-06 00:47:08

Trilby
Banned
Registered: 2011-11-29
Posts: 22,631
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

zanculmarktum wrote:

How about having `dwm -q` creating a file called ~/.dwm/quit to give dwm a signal to quit? Can you please do that?

That'd require dwm to constantly check for that file's presence which which would be horribly ugly and inefficient.  It'd be easy to code, but as I'd see that as defacing a masterpiece, no, I will not do that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#1553 2019-12-07 21:20:36

zanculmarktum
Member
Registered: 2016-09-25
Posts: 10

Re: DWM Hackers Unite! Share (or request) dwm patches.

I've decided to use signal big_smile
The problem with `killall dwm` is that it terminates dwm without giving it chance to run cleanup() function.
https://gitlab.com/zanc/dwm/blob/master … quit.patch

Offline

#1554 2019-12-23 10:14:08

dpx
Member
Registered: 2017-01-09
Posts: 31

Re: DWM Hackers Unite! Share (or request) dwm patches.

With 16:9 monitor, opening single terminal with tiling WM makes text being 'too far to the left', especially with bigger monitors. I got tired of having to sit facing left half of my monitor, so here is modified tile() layout:

  • With single window open, it will center that window simulating old 5:4 monitor size. That was the aspect ratio when monitor aspect ratios made sense.

  • More than one window and it will use standard tile layout.

void
tile54(Monitor *m)
{
        unsigned int i, n, h, mw, my, ty, move;
        Client *c;

        for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
        if (n == 0)
                return;

        if (n == 1) {
                mw = m->ww * 0.703125;  // 16:9 to horizontal 5:4
                //mw = m->ww * 0.45;    // 16:9 to vertical 5:4
                move = (m->ww - mw) / 2;
                h = m->wh;
                c = nexttiled(m->clients);
                i = my = ty = 0;
                resize(c, m->wx + move, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
                return;
        }

        if (n > m->nmaster)
                mw = m->nmaster ? m->ww * m->mfact : 0;
        else
                mw = m->ww;
        for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
                if (i < m->nmaster) {
                        h = (m->wh - my) / (MIN(n, m->nmaster) - i);
                        resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
                        my += HEIGHT(c);
                } else {
                        h = (m->wh - ty) / (n - i);
                        resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
                        ty += HEIGHT(c);
                }
}

Last edited by dpx (2019-12-23 16:30:26)

Offline

Board footer

Powered by FluxBB