flua scripts in wmswallowForum: Programming and Scripting Topic: flua scripts in wmswallow started by: mikshaw Posted by mikshaw on Jan. 26 2006,03:47
I've noticed when you swallow a flua script with wmswallow (which is a neat trick, by the way) the script continues to run if wmswallow is killed....but it is no longer visible. I'm sure there are not many situations where this would occur, but i was wondering if there are ways to kill the script automatically if its container dies.Another thing...there does not seem to be a way to swallow a flua script from within that script (so there could be a single command to load the script and then swallow it). I assume if you wanted to do this, there would need to be a second script to launch both and then quit? Posted by John on Jan. 31 2006,07:28
You could kill the application after wmswallow by doing a wrapper script. Here is a simple example in Lua:execute('app & sleep 1') execute('wmswallow windowname') execute('killall -9 app') If you wrote the rapper in Bash you could capture the PID and just kill that instance of the application. It may make more sense to write a short wrapper script in bash because of that. #!/bin/bash app & PID=$! sleep 1 wmswallow appname kill -9 $PID As to your other point, no I don't think there is a way because I don't think Lua could fork. Posted by mikshaw on Jan. 31 2006,15:35
so....the bash script stays open while wmswallow is running. If wmswallow is killed, crashes, or otherwise ceases to exist, the bash script then continues and kills the flua script.Is that correct? Posted by John on Feb. 01 2006,22:19
yeah
Posted by mikshaw on Feb. 02 2006,03:06
Thank you.swallowing flua scripts into the slit is a cool idea. I'm not sure what I'll use it for, but i'm sure it'll come in handy for something. Hmmm....i wonder if flua will overlap the wmswallow frame.... |