This commit is contained in:
ray 2019-05-29 12:34:27 +01:00
parent 36801724ba
commit c2bcce0269
3 changed files with 55 additions and 30 deletions

View File

@ -25,7 +25,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
]] ]]
conky.config = { conky.config = {
alignment = 'bottom_left', lua_load = '~/.config/conky/functions.lua',
alignment = 'bottom_right',
background = false, background = false,
border_width = 1, border_width = 1,
cpu_avg_samples = 2, cpu_avg_samples = 2,
@ -64,42 +65,46 @@ conky.config = {
} }
conky.text = [[ conky.text = [[
${color}\ ${color 3a2a59}\
::: \ --\
${top pid 1}\ ${lua_parse sub_space 0 ${top pid 1}}\
:\ :\
${color 553D82}\ ${color 553D82}\
${top name 1}\ ${lua_parse sub_space . ${top name 1}}.\
${color 3a2a59}\ ${color 3a2a59}\
${top mem 1}${top cpu 1} \ ${lua_parse sub_space 0 ${top mem 1}}:\
-- ${lua_parse sub_space 0 ${top cpu 1}}\
${color}\ :::
::: \ ${color 32244D}\
${top pid 2}\ --\
${lua_parse sub_space 0 ${top pid 2}}\
:\ :\
${color 433066}\ ${color 433066}\
${top name 2}\ ${lua_parse sub_space . ${top name 2}}.\
${color 32244D}\ ${color 32244D}\
${top mem 2}${top cpu 1} \ ${lua_parse sub_space 0 ${top mem 2}}:\
${lua_parse sub_space 0 ${top cpu 2}}\
-- --
${color}\ ${color 2B1F42}\
::: \ --\
${top pid 3}\ ${lua_parse sub_space 0 ${top pid 3}}\
:\ :\
${color 32244D}\ ${color 32244D}\
${top name 3}\ ${lua_parse sub_space . ${top name 3}}.\
${color 2B1F42}\ ${color 2B1F42}\
${top mem 3}${top cpu 1} \ ${lua_parse sub_space 0 ${top mem 3}}:\
-- ${lua_parse sub_space 0 ${top cpu 3}}\
${color}\ :::
::: \
${top pid 4}\
:\
${color 2B1F42}\
${top name 4}\
${color 251a38}\ ${color 251a38}\
${top mem 4}${top cpu 4} \ --\
-- ${lua_parse sub_space 0 ${top pid 4}}\
:\
${color 2B1F42}\
${lua_parse sub_space . ${top name 4}}.\
${color 251a38}\
${lua_parse sub_space 0 ${top mem 4}}:\
${lua_parse sub_space 0 ${top cpu 4}}\
:::
]] ]]
-- vim: set filetype=lua: -- vim: set filetype=lua:

View File

@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
]] ]]
conky.config = { conky.config = {
lua_load = '~/.config/conky/functions.lua',
alignment = 'top_left', alignment = 'top_left',
background = false, background = false,
border_width = 1, border_width = 1,
@ -40,7 +41,7 @@ conky.config = {
font = 'xos4 Terminus:size=12', font = 'xos4 Terminus:size=12',
gap_x = 6, gap_x = 6,
gap_y = 117, gap_y = 117,
minimum_height = 5, minimum_height = 5,0,
minimum_width = 5, minimum_width = 5,
net_avg_samples = 2, net_avg_samples = 2,
double_buffer = true, double_buffer = true,
@ -65,10 +66,13 @@ conky.config = {
conky.text = [[ conky.text = [[
-----::\ -----::\
${lua_parse pad - 3 ${processes}}\
$processes\ $processes\
:\ :\
${lua_parse pad - 3 ${running_processes}}\
$running_processes\ $running_processes\
:\ :\
${lua_parse pad - 3 ${cpu}}\
${color A82283}\ ${color A82283}\
$cpu\ $cpu\
$color\ $color\
@ -107,14 +111,16 @@ ${fs_free /mnt/4tb_2}\
$color\ $color\
::\ ::\
\ \
${lua_parse pad - 6 ${upspeed enp3s0}}\
${color 701461}\ ${color 701461}\
${upspeed}\ ${upspeed enp3s0}\
$color\ $color\
-\ -\
${color A82283}\ ${color A82283}\
${downspeed}\ ${downspeed enp3s0}\
$color\ $color\
--\ ${lua_parse pad - 6 ${downspeed enp3s0}}\
-\
${color 701461}\ ${color 701461}\
$nodename\ $nodename\
$color\ $color\
@ -141,6 +147,12 @@ $color\
${color 701461}\ ${color 701461}\
$uptime_short\ $uptime_short\
$color\ $color\
::\
${color 701461}\
${hwmon temp 1}\
$color\
:\
${hwmon fan 1}\
:::--- :::---
]] ]]

8
functions.lua Normal file
View File

@ -0,0 +1,8 @@
function conky_pad(char, length, text )
return string.rep(char, length - string.len(conky_parse(text)))
end
function conky_sub_space(replacement, str)
return string.gsub(conky_parse(str), ' ', replacement)
end