Programming and Scripting :: flua scripts in wmswallow



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?

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.

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?

yeah
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....

Next Page...
original here.