Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

How to automatically close an application on shutdown (graceful close, not kill)?

I try to call wmctrl -c "App" in, but it does not work. The same wmctrl command works perfectly when typed in terminal or called from a script without superuser rights.

Why does not it work in and how to fix it?

share|improve this question

I was under the impression that a normal shutdown gracefully closes all processes anyway - that is, it calls SIGTERM on them, then waits for them to terminate - SIGTERM being the normal way of terminating a process and allowing it to do any clean-up work necessary before actually terminating.

That is, you don't need to worry about doing this.

share|improve this answer

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.