Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I quit xmonad (Shift-Mod-Q), it kills all my running applications. This results in me losing my recent terminal history in gnome-terminal and in Chromium complaining on the next start up that it was shut down incorrectly.

How can I make xmonad quit the applications nicely?

I am running xmonad on ubuntu 12.04. I am not running it on top of gnome-session.

share|improve this question
up vote 3 down vote accepted

Install wmctrl using your package manager.

Then use this little script to close all of your windows gracefully

for win in $(wmctrl -l | awk '{print $1}'); do

wmctrl -i -c $win


Add this to your quit keybinding before xmonad exits itself.

I tested this with firefox and when I stared it next it, started correctly like I closed the window myself.

share|improve this answer
I ended up running XMonad on top of XFCE instead, so I don't have this problem anymore. I'm going to trust you that it works and accept this answer without testing it. – Jonatan Kallus Dec 1 '13 at 15:09
You will need to enable… in order for this to work. – Florian Mayer Apr 3 '14 at 0:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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