Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

I try to call wmctrl -c "App" in powerbtn.sh, 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 powerbtn.sh and how to fix it?

share|improve this question

1 Answer 1

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

 
discard

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.