You are not logged in.

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

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

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

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: 23

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

#1556 2020-07-01 00:44:04

johannesthyssen
Member
Registered: 2020-06-30
Posts: 1

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

How can I hide all clients but the focused one?

Any ideas on how to hide all clients but the focused one on a keypress? I have tried

 xdo hide -dr 

as suggested in their man page, but it doesn't seem to work in dwm, why? I think an alternative would be to write a function that loops over all clients of the selected tag with

 for (c = nexttiled(selmon->clients); c; c = nexttiled(c->next)); 

an hide them all except from the focused one, but I can't figure out how. I want this so that I can use transparency in monocle layout without being able to see what's behind the selected client. Any ideas?

Offline

#1557 2020-07-01 00:47:31

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,009
Website

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

Send them to another tag...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#1558 2020-07-20 10:06:24

kanseidorifto
Member
Registered: 2020-07-20
Posts: 1

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

Hi! I've been using dwm for a few months but switched to xmonad when I got a triple monitor setup at work due to xmonad's way of handling multi-monitors. There's a patch for dwm the single tagset which is quite outdated and I haven't managed to rewrite it. Are there any alternatives? Do you have anything? I miss dwm. I feel I can't be the only one who misses an updated version of that patch. It is also possible that this functionality goes against the mentality behind dwm workflow, if that is the case, please enlighten me how to correctly use dwm on a multihead setup as having separate tags for each monitor feels a bit akward... TY!

tl;dr need single tagset patch, miss dwm

Last edited by kanseidorifto (2020-07-20 10:07:52)

Offline

#1559 2020-07-29 11:50:07

qurn
Member
Registered: 2017-10-13
Posts: 9

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

I try to write a function for dwm to change the normal mouse cursor from left to right (discussed here I'll close it when I'm done).

These are the functions i wrote:

void
point_left(const Arg *arg) {
	Client *c;
	Monitor *m;
	c = m->clients;
	cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
	if (XGrabPointer(dpy, root, True, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		c->win, cursor[CurNormal]->cursor, CurrentTime) != GrabSuccess)
		return;

}

void
point_right(const Arg *arg) {
	Client *c;
	Monitor *m;
	c = m->clients;
	cursor[CurNormal] = drw_cur_create(drw, XC_right_ptr);
	if (XGrabPointer(dpy, root, True, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		c->win, cursor[CurNormal]->cursor, CurrentTime) != GrabSuccess)
		return;
}

The pointer works to switch layers, but not in windows.
Note that i barely understand what I hacked together there -.-

Last edited by qurn (2020-07-29 11:50:44)

Offline

Board footer

Powered by FluxBB