
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
--[[
Conky, a system monitor, based on torsmo

Any original torsmo code is licensed under the BSD license

All code written since the fork of torsmo is licensed under the GPL

Please see COPYING for details

Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2012 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

]]


-------------------------------------
--  配置 conky 参数
-------------------------------------

conky.config = {

-------------------------------------
--  基本设置
-------------------------------------
--是否后台运行
background=true,
--是否输出结果到终端
out_to_console=yes,
--更新间隔
update_interval=1,
--使用双缓冲
double_buffer=true,
--是否在已用内存中减去文件系统缓冲区
no_buffers=true,
--Imlib2图像缓存大小
imlib_cache_size=100,
border_width = 1,
cpu_avg_samples = 2,

--是否显示阴影
draw_shades=false,
--是否显示轮廓
draw_outline=false,
--是否显示文本边框
draw_borders=false,
--是否在图片周围绘制边框
draw_graph_borders=false,
--指定图形的默认高度
--default_graph_height=150,
--指定图形的默认宽度
--default_graph_width=280,
--显示缩放图形中的最大值
--show_graph_scale=false,
--显示图表所涵盖的时间范围
--show_graph_range=false,


-------------------------------------
--  窗户规格
-------------------------------------
--屏幕右边界或左边界之间的间距
gap_x=25,
--屏幕顶部或底部边框之间的间隙
gap_y=10,
--文本区域的最高度
minimum_height=300,
--文本区域的最宽度
minimum_width=300,
--创建自有窗口
own_window=true,
--窗口类型
own_window_type="normal",
--背景透明
own_window_transparent=true,
--窗口显示的方式
own_window_hints="undecorated,below,sticky,skip_taskbar,skip_pager",
--内边框边距
border_inner_margin=0,
--外边框边距
border_outer_margin=0,
--文本对齐方式
alignment="top_right",
--是否使用ARGB值
own_window_argb_visual=true,
--Alpha值
own_window_argb_value=0,


-------------------------------------
--  文本设置
-------------------------------------
--是否使用xft字体
use_xft=true,
--字体透明度，必须是1到0之间的值。 
xftalpha=1,
--雅黑10像素字体
font="Noto Sans CJK SC :size=8",
--标准文本缓冲区的大小（默认为256字节）。
text_buffer_size=256,
--是否强制强制UTF8
override_utf8_locale=true,
--将单位缩短为单个字符
short_units=true,
--百分比精确度2位
pad_percents=2,
--top name值的宽度
top_name_width=7,

-------------------------------------
--  加载 lua
-------------------------------------
--lua_load = '~/.conky/clock_rings.lua',
--lua_draw_hook_pre='clock_rings',
-------------------------------------
--  定义颜色
-------------------------------------
--默认颜色和边框颜色
 default_outline_color = 'white',
    default_shade_color = 'white',
default_color='white',
color1="FF6600",
color2="555555",
color3="555555",
color4="777777",
color5="F15D22",
color6="F15D22",
color7="F15D22",
color8="FFFFFF",
-------------------------------------
--  OpenWeatherMap API 密码，这里照抄了一个
-------------------------------------
template6="785c55952ba8b7c41777975b42697401",


-------------------------------------
--  OpenWeatherMap 城市代码，这里默认为洛阳
-------------------------------------
template7="1801792",


-------------------------------------
--  温度单位 (default, metric, imperial)
-------------------------------------
template8="metric",


-------------------------------------
--  本地化 (例如 "es_ES.UTF-8")
--  留空使用默认环境
-------------------------------------
template9="zh_CN.UTF-8"

}


-------------------------------------
--  配置 conky 文本
--  首先使用get_weather获取天气数据并保存在json文件中，将图片添加到相应位置，
--  使用voffset将图片定位，然后使用parse_weather脚本分析json文件获取天气数据
--  根据天气数据使用相应的图片显示天气，然后使用内置指令获取cup、内存、运行
--  时间、进程等信息，最后使用if_existing枚举网卡，显示网速，如果网络断开将
--  显示网络断开提示。你需要手动修改监控的网卡类型才能有效。如果你改变了字体，
--  你需要对图片和文字的定位进行调整。
-------------------------------------






