You are not logged in.
This has been bugging me for a while now. It seems that Awesome waits for every line in the function to run before actually doing anything. For instance...
awful.util.spawn(app)
os.execute('sleep 10')
the application isn't spawned until the 10 seconds is over
Can anyone explain to me why awesome does things this way or if there's a way to circumvent it?
Thanks!
Sphaerophoria
Edit: Changed the example to make more sense
Last edited by Sphaerophoria (2012-05-28 21:07:45)
Offline
I'm not very familiar with awesome, but I've ran into similar issues in other situations under X. The solution is some sort of flush function. LibX11 has XFlush() which is likely what is needed, but I'm not sure what the name is in the lua API.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
After some quick googling looks like I use io.stdout:flush()
Thanks for the suggestion. I'll muck around with it a bit and see if i can make it work ![]()
Offline
Would you mind giving a quick example of how you fixed a similar issue?
Offline
You don't want to flush the stdout, although there is no harm in it. "Flush" is kind of a general term referring to pushing all recent commands or data from whatever memory buffer they may be in to their final target. This might be needed in any buffered system.
In most situations standard streams (eg stdout) are buffered. Flushing them will make sure the contents of the screen (for example) are updated. But this issue (IF I AM CORRECT, I may not be) is from buffering between the window manager and X11. You need to flush that communication line.
I've used in it C programs. I learned about it while writing a tool to send commands to X to change the root window name.
Edit: I suspect you'll have to check the functions in the Awful library to see what's available. My google-fu is weak right now "Awful library" is not returning anything remotely useful.
Last edited by Trilby (2012-05-28 21:51:22)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks. I realized that just before you posted. Please excuse my ignorance.
Offline
I found the docs but I don't see anything promising.
Depending on the end goal, a potential work-around would be to do some variations of
awful.util.spawn_with_shell("SomeProgram &; sleep 10")"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Read through something like this?
Offline
Beat you by 10 seconds.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks. Unfortunately that was just an example. What I actually wanted to do was start an application and wait for the window to spawn before doing anything else. I could potentially just use the sleep command as a temporoary work around though.
Offline