How to correctly implement the i3bar protocol?
I've done a ruby script that works, but sometimes it hits a delay (the same as my sleep line) and only then, the status is drawn. If the sleep is set to 10 seconds, sometimes the bar will wait 10 seconds before the text is drawn.
I've tried using the verbose mode but no errors are showed.
I know it's not a ruby thing, since it happens too with the provided script at:
http://code.stapelberg.de/git/i3/tree/contrib/trivial-bar-script.sh?h=next
Change the delay from 1 to 10 seconds, and it will hit the delay randomly after a restart. Just keep restarting i3 and it will happen.
Because of this, programs like dropbox won't launch, because the tray is not active when it's launched (it's somehow sleeping).
I've also seen that I can skip that delay by changing workspaces, as events are generated the bar is forced to be drawn. May be I should try generating an event but I don't know how.
Any help would be great.
Here is my script: http://pastebin.com/NUG7xR8K
Sounds like an i3bar bug then. Can you file a ticket at http://bugs.i3wm.org and include the output of `strace -f -o /tmp/strace.log -tt -s 2048 i3bar --bar_id=bar-0` (only include logfiles where you could reproduce the problem, keep the logfiles as short as possible)?