Closed Ocisra closed 5 years ago
Do you have a config and/or lua script we can run to understand this issue better?
Yes OK I'll send code with screenshots of result tomorrow
Edit : in a few minutes, sorry for the unnecessary post 😅
Here is my lua code, I won't change it during the tests, it will just display 'ocisra' on the top left corner. But for the first example I won't use it
Here is my conkyrc, it will just display 'ocisra'. Note that conky will have his own window and the minimum height and length are 1 so very low Running this conkyrc will give that : So the text is normally displayed even if the minimum are low
Now lets delete our conky.text section and link the conkyrc with our lua script above : I've also changed the minimal to set them low but not too The result : The text is cut in his middle because of the minimum_height and minimum_width
So as expected if I increase the minimums the text will be fully displayed :
My suggestion is to skip the problem in my second example to make conky adapt by itself with lua script as it do with the first example
Can you paste the config and script too so anybody can try them too? Can't copy off the images.
1) You used lua_load
+ cairo (graphics)
to draw text graphic, I'm not sure if this is solvable. It might be that conky does not see graphics executed outside of conky.text = [[]]
so it can't determine minimal width/height.
2) Conky went through a major change to support lua
and was implemented by somebody else. lua_*
hooks was one of the results.
3) When it comes to lua
, I think nothing have been touched (excluding baking in tolua++
into conky
couple of releases ago).
4) I'm not qualified to answer your questions. Things I mentioned above is my guesswork.
5) I think the problem with this is graphics. If users want circles or partial circles to go out of the window, how should we deal with that and minimal_*
Keeping it as-is could be more ideal.
conky.config = {
lua_load = "~/.config/conky/conky.lua",
lua_draw_hook_post = "conky_main",
alignment = 'top_left',
border_width = 1,
cpu_avg_samples = 2,
default_color = 'white',
default_outline_color = 'white',
default_shade_color = 'white',
draw_outline = false,
draw_shades = false,
minimum_height = 100,
minimum_width = 100,
use_xft = true,
own_window = true,
no_buffers = true,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = false,
out_to_x = true,
extra_newline = false,
own_window_class = 'Conky',
own_window_type = 'desktop',
update_interval = 1.0,
uppercase = false,
use_spacer = 'none',
show_graph_scale = false,
show_graph_range = false,
background = false,
gap_x = 0,
gap_y = 0,
stippled_borders = 0,
};
conky.text = [[
]];
This is the conkyrc, be careful, you may modify the path to lua script
require 'cairo'
function header()
font='Mono'
font_size=20
name_text="ocisra"
name_x,name_y=10,20
r,g,b,a=1,1,1,1
font_slant=CAIRO_FONT_SLANT_BOLD
font_face=CAIRO_FONT_WEIGHT_NORMAL
cairo_select_font_face (cr, font, font_slant, font_face)
cairo_set_font_size (cr, font_size)
cairo_set_source_rgba (cr, r, g, b, a)
cairo_move_to (cr, name_x, name_y)
cairo_show_text (cr, name_text)
cairo_stroke (cr)
end
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create( conky_window.display,
conky_window.drawable,
conky_window.visual,
conky_window.width,
conky_window.height)
cr = cairo_create(cs)
header()
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end
And the lua script
the only thing you may modify are in the conkyrc, it is conky.text, minimum_height, minimumwidth, delete or add the lua*
EDIT : I don't know how to use the 'code bloc' feature. :-)
Ok If it is not possible it is a closed issue for me Thanks
Hi, To begin I'm not english so there might be a few mistakes.
When you set conky to be displayed in his own window with a minimum_height and a minimum_width the size of the window can be bigger than these minimum but the size of the part in which we can display thing is the one selected by those minimum.
The size of this "inner window" will increase as needed when text to display is set in conky.text = [ ] but when this text (or graph or anything else) is set in a lua script the size of the inner window won't increase.
As a beginner, I kept the default settings and both minimum_height and minimum_width are 5 so this is very low and we don't see anything. I spent a lot of time testing and asking to finally find but this time could be saved for the nexts.
Is there any way to increase the size of the inner window as the lua script needs or at least to write it in the lua tutorial ?
Thanks, Ocisra