I'm using xdm and my ~/.Xsession looks like this:

# <initialization stuff here>

exec openbox

It works, but I've noticed that when I log out Openbox doesn't gracefully kill all the applications. In particular Google Chrome complains about that.

How can I make sure to wait for all processes to exit (just like others configurations: Gnome, KDE, Windows ...)?

The only (ugly) solution that I've found involves sleep and kill into ~/.Xsession.


You need a session manager to gracefully kill the applications. openbox-session may do what you want. The documents explicitly say it doesn't do the saving session part, but it may do the gracefully kill part. openbox-gnome-session or openbox-kde-session will let you use the respective session managers while using openbox as your window manager.

  • Tried that, no way, same behavior. What else can I use as session manager? I can't see many (stand-alone) choices. – cYrus Aug 26 '10 at 20:00

Here's how I solved, I edited ~/.Xsession this way:

# <initialization stuff here>

openbox-session &

sleep 0.5 # time needed to start openbox

# <autostart applications here>

wait $WM_PID

for i in `ps -u $USER -o pid= | grep -v $$` ; do
    kill $i

sleep 1 # grace time

I can't find anything better by now. Maybe I should use a session manager but I don't know which one fits my case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.