> while true; do > exec wmii > xmessage 'Restart the Window Manager?' \ > -buttons 'Yes:1,No:0' -center \ > -default 'Yes' -timeout 30 \ > && break > done > > > Unfortunately, that script does not prompt me if I want to restart wmii > if if closes/crashes. The result is that all my windows (and my work) is > gone.
You're using exec, once that line is reached, bash replaces itself with wmii. Just use "wmii" instead, or even: wmii || xmessage "Restart..." that way (assuming wmii returns 0 on successful exit) when you mean to exit, it's all fine.