You are not logged in.

#1 2020-01-18 20:51:48

bry2k200
New Member
Registered: 2020-01-18
Posts: 4

conky: Trouble with Lua

Afternoon all, I've been struggling with this script for I dunnow how long.  I can't get the lua script to display the minute, second and hour hands.  I'd also love to remove the acpitemp and the hard drive info but when I try I get a "nil value" error.  Which is my other beef, when I start conky using a terminal, it doesn't give me the line where the error is, it's just "nil value."  Anyhow, I've pasted the lua script here: https://pastebin.com/gGRiLxi3  This is a script I found that I've been trying to edit to suit my needs.  Thanks in advance for any assistance.

Offline

#2 2020-01-18 22:31:02

damo
....moderator....
Registered: 2015-08-20
Posts: 6,124

Re: conky: Trouble with Lua

-- Moved here because it is a help request, not a finished script wink --

Please post the LUA lines you are using in your conky. NB You could use [ code ] tags to post the code here, instead of using pastebin, since it isn't a huge script.

If you want a simple clock, with hands, then don't forget that BL provides one - ~/.config/conky/LUA/clock.lua. This is used by the BL-Time conkys. See how that is constructed, and edit yours to suit?

EDIT: have you combined 2 scripts? At first glance it may be that cairo_destroy is called before the hands are drawn.

Last edited by damo (2020-01-18 22:44:54)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#3 2020-01-18 23:05:01

damo
....moderator....
Registered: 2015-08-20
Posts: 6,124

Re: conky: Trouble with Lua

damo wrote:

...
EDIT: have you combined 2 scripts? At first glance it may be that cairo_destroy is called before the hands are drawn.

Yep wink

Add the call to the hands function to conky_ring_stats(), just before the '_destroy' lines:

...
...
	if update_num>5 then
	    for i in pairs(settings_table) do
                display_temp=temp_watch()
		setup_rings(cr,settings_table[i])
	    end
	end
    draw_clock_hands(cr,clock_x,clock_y)    <-- add this
    cairo_surface_destroy(cs)
    cairo_destroy(cr)
end

If you remove functions that you don't want, don't forget to do the same for the function calls in conky_main(). That is probably where you are getting "nil value" errors from.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#4 2020-01-19 01:47:59

bry2k200
New Member
Registered: 2020-01-18
Posts: 4

Re: conky: Trouble with Lua

Hi guys, sorry for being MIA, life called.  Worked beautifully, thanks a bunch!

Offline

Board footer

Powered by FluxBB