
On 21 May 2012 17:58, Brandon Allbery
On Mon, May 21, 2012 at 5:52 PM, Pablo Olmos de Aguilera Corradini
wrote: I know there are a couple of ways to autostart, through xinit, xsession, 'spawn', 'spawn' a shell script, ecc. Afaik there's not a unique answer.
There is no single way to use xmonad, so there can't be a single answer that covers all cases.
I know, maybe my question wasn't clear enogh. I was wondering if there were a kind of "best practice" to do it (or simply an advice). I was adding every app in a autostart script that was being called from xmonad, it did work, but I found some issues like recognizing and loading the status bars correctly, the windows having weird borders (like two colors instead of one), some apps appearing and dissapearing from the tray or being . In the end, every time I was having to "mod + q" to get the things right. Now I have removed the call to that script and I'm running the apps by hand, which is 'okay', but I of course would prefer to do it automatically.
Sometimes I need the apps to run at the end, after the whole environment is loaded. I don't know if there's a hook or something like that.
"After the whole environment is loaded" is not a well defined state;
With 'the whole environment loaded', I meant it after xmonad is 'ready to receive my inputs'. The "startup script" was being ran somewhere during xmonad was being loaded (which is my explanation about why it acted weirdly). I don't know if I'm right, but if it was being 'spawned' (spawnPipe) inside tha 'main' program, my guess is that in the best case both files were running at the same time, and the worst, xmonad was waiting for the script to finish.
especially if you mean "all application windows are open and where they belong", the only way to do it is to have code in (probably) the logHook that watches the pieces fall into place and triggers something once it all has done so (and then sets a persistent flag so it won't re-trigger next time it thinks everything is ready). Think about it a bit.
I'm gonna read about the logHook, thanks for the advice :) Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/