Hello. I am trying to write a shell script to better utilize my multimedia keys (I have them working fine). Basically I want the button to execute a script that checks if the program is running, in this case zapping. If it is I want it to close it, if it is not, I want it to start the program. I have all the conditions set right, that is not what I need help with. Rather I simply need to know if there is a shell command to cause an x program to exit normally. I checked the zapping man page and found no help there. Kill is not a good idea. One, I'm assuming you shouldn't use that unless the app hangs and Two, I've already experimented with it and it leaves the audio going. Any help would be greatly appreciated.
I have Mandrake 9.1 running KDE and Zapping 0.6.5.
Thank you ahead of time.