-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem-info.conf
73 lines (63 loc) · 1.94 KB
/
system-info.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
-- Conky configuration for system information
--
-- 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 = 50
MINIMUM_WIDTH = 300
MAXIMUM_WIDTH = 300
FONT = 'Hack:size=8'
elseif HOSTNAME == "galileo" and RESOLUTION == "2256x1504" then
GAP_X = 25
GAP_Y = 50
MINIMUM_WIDTH = 425
MAXIMUM_WIDTH = 425
FONT = 'Hack:size=12'
elseif HOSTNAME == "galileo" and RESOLUTION == "1920x1280_60.00" then
GAP_X = 25
GAP_Y = 50
MINIMUM_WIDTH = 400
MAXIMUM_WIDTH = 400
FONT = 'Hack:size=10'
elseif HOSTNAME == "mg3" then
GAP_X = 25
GAP_Y = 50
MINIMUM_WIDTH = 300
MAXIMUM_WIDTH = 300
FONT = 'Hack:size=8'
end
-- Apply system specific customizations to a customization table
local custom = {
alignment = 'top_right',
gap_x = GAP_X,
gap_y = GAP_Y,
font = FONT,
minimum_width = MINIMUM_WIDTH,
maximum_width = MAXIMUM_WIDTH,
update_interval = 2,
}
-- 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
conky.text = [[
${execp ruby ~/git/conky/scripts/system.rb ]] .. HOSTNAME .. [[}
]]