-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogs.conf
75 lines (64 loc) · 1.96 KB
/
logs.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
-- Conky configuration for journal logs
--
-- Michael Gilchrist ([email protected])
-- Obtain the path of this script, for relative sourcing of other scripts
local current_file_path = debug.getinfo(1, "S").source:sub(2)
local working_dir = current_file_path:match("(.*/)")
-- Source the shared functions module and confuration defaults
local MOD = dofile(working_dir .. 'scripts/config_helper.lua')
local CONF = dofile(working_dir .. 'scripts/config_defaults.lua')
-- Obtain settings from the configuration file
local HOSTNAME = MOD.get_hostname()
local RESOLUTION = MOD.get_resolution()
local CONFIG_DEFAULTS = CONF.defaults
-- For debugging - only available when run interactively
print("Path: ", current_file_path)
print("Dir: ", working_dir)
print("Hostname: ", HOSTNAME)
print("Resolution: ", RESOLUTION)
-- Get system specific customizations
if HOSTNAME == "davinci" then
GAP_X = 25
GAP_Y = 950
MINIMUM_WIDTH = 1000
MAXIMUM_WIDTH = 1000
FONT = 'Hack:size=8'
elseif HOSTNAME == "galileo" and RESOLUTION == "2256x1504" then
GAP_X = 25
GAP_Y = 1000
MINIMUM_WIDTH = 1725
MAXIMUM_WIDTH = 1725
FONT = 'Hack:size=12'
elseif HOSTNAME == "galileo" and RESOLUTION == "1920x1280_60.00" then
GAP_X = 25
GAP_Y = 50
MINIMUM_WIDTH = 300
MAXIMUM_WIDTH = 600
FONT = 'Hack:size=10'
elseif HOSTNAME == "mg3" then
GAP_X = 25
GAP_Y = 700
MINIMUM_WIDTH = 800
MAXIMUM_WIDTH = 1100
FONT = 'Hack:size=8'
end
-- Apply system specific customizations to a customization table
local custom = {
alignment = 'top_left',
gap_x = GAP_X,
gap_y = GAP_Y,
font = FONT,
minimum_width = MINIMUM_WIDTH,
maximum_width = MAXIMUM_WIDTH,
update_interval = 3,
}
-- Merge defaults with additional settings
local conky_config = MOD.merge_tables(CONFIG_DEFAULTS, custom)
-- For debugging
--MOD.print_merged_config_table(conky_config)
-- Apply the merged table to conky.config
conky.config = conky_config
local exe_path = working_dir .. 'scripts/logs.rb '
conky.text = [[
${execp ruby ]] .. exe_path .. [[}
]]