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

[Bug]: append_file doesn't append to config #1971

Closed CaeriTech closed 2 months ago

CaeriTech commented 3 months ago

What happened?

Conky fails with the following errors when I use append_file for common settings:

conky: can't load font '6x10' conky: can't load font 'fixed'

However, if I add 'use_xft = true,' to the .lua config instead of the append_file it works as expected.

Is setting 'use_xft' supported in an append file?

Version

1.21.2-1

Which OS/distro are you seeing the problem on?

Arch Linux

Conky config

###
### append file
###
--
-- conf~common
--
-- out_to_x = yes,
-- out_to_wayland = yes,
use_xft = true,
font = "DejaVuSans :size=12:",
default_color = "E9E9E9",
default_shade_color = "202020",
default_outline_color = "232323",
xftalpha = 1,
draw_shades = false,
draw_borders = false,
own_window = true,
own_window_type = "override",
own_window_transparent = true,
own_window_argb_visual = true,
own_window_argb_value = 155,
own_window_hints = "undecorated,below,above,sticky,skip_taskbar,skip_pager",
double_buffer = true,
no_buffers = true,

###
### conky .lua file
###

conky.config = {
--
-- conf~journal.lua
--
append_file = "/home/caeri/conf~common",
text_buffer_size = 1024,
max_user_text = 1024,
alignment = "top_left",
gap_x = 10,
gap_y = 10,
max_text_width = 0,
minimum_width = 385,
maximum_width = 385,
net_avg_samples = 10,
update_interval = 5
}
conky.text = [[
\
#---------------------------------------------------------------------------------------------
${alignr}${font :size=9:style=bold:}${color}journal
${voffset -004}\
\
${font :style=bold:size=6:}${color}\
${exec journalctl --output=cat --lines=6}
]]

Stack trace

No response

Relevant log output

No response

Caellian commented 2 months ago

append_file appends to file output, it doesn't execute lua code in the config. Use normal Lua imports instead, I recently added support for relative imports so you can place conf~common.lua with a table containing common options next to your scripts then import it.
But it won't be added to conky.config automatically - you'll have to merge tables and assign the merged table to conky.config.

The issue is that documentation for append_file doesn't specify clearly enough that it will make conky append text to specified file, so I'm closing it in favor of #1800.