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

conky: [string "..."]:139: attempt to index local 'settings' (a nil value) #843

Closed Trekerj closed 5 years ago

Trekerj commented 5 years ago

Issue I'm trying to add a lua script to my conky. when I add the last two lines to my existing conky.conifg I get the following in the terminal: "conky: Syntax error (/home/jack/bin/.conkyrc_ctr:38: '}' expected (to close '{' at line 2) near 'lua_draw_hook_post') while reading config file. conky: Assuming it's in old syntax and attempting conversion. conky: [string "..."]:139: attempt to index local 'settings' (a nil value)"

With out the call for the lua script the conky runs fine.

Information I very new to linux so my system is a new install of Ubuntu 18.04.2 LTS conky version is 1.10.8, this is the only version I've installed, so I don't believe i need to convert it to the new syntax (but what do i know). Appreciate any help, thanks. conky: conky.config = { update_interval = 1, cpu_avg_samples = 2, net_avg_samples = 2, out_to_console = false,

override_utf8_locale = true,
double_buffer = true,
no_buffers = true,
text_buffer_size = 32768,
imlib_cache_size = 0,
own_window = true,
own_window_type = 'normal',
own_window_argb_visual = true,
own_window_argb_value =0,
own_window_hints =      'undecorated,below,sticky,skip_taskbar,skip_pager',
border_inner_margin = 5,
border_outer_margin = 10,
-- xinerama_head = 1,
alignment = 'tm',
gap_x = 0,
gap_y = 33,
draw_shades = false,
draw_outline = true,
draw_borders = false,
draw_graph_borders = true,
use_xft = true,
font = 'Ubuntu Mono:size=12',
-- xftalpha = 0.8,
uppercase = false,
default_color = 'yellow',
own_window_colour = '#000000',
minimum_width = 300, minimum_height = 0,
alignment = 'tm',
lua_load = "~/bin/luascript1.lua"
lua_draw_hook_post = "main" 
};

conky.text = [[ ${time %H:%M:%S}${alignr}${time %-d-%-m-%-y}${color green} ]]

The lua script is ;luascript1.lua test is attached: luascript1.txt

lasers commented 5 years ago

You may be missing commas. See if that's the case.

diff --git a/conky.conf b/conky2.conf
index 37e2d3f..ca02c74 100644
--- a/conky.conf
+++ b/conky2.conf
@@ -31,8 +31,8 @@ conky.config = {
   own_window_colour = '#000000',
   minimum_width = 300, minimum_height = 0,
   alignment = 'tm',
-  lua_load = "~/bin/luascript1.txt"
-  lua_draw_hook_post = "main"
+  lua_load = "~/bin/luascript1.txt",
+  lua_draw_hook_post = "main",
 };

 conky.text = [[
Trekerj commented 5 years ago

Dahhh! Works great. Thanks