How to gracefully close program without using wmctrl?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

How to gracefully close program without using wmctrl?

#1 Post by MochiMoppel »

Wmctrl has the ability to close programs gracefully. When a program, e.g. geany, hasn't yet saved its data, the program will show a dialog and offer to save the data before finally closing.

This seems to be simple task and I was hoping that this can be done wiith a standard command line tool, without relying on wmctrl, but using kill or pkill with various signals will either kill immediately or not at all. Any ideas?

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Anything wrong with wmctrl?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#3 Post by amigo »

run 'kill -l' to see a list of the signals which can be sent. SIGINT is probably what you want. After that settles, you then use kill -9 or kill -15.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#4 Post by MochiMoppel »

amigo wrote: SIGINT is probably what you want. After that settles, you then use kill -9 or kill -15.
I wrote:using kill or pkill with various signals will either kill immediately or not at all.
Nope. That's why I'm so puzzled. I've tried them all.

Post Reply