Posts Tagged ‘dwm’

dwm restart

January 8, 2010

dwm is a wonderful window manager for X: it’s small, fast and stable.

the only thing I missed, until today, was the possibility to restart it without losing my X session (i.e. all the open windows, etc.). restarting dwm is something you might need to do often, as it does not have config files: changes are done by recompiling the sources.

the trick is to execute dwm in background and sleep forever!

take a look at the last two lines of my .xinitrc:

---
dwm &
sleeper
---

where sleeper looks like this:

---
#!/bin/sh
while `/bin/true`; do
sleep 1000
done
---

now, if you kill dwm (usually with ALT-SHIFT-q) the windows (and X) will still be alive and you can type dwm& in any xterm to get dwm up and running again.

if you really want to quit X, you need to kill the sleeper.

Advertisements