#418 lua first call to ${cpu cpu0} and top objects returns '' or

git
closed-wont-fix
nobody
Code (277)
5
2012-07-17
2012-07-10
arclance
No

In lua scripts using conky_parse the first call to ${cpu cpu0} returns '', top objects return ' ', ${swapperc} returns 'No swap', ${wireless_bitrate x} returns ''', and ${wireless_link_qual_perc x} returns 'unk' every time.

conky -DD output showing this happen is attached.

Discussion

  • arclance

    arclance - 2012-07-10

    conky -DD output

     
  • arclance

    arclance - 2012-07-10

    .conkyrc

     
  • arclance

    arclance - 2012-07-10

    conky -v output

     
  • arclance

    arclance - 2012-07-10

    I added a small sample lua script that exhibits this behavior, my .conkyrc settings, and conky -v output.

     
  • pavelo

    pavelo - 2012-07-17
    • status: open --> closed-wont-fix
     
  • pavelo

    pavelo - 2012-07-17

    I do not consider this a bug. This is a consequence of how conky gathers information about the system: It only starts to gather information after the first request (we want to avoid burning cycles gathering something we will never use) and it does it asynchronously (otherwise, we might hang for a long time while displaying e.g. things that require network connections).
    Therefore, the information is not available immediately after the first request. This can cause some discomfort in scripts, but I do not see what can be done about it now. We may try to mitigate this in some future version, but i am not sure it can be solved completely.

    I hope this answers your question.

     
  • arclance

    arclance - 2012-07-17

    Ok that is what I suspected but I wanted to bring it up in case it was a bug.

    What I thought was weird is that it only happend for cpu0 and not for cpu1 to cpu8.

    You can hid the effect in a lua script by using the first update to call the objects that do this without displaying anything.

    That way the first time you draw something everything will be ready to return data.

     

Log in to post a comment.