I would like to be able to save state of windows opened in all the tags on system halt/logout. Not necessarily with their whole history, just the fact that there was terminal under third tag and browser under fourth tag (for example).
How do I do that in DWM, is there any patch I could use?
Edit: I am aware of the philosophy behind DWM and that this probably would be possible by default (e.g. without patches). This is just something I would like to add to my configuration of DWM.
Best Answer
dwm isn't designed to save the state of your session; that is typically something that a more full-
bloatedblown desktop environment would do.Instead, you can write rules in your
config.h
for applications that you would like to start with consistent tags.To use the examples you mention, a browser and a terminal:
This will start a browser in tag 2, and a terminal in tag 1.
You could also add keybinds to simplify launching these applications:
When you start dwm, you can then hit your keybinds and have those applications assigned their respective tags. If you wanted to further develop on this concept, you could write a shell script that opened all of the applications that you require and bind that to a key sequence:
As long as there are rules for each of the individual applications, they will be assigned the correct tags; you just assign a key sequence for the shell script: