conky-config/conky.conf

109 lines
2.4 KiB
Plaintext
Raw Normal View History

--------------------------------------------------------------------------------
-- set up paths
2022-07-19 18:11:46 -04:00
local conky_dir = debug.getinfo(1).source:match("@?(.*/)")
local subdirs = {
'?.lua',
'drawing/?.lua',
'schema/?.lua',
'core/?.lua',
'core/widget/?.lua',
'core/widget/arc/?.lua',
'core/widget/text/?.lua',
'core/widget/timeseries/?.lua',
'core/widget/rect/?.lua',
'core/widget/line/?.lua',
'lib/share/lua/5.4/?.lua',
'lib/share/lua/5.4/?/init.lua',
}
for i = 1, #subdirs do
subdirs[i] = conky_dir..subdirs[i]
end
package.path = table.concat(subdirs, ';')
package.cpath = conky_dir..'lib/lib/lua/5.4/?.so;'
--------------------------------------------------------------------------------
-- select global config to use (fallback to default if none found)
local yaml = require 'lyaml'
local i_o = require 'i_o'
local schema_path = conky_dir..'/config/schema.yml'
local try_config_paths = {
'/home/ndwar/.config/conky.yml',
conky_dir..'config/fallback.yml'
}
local config_path
local config
for i = 1, #try_config_paths do
config_path = try_config_paths[i]
local r = i_o.read_file(config_path)
if r ~= nil then
config = yaml.load(r)
break
end
end
i_o.printf('Using config at %s', config_path)
if i_o.exit_code_cmd('command -v yajsv > /dev/null') == 0 then
local cmd = string.format('yajsv -q -s %s %s', schema_path, config_path)
assert(i_o.exit_code_cmd(cmd) == 0, 'ERROR: config failed validation')
else
print(string.format('WARNING: could not validate config'))
end
local bootstrap = config.bootstrap
local startup_hook = string.format(
'start %f %s %s %s',
bootstrap.update_interval,
config_path,
package.path,
package.cpath
)
2022-07-19 18:11:46 -04:00
2016-08-11 23:25:56 -04:00
conky.config = {
2017-07-16 23:49:27 -04:00
background = false,
2016-08-11 23:25:56 -04:00
-- adjust cpu dial sensitivity (1-14)
2016-08-11 23:25:56 -04:00
cpu_avg_samples = 4,
net_avg_samples = 1,
2016-08-11 23:25:56 -04:00
out_to_console = false,
own_window = true,
2020-03-15 12:05:08 -04:00
own_window_type = 'override',
2016-08-11 23:25:56 -04:00
own_window_transparent = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
xinerama_head = 0,
2016-08-11 23:25:56 -04:00
double_buffer = true,
minimum_width = bootstrap.dimensions[1],
minimum_height = bootstrap.dimensions[2],
2016-08-11 23:25:56 -04:00
draw_shades = false,
draw_outline = false,
draw_borders = false,
gap_x = 0,
gap_y = 0,
alignment = 'top_left',
no_buffers = true,
-- Lua Load
2022-07-19 18:11:46 -04:00
lua_load = conky_dir..'main.lua',
lua_draw_hook_post = 'main',
lua_startup_hook = startup_hook
2016-08-11 23:25:56 -04:00
}
--control updates entirely in lua
conky.text = [[]]