You are not logged in.

#1 2010-03-02 01:24:36

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

[SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

*final edit + solution*
The example in the link is flawed and due to my inexperience with Lua I tried debugging it the wrong way and thus failed to realize that other scripts would work. The crux lay in my failure to grasp that the Cairo bindings are built into conky and that I could not use "require 'cairo'" within the Lua interpreter as though it were an installed module. I eventually got the airclock from this page to work.

*edit*
I had misunderstood the problem before and have cleaned up the post to make it clearer.

*edit 2*
I've tried using conky-git in case this was an error in conky, but it still fails (which doesn't rule out a conky error, but it makes it less likely).

I wanted to play around with Lua and Conky so I installed conky-lua from the AUR. The simple non-cairo examples work but when I try to import cairo with

require 'cairo'

while following this example, I get the following output in the terminal and (obviously) no cairo graphics:

Conky: llua_load: ./cairo.lua:3: loop or previous error loading module 'cairo'
Conky: desktop window (121) is root window
Conky: drawing to desktop window
Conky: drawing to single buffer
Conky: llua_do_call: function conky_cairo_test execution failed: attempt to call a nil value

I can import 'cairo' in the Lua interpreter by running the following lines, so it seems that the installation was successful:

package.cpath = package.cpath .. ';/usr/lib/conky/lib?.so'
require 'cairo'

The output of "conky -v" confirms this:

  Lua bindings:
   * Cairo
   * Imlib2

So what am I missing? My experience with Lua is limited to the 20 minutes that I spent reading through the "tutorial directory".

Last edited by Xyne (2010-03-03 04:00:00)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#2 2010-03-03 00:09:24

renato_garcia
Member
From: Brazil
Registered: 2009-08-14
Posts: 24

Re: [SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

The name of module is oocairo, then you must require it with:

require "oocairo"

:-)

Offline

#3 2010-03-03 00:22:16

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

Thanks renato_garcia, but that doesn't solve the problem. All of the tutorials use "cairo" and it seems that lua-oocairo is not the package that I need. Changing that line to "oocairo" does not let the script run.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2010-03-03 00:38:31

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: [SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

There apparently are two different lua-cairo bindings on luaforge.net, maybe you could try the other one?

Offline

#5 2010-03-03 01:16:50

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

That's probably it, thanks. I was assuming that there would already be a package for it because I think I've seen conky+lua+cairo used somewhere around here before.

I'll bump the thread once I get around to packaging that.

Last edited by Xyne (2010-03-03 01:40:09)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#6 2010-03-03 02:09:36

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

The second project does provide "cairo" but it doesn't work. The project also appears to be old and dead so I doubt that's what you're supposed to use.

Conky website wrote:

Built in Lua bindings for Cairo and Imlib2, which allows you to draw directly to Conky's window using Cairo and/or Imlib2.

I take that to mean that conky-lua should provide the necessary bindings. Maybe it's a configuration options. I'll keep looking but I'm still hoping that someone has already got this working.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#7 2011-08-19 16:35:21

eXpander
Member
Registered: 2011-08-01
Posts: 4

Re: [SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

I bump this thread.

I have EXACTLY the same problem. Did you solve this issue?

Offline

#8 2011-08-19 17:00:18

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Conky+Lua+Cairo = error loading module 'cairo'

eXpander,

  1. Read the title of this thread. Then read the posts starting with the first one.

  2. Read Forum Etiquette: Necro-Bumping.

Closing.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB