cdown / dwm

Dynamic window manager for X (with extensive customisation)
MIT License
59 stars 11 forks source link

Save tags in X atoms #15

Closed cdown closed 1 year ago

cdown commented 2 years ago

An idea that could improve selfrestart/etc. Store the current c->tags in an X atom, and read it back out when clients get managed.

cdown commented 1 year ago

Considering all the other things that need to be saved -- mfact, stack position, monitor, etc, this seems a bit useless. A start is in https://github.com/cdown/dwm/tree/cdown/2022-12-16/client_tags though

explosion-mental commented 1 year ago

Hello I've thought of something similar..:

https://github.com/explosion-mental/demwm/blob/0c3b4232b69edf56ea50baf5c2dc68aa3ced742d/demwm.c#L2671-L2684

Which is easier to handle than the bits dance done by the dusk knight (impressive, yet confusing/complicated for m):

https://github.com/bakkeby/dwm-flexipatch/blob/668e18fddf11ea3071c92fa348b316366ffaf66a/patch/seamless_restart.c#L64-L78

cdown commented 1 year ago

Thanks! Stuffing them is certainly one option. The only thing I have briefly wondered about is things like a tag or monitor going away after the reload and working out what to do about that, but they can probably just get shoved to monitor 0/tag 0 (and it's pretty unlikely anyway).

explosion-mental commented 1 year ago

Right... I haven't tested that edge case. When a monitor disconnects in the middle of the reload/refresh/restart.

What is even the behavior in vanilla dwm? I would think that all clients over there would go to monitor 0 and first tag (tag 0).

I think it can be implemented a default value if the monitor doesn't exist, but the tag would remain the same, which is better than throwing everything into the first tag imo.

cdown commented 1 year ago

In vanilla on restart everything goes through manage() again, so gets assigned to selmon (or t->mon for transient windows). Similar for when a monitor gets removed in updategeom().

That also seems like a perfectly fine default if m->num is nonexistent :-)

explosion-mental commented 1 year ago

Ah yeah, selmon.

explosion-mental commented 1 year ago

good build btw, very elegant tho I'm not sure how u live without scratchpads.

cdown commented 1 year ago

Thanks! For scratchpad, I have one! It's Mod + Shift + Enter, which opens a floating/centered urxvt client. :)

explosion-mental commented 1 year ago

Just one? haha I got like 5 :p

Hey @cdown off topic, just wondering if you happen to use matrix? Ive seen suckless uses irc but that's not to my liking, not sure what u use.

cdown commented 1 year ago

I use irssi to access IRC, although irssi 1.4 broke a lot of stuff which I need to fix (like nickcolor.pl) :-)

Never really used Matrix, nothing against it, just never had any need to.

I use Mattermost (through matterhorn) for work, but I would definitely not recommend that -- the client is buggy as hell and Haskell does not lend itself well to a program like this.