-
Notifications
You must be signed in to change notification settings - Fork 0
/
.conkyrc
145 lines (136 loc) · 6.11 KB
/
.conkyrc
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
-- --------------------------------------------
-- Copiright Dmytro Pustovit --
-- Components: Time, Date, DayofWeak, --
-- CPU,PAM,Disk,Swap,Top Processes, Network --
-- --------------------------------------------
-- json = require "libs/json"
-- io.write('script')
-- io.write(json.decode('[1,2,3,{"x":10}]')[1])
-- -- set_paths.lua
-- local version = _VERSION:match("%d+%.%d+")
-- package.path = 'lua_modules/share/lua/' .. version .. '/?.lua;lua_modules/share/lua/' .. version .. '/?/init.lua;' .. package.path
-- package.cpath = 'lua_modules/lib/lua/' .. version .. '/?.so;' .. package.cpath
--
-- print(package.path)
-- socket = require "socket"
netw = 'wlx18a6f71a84cf'
variables = {
netw = 'wlp2s0',
topBig = 120,
topSml = 50,
topInv = 5
}
local function insertVariables(s)
return s:gsub('(#%b{})', function (w)
return variables[w:sub(3, -2)] or w
end)
end
local function insertAdd(s)
return s:gsub('(%d+)+(%d+)', function(a,b)
return a+b
end)
end
local function insertMinus(s)
return s:gsub('(%d+)-(%d+)', function(a,b)
return a-b
end)
end
local function insertMult(s)
return s:gsub('(%d+)*(%d+)', function(a,b)
return a*b
end)
end
local function arifmetic(s)
return insertMinus(insertAdd(insertMult(s)))
end
conky.config = {
-- system
background = false,
alignment = "top_right",
double_buffer = true,
update_interval = 5,
-- position
gap_x = 2,
gap_y = 0,
maximum_width = 500,
-- own_window properties
own_window = true,
own_window_type = "dock",
own_window_hints = 'undecorated,below,sticky,skip_taskbar',
own_window_colour = "000000",
own_window_argb_visual = true,
own_window_argb_value = 50,
-- components
draw_shades = true,
draw_graph_borders = false,
cpu_avg_samples = 10,
net_avg_samples = 10,
-- xft
use_xft = true,
font = "Magnolia Script:size=10",
xftalpha = 0.1,
-- colors
default_color = "white",
default_shade_color = "black",
color0 = "#00FF00",
color1 = "#FFA300"
};
text =[[
${voffset 10}${offset 10}${color EAEAEA}${font Janda Cheerful Script:pixelsize=120}${time %H:%M}
${voffset -225}${alignr 10}${font Hitch Hike:pixelsize=60}${time %d}${font Hitch Hike:pixelsize=45}${time %B} ${time %Y}
${voffset -5}${alignr 20}${color1}${font Lemon Tuesday:pixelsize=60}${time %A}${font}
]] ..
-- --------------------------------------------------------------------------------
-- CPU usage --
-- --------------------------------------------------------------------------------
[[
${color1}${voffset 200}${hr 1}
${color0}Температура: $color ${acpitemp}°C
${color0}CPU usage:$color ${cpu cpu0}%
${color0}Процесів:$color $processes
${color0}Запущено: $color $running_processes
${color0}Частота:$color ${freq}MHz
${color0}Середнє навантаження:$color ${loadavg}
${offset 170}${voffset -120}${cpugraph cpu0 60,310 FFFFFF 544C4C -l}
$color${goto 320}${cpu cpu1}% ${goto 400}${cpu cpu2}%
${color0}${goto 320}CPU1${goto 400}CPU2
]] ..
-- -------------------------------------------------------------------------------
-- DISK/RAM/SWAP usage --
-- -------------------------------------------------------------------------------
[[
${color1}${voffset 0}${hr 1}
${color0}RAM $color${memperc}%
${color0}DISK $color${fs_used_perc /}%
${color0}Swap $color${swapperc}%
${offset 150}${voffset -65}${memgraph 50,310 FBFD0F F40202 -l}
]] ..
-- --------------------------------------------------------------------------------
-- Running processes --
-- --------------------------------------------------------------------------------
[[
${color1}${voffset -5}${hr 1}
${color0}${voffset 2}NAME${goto #{topBig}}CPU%${goto #{topBig}+#{topSml}}PID${goto #{topBig}+2*#{topSml}}NAME${goto 2*#{topBig}+2*#{topSml}}RAM${goto 2*#{topBig}+3*#{topSml}+3*#{topInv}}PID${voffset 5}
$color${top name 1}${goto #{topBig}}${top cpu 1}${goto #{topBig}+#{topSml}}${top pid 1}${color1}${goto #{topBig}+2*#{topSml}}${top_mem name 1}${goto 2*#{topBig}+2*#{topSml}}${top_mem mem_res 1}${goto 2*#{topBig}+3*#{topSml}+3*#{topInv}}${top_mem pid 1}
$color${top name 2}${goto #{topBig}}${top cpu 2}${goto #{topBig}+#{topSml}}${top pid 2}${color1}${goto #{topBig}+2*#{topSml}}${top_mem name 2}${goto 2*#{topBig}+2*#{topSml}}${top_mem mem_res 2}${goto 2*#{topBig}+3*#{topSml}+3*#{topInv}}${top_mem pid 2}
$color${top name 3}${goto #{topBig}}${top cpu 3}${goto #{topBig}+#{topSml}}${top pid 3}${color1}${goto #{topBig}+2*#{topSml}}${top_mem name 3}${goto 2*#{topBig}+2*#{topSml}}${top_mem mem_res 3}${goto 2*#{topBig}+3*#{topSml}+3*#{topInv}}${top_mem pid 3}
$color${top name 4}${goto #{topBig}}${top cpu 4}${goto #{topBig}+#{topSml}}${top pid 4}${color1}${goto #{topBig}+2*#{topSml}}${top_mem name 4}${goto 2*#{topBig}+2*#{topSml}}${top_mem mem_res 4}${goto 2*#{topBig}+3*#{topSml}+3*#{topInv}}${top_mem pid 4}
]] ..
-- -------------------------------------------------------------------------------
-- Network --
-- -------------------------------------------------------------------------------
[[
${color1}${voffset -5}${hr 1}$color
${color0}IP Адреса: $color${addrs #{netw}}
${color0}Зовнішня IP: $color${execpi 3600 wget -q -O /dev/stdout http://checkip.dyndns.org/ | cut -d : -f 2- | cut -d \< -f -1}
${color0}MAC адреса: $color ${wireless_ap #{netw}}
${color0}Якість зв''язку: $color${wireless_link_qual_perc #{netw}}%
${color0}Бітрейт: $color${wireless_bitrate #{netw}}
${color0}Завантаження: $color${downspeed #{netw}}
${color0}Відвантаження: $color${upspeed #{netw}}
${color0}Загалом Завантажено:$color${totaldown #{netw}}
${color0}Загалом Відвантажено:$color${totalup #{netw}}
${offset 250}${voffset -150}${upspeedgraph #{netw} 40,200 4B1B0C FF5C2B -l}
${offset 250}${downspeedgraph #{netw} 40,200 324D23 77B753 -l}
]]
conky.text = arifmetic(arifmetic(insertVariables(text)))