You are not logged in.
Pages: 1
Let this be a collection of tips, scripts and questions about using lua with conky.
For starters, mrpeachy once wrote a lua tutorial that is still featured on conky github wiki.
Bunsenlabs forum is often under the top search results for web searches regarding conky.
PS:
This thread is meant for a constructive discussion of the possibilities of conky & lua. Let's please keep it that way.
Last edited by ohnonot (2021-10-12 05:49:19)
Offline
lua & conky can also draw SVG images:
require 'cairo'
require 'rsvg'
function draw_svg_file(path,x,y,w,h)
-- draws on existing (most likely globally defined in conky_main) cairo xlib surface cr
local rh = rsvg_create_handle_from_file(path)
local rd = RsvgDimensionData:create()
rsvg_handle_get_dimensions(rh, rd)
iw, ih, em, ex = rd:get()
if w and h then
do_scale=1
else
do_scale=0
w=iw
h=ih
end
cairo_translate (cr, x, y)
if do_scale == 1 then
cairo_scale (cr, w/iw, h/ih)
end
rsvg_handle_render_cairo(rh, cr)
rsvg_destroy_handle(rh)
-- reset scaling
if do_scale == 1 then
cairo_scale (cr,iw/w,ih/h)
end
-- move back to origin
cairo_translate (cr,-x,-y)
end
x and y define the starting position, w and h are the width and height of the image, extending to the right and down from x,y.
In other words, this function also scales the image.
If w,h are omitted, the image is displayed in its original size.
Offline
Is it possible to change the way text and images are antialiased?
The manual for cairo-antialias-t suggests these options:
--CAIRO_ANTIALIAS_DEFAULT --- Use the default antialiasing for the subsystem and target device, since 1.0
CAIRO_ANTIALIAS_NONE --- Use a bilevel alpha mask, since 1.0
CAIRO_ANTIALIAS_GRAY --- Perform single-color antialiasing (using shades of gray for black text on a white background, for example), since 1.0
CAIRO_ANTIALIAS_SUBPIXEL --- Perform antialiasing by taking advantage of the order of subpixel elements on devices such as LCD panels, since 1.0
CAIRO_ANTIALIAS_FAST --- Hint that the backend should perform some antialiasing but prefer speed over quality, since 1.12
CAIRO_ANTIALIAS_GOOD --- The backend should balance quality against performance, since 1.12
CAIRO_ANTIALIAS_BEST --- Hint that the backend should render at the highest quality, sacrificing speed if necessary, since 1.12
They can be set with these two functions afaics:
cairo_set_antialias(cr, CAIRO_ANTIALIAS_....)
cairo_font_options_set_antialias(cr, CAIRO_ANTIALIAS_....)
I tried pretty much all combinations, but never saw any effect.
Does anybody have any experience with this?
Offline
I tried pretty much all combinations, but never saw any effect.
Does anybody have any experience with this?
Which conky version?
Just a guess, maybe try with version 1.9
Offline
I felt the pain of mrPeachy's passing. I am glad his legacy lives on.
I will over time post may of his scripts here.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Pages: 1