You are not logged in.

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

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

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.

Online

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

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 23,441
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

#1555 2020-04-20 04:04:05

ltsdw
Member
Registered: 2020-04-20
Posts: 12

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

So, I was trying to adapt this patch dwm-statuscolors-6.1.diff to apply a top of dwm-6.2, everything was fine and marvelous, until I get into these lines at the dwm.c file:

	for(int i = 0; i < NUMCOLORS; i++){
		scheme[i].border = drw_clr_create(drw, colors[i][0]);
		scheme[i].fg = drw_clr_create(drw, colors[i][1]);
		scheme[i].bg = drw_clr_create(drw, colors[i][2]);
	}

Because it is already used something similar that modifies almost the same lines by this patch dwm-alpha-6.2.diff:

	scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
	for (i = 0; i < LENGTH(colors); i++)
		scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);

As I never have programmed in C before I don't know well the logic behind it to adapt my patch, someone could help me get through it, please? smile

Last edited by ltsdw (2020-04-20 08:26:44)

Offline

Board footer

Powered by FluxBB