Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ConkyText #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add ConkyText #16

wants to merge 4 commits into from

Conversation

simotek
Copy link

@simotek simotek commented May 5, 2023

This is a text box that does conky variable substitution, as an easy way to get data.

By the way no need to review these in a hurry, I'm giving a talk at a conky talk at conference in Germany in a couple of weeks so i'm trying to get a bit done, i'll try and send everything in easy to review chunks although other then some sort of theme idea i'll probably slow down on submissions to you until I have the new text stuff in upstream conky

simotek added 3 commits May 1, 2023 23:02
This will hopefully make them easier to maintain in the long term. The main polycore config all the examples and tests have been updated although the test suite isn't rendering for me. For now the split is as follows, but open to changes and suggestions:
  * widget_core * Widget * Rows * Columns * Filler * Frame
  * widget_cpu
    * Cpu
    * CpuRound * CpuFrequencies
  * widget_drive * Drive
  * widget_gpu
    * Gpu
    * GpuTop
  * widget_graph - This could have a better name * Bar * Graph * LED
  * widget_memory
    * MemoryBar
    * MemoryGrid
  * widget_network * Network
  * widget_text
    * Text
    * StaticText * TextLine
* Now paint the backgrounds in the pre section.
* Unfortunatly we need to clear and repaint all backgrounds every
  cycle, unless we want to start tracking which widgets overlap
  others.
This uses a multi line format similar to TextLine but will
substitute conky variables using the conky_parse function.
cairo_set_source_rgba(cr, unpack(self._color))
for i, line in ipairs(self._lines) do
local y = self._baseline_offset + (i - 1) * self._line_height
self._write_fn(cr, self._x, y, conky_parse(line))
Copy link
Owner

@philer philer May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A while ago conky_parse was very slow, see this issue. I don't know if that has since been fixed or if it is still relevant. At the time I implemented the eager loader in data.lua to centralize retrieving data from conky_parse.

Have you tried using this in an example with many instances? It would be interesting to observe if there is any slowdown/lag compared to plain conky text.

Edit: Maybe renaming this widget to ConkyParse would make it more obvious what it does?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like that issue has been marked as resolved, so far i've really only played with a CPU Top example, which is using 10 calls which seemed fine performance wise, I can make that name change tomorrow.

@simotek
Copy link
Author

simotek commented May 9, 2023

I did the rename but I didn't regenerate the docs yet because i'm guessing that will just cause mass conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants