5
0
I want dwm to close all windows gracefully when I press quit hotkey. I like Unity behaviour: it displays list of windows denying logout (for example, editors with unsaved changes) and do not logout before all issues are resolved and applications are closed. By default, dwm just end X session and all running applications are killed.
I was thinking about writing a script that will retrieve list of all windows, gracefully close them and wait for their processes to finish. But I even don't know how to close windows. The only way I know is using wmctrl, and this utility doesn't work with dwm.
since i have experience working with DWM's code, but this isn't stackoverflow so i must stay in context: you'll have to have a wrapper around dwm, that's the best you can do without having to rewrite code. I use a script that sends sigterm to everything except dwm running underneath it, and if (only if) everything was also killed, which is not the case if a program pops up a "save your document" box, then kills dwm as well (if not/no kill).You can modify such a script to do what you want however wrapping it without going into codes the real challenge. (but like i said this isnt stackoverflow) – osirisgothra – 2014-05-05T11:05:01.417
btw you can use a combination of ps, kill, grep and sed, to get the info you need about your processes when in a script, of course you can find the correct dwm instance via the DISPLAY variable – osirisgothra – 2014-05-05T11:11:10.707