brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.17k stars 615 forks source link

Using lua_load to load common configuration statements fails #420

Closed koeppea closed 6 years ago

koeppea commented 6 years ago

I'm currently converting my old-style configuration to the LUA syntax configuration. I'm running multiple conky instances since I align it in different pages.

BTW: a kind of horizontal wrapping align mode would be a feature that could realize that just using 1 conky instance. here you can see how it looks like: 2017-09-23-081813_1024x600_scrot-1

However, since most parts of the 4 configuration files are common, I'd like to use the lua_load setting to swap out these configuration statements into a common config file.

So my .conky0rc.lua file looks like the following:

conky.config = {
    lua_load="~/.conkyrc-common.lua",
    -- applet specific settings
}

The .conkyrc-common.lua looks this way:

    background=false,
    update_interval=3,
    double_buffer=true,
    -- and many more

But when I start conky using conky -c ~/.conky0rc.lua I get the following output and the settings from .conkyrc-common.lua are ignored:

$ conky -c .conky0rc.lua
conky: llua_load: /home/koeppea/.conkyrc-common.lua:2: unexpected symbol near '='

Is it possible to use the lua_load setting to accomplish such a include of a common config file?

dbriba commented 6 years ago

Normally in your conky.config you should have a space between lua_load and = , and between = and "~/.conkyrc-common.lua",

dbriba commented 6 years ago

And also in your conkyrc-common.lua you must have space before and after the = like this : background = false, update_interval = 3, double_buffer = true, --and many more.

plikhari commented 6 years ago

@dbriba It is not mandatory to have spaces before n after = - lua works fine to parse without spaces.

@koeppea I am not certain if you can swap configurations in this way - have you seen any documentation on this ??? lua_load will load multiple lua scripts - but - the configuration is already read by conky and this is not swap able !!!

koeppea commented 6 years ago

@plikhari thanks for the explanantion. Then I give up this path.