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.
January 28, 2010 at 10:58 pm
When I try this i go to load dwm and it loads for 1 second then back to the login manager…
March 2, 2010 at 1:39 am
while true; do dwm 2> ~/.dwm.log ; done
When you kill dwm it will restart right back up.
Useful if you update config.h and sudo make install a new binary.
October 14, 2010 at 9:25 pm
Instead of `/bin/true` use : . That puts less load onto the machine, is easier to type, and if you know the idiom it’s easier to read too.
while :; do
whatever
done
October 15, 2010 at 9:16 am
Thanks, didn’t know about the :