conky.text = [[

#######你的标题####################
${color #FCE94F}${font PizzaDude Bullets:size=12}S${font :size=10}   本机状态 $hr $font $color
${color1}${hr}
${color8}${voffset }${alignr 180}${font caviar dreams:size=60}${time %H:%M} ${font} 
${voffset -35}${alignr 70}${color1}${font caviar dreams:size=30}${time %d}${font}
${color FFFFFF}${voffset -25}${alignr}${font caviar dreams:size=10}${time %b %Y}${font}
${voffset 5}${alignr 5}${color1}${font 文泉驿微米黑:size=20}${time %A}${font}${color1}
#${voffset -10}${color1}${hr}
#------系统信息----------------------------------------------------------------------------------------------------

${color #FCE94F}${font OpenLogos:size=12}L${font :size=10}   系统信息 $hr $font
${color #33D0F7}${font :size=10}系统内核: ${alignr} $kernel ($machine)
${color #33D0F7}电脑名称: $alignr$nodename
${color #33D0F7}运行时间: $alignr$uptime
${font caviar dreams:size=8} 进程数:  ${alignr}${processes}
${font caviar dreams:size=8} 正运行进程数: ${alignr} ${running_processes}
#------cpu信息----------------------------------------------------------------------------------------------------
${color #FCE94F}${font StyleBats:size=12}W${font :size=10}   CPU $hr $font $color
${color #33D0F7}${font :size=10}CPU使用率 ${freq}MHz: ${cpu cpu1}% ${alignr}${cpubar cpu1 8,60}
${color #33D0F7}核心 ${exec /opt/i8520-SH/SHconky/ConkyrcCPU}
${color #73D216}活跃进程 $alignr PID $alignr $alignc CPU% $alignr MEM%
${color #33D0F7}${top name 1} $alignr ${top pid 1} $alignr ${top cpu 1} $alignr ${top mem 1}
${color #33D0F7}${top name 2} $alignr ${top pid 2} $alignr ${top cpu 2} $alignr ${top mem 2}
${color #33D0F7}${top name 3} $alignr ${top pid 3} $alignr ${top cpu 3} $alignr ${top mem 3}
#------内存信息----------------------------------------------------------------------------------------------------
${color #FCE94F}${font StyleBats:size=12}A${font :size=10}   内存信息 $hr $font $color
${color #73D216}${font :size=10}系统内存: $mem/$memmax $alignr $memperc%
${color #DDC3BB}${membar}
${color #73D216}${font :size=10}虚拟内存: $swap/$swapmax $alignr $swapperc%
${color #DDC3BB}${swapbar}
${color #73D216}消耗最多 $alignr PID $alignr CPU% $alignr MEM%
${color #33D0F7}${top_mem name 1}$alignr${top_mem pid 1}$alignr${top_mem cpu 1}$alignr${top_mem mem 1}
${color #33D0F7}${top_mem name 2}$alignr${top_mem pid 2}$alignr${top_mem cpu 2}$alignr${top_mem mem 2}
${color #33D0F7}${top_mem name 3}$alignr${top_mem pid 3}$alignr${top_mem cpu 3}$alignr${top_mem mem 3}
${color #33D0F7}${top_mem name 4}$alignr${top_mem pid 4}$alignr${top_mem cpu 4}$alignr${top_mem mem 4}
#------用户目录----------------------------------------------------------------------------------------------------
${color #FCE94F}${font PizzaDude Bullets:size=12}N${font :size=10}   ${USER}用户 $hr $font $color
${color #73D216}${font :size=10}家目录: ${fs_used /home}/${fs_size /home} $alignr ${color #73D216}${fs_free_perc /home}%
${color #DDC3BB}${fs_bar /home}
${color #73D216}${font :size=10}WLLPXE: ${fs_used /wllpxe}/${fs_size /wllpxe} $alignr ${color #73D216}${fs_free_perc /wllpxe}%
${color #DDC3BB}${fs_bar /wllpxe}
${color #73D216}${font :size=10}DOCKER: ${fs_used /var/lib/docker}/${fs_size /var/lib/docker} $alignr ${color #73D216}${fs_free_perc /var/lib/docker}%
${color #DDC3BB}${fs_bar /var/lib/docker}
#------网络----------------------------------------------------------------------------------------------------
${color #FCE94F}${font PizzaDude Bullets:size=12}G${font :size=10}   网络 $hr $font $color
${color #73D216}${font :size=10}本机 IP: $alignr${addr enp7s0}
${color #33D0F7} 下行 ${downspeed enp7s0}/s ${alignr}上行 ${upspeed enp7s0}/s
${downspeedgraph enp7s0 25,110} ${alignr}${upspeedgraph enp7s0 25,110}
${color #FCE94F}总计 ${totaldown enp7s0} ${alignr}总计 ${totalup enp7s0}
#enp7s0 是网卡名 根据你的具体情况填写
#无线网卡 可能是 enp7s0 或者 wlx00120ee661a7
#------天气----------------------------------------------------------------------------------------------------
${color #FCE94F}${font PizzaDude Bullets:size=12}D${font :size=10}   墨迹天气 $hr $font $color
${color #33D0F7}${font :size=20}$alignr${exec $HOME/.config/autostart/Position2}
${color #33D0F7}${font :size=20}${image /tmp/URL_LINK/IMG/x.png -p 0,84 -s 20x20 -n}${exec $HOME/.config/autostart/Position1}
#${image /tmp/URL_LINK/2.png -s 15x15}

]]