4

What options do I have as far as creating a plugin management system for something such as Conky. What I am interested in is creating a system for Conky that would allow me to create new functions and add them through a shared library. This I feel would make it easier to create new configurations and variables for Conky without the need to recompile from source and allow these new functions to be shared independent of Conky. What are some general starting points for creating a system such as this? Are shared libraries the best option or are there better one.

I realize Conky already has an ability similar to this with the ability to call a system shell and return whatever is required, however many of the functions I would like to add would bog down Conky unless directly written in.

4

2 回答 2

0

看看 dlopen()。

这是一些不错的教程:http ://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html

我做了一些类似于我用 C 从头开始​​编写的 IRC 机器人。我使用 dlopen() 来做这样的事情。该机器人可以编译它自己的新模块并在运行时加载它们:)

于 2012-06-26T14:47:00.093 回答
0

考虑到 conky 的一些模块已经使用 GLib,您不妨看看 GLib 的模块系统 (GModule):http: //developer.gnome.org/glib/stable/glib-Dynamic-Loading-of-Modules。 html

基于此的另一个方便的库是 libpeas:http: //developer.gnome.org/libpeas/stable/

于 2012-07-23T15:32:57.197 回答