conky 的配置文件:样例、解释(****)

可能是最方便的解决方案:

mxlinux 默认自带了 conky 管理器,以及好多的 theme模板。

应该可以直接利用它们吧?

假如发行版之间,有自我保护的需要时,可能需要自行修改?

可以通过 conky manger 管理器,进行切换。

效果图:

------------

官网 ?:配置参数  https://conky.cc/config_settings

注意:1.10 ?1.90 ?从某个不同的版本号开始,配置参数的格式,变了;但官方提供了一个新旧 conf 文件的转换工具。

Linux 《conky配置说明书》https://www.cnblogs.com/MineLSG/p/10413608.html
 

brndnmtthws / conky  https://github.com/brndnmtthws/conky/

官方配置模板文件的获取:

./conky-*.AppImage -C > ~/.conkyrc # create a default config

除非特别指定,否则,官方默认配置文件的路径、文件名称,是: ~/.conkyrc

AppImage

To try the AppImage, head to https://github.com/brndnmtthws/conky/releases/latest and fetch the latest AppImage. You'll need to set the executable bit, then you can create a conkyrc, and run it as follows:

chmod +x ./conky-*.AppImage        # make it executable
./conky-*.AppImage -C > ~/.conkyrc # create a default config
./conky-*.AppImage                 # run

And that's it! Check out the Wiki for more details on configuring Conky.

NOTE: To use the AppImage, you may need to install additional runtime libraries.

------

update_interval=seconds

Update interval.

conky 配置文件详解  链接

5、update_interval 1:刷新时间。Conky需要每隔一段时间读取一次要监视的系统状态并把结果输出到屏幕上,设定的时间间隔越短,监控的实时性越好,但系统负担也越重;间隔时间越长则系统负担越轻,但是监控的实时性越差。我这里设定为1秒。

设置窗口的背景色

    own_window_colour = '#6C6C6C',

------

  https://www.gnome-look.org/p/2073359


For GNOME users, if there is a problem with the background image (PNG) that looks faded or transparent, please change it in this config

draw_blended = false,
own_window_argb_visual = false,
own_window_transparent = true,

Try experimenting with replacing it with true or false, if suddenly Conky doesn't appear don't panic, just undo and restart Conky

  https://cn.linux-console.net/?p=10192#google_vignette

将以下行添加到主配置部分顶部的 Conky 配置文件中,然后单击“保存”以查看更改的外观:

own_window_argb_visual = true,
own_window_argb_value = 50,
double_buffer = true,

透明背景场合,需要考虑字体的边款、轮廓

# 是否绘制字体阴影
draw_shades no
# 是否绘制字体边框线
draw_outline no
# 是否绘制边框
draw_borders no

# 默认颜色
##############################
# 默认颜色
default_color black
#默认字体阴影颜色
default_shade_color black
#默认字体轮廓线颜色
default_outline_color black

         

# 增加部件周围的空间 阻止它们移动到别的周边 参数有left, right和none(默认的)
# 注意 这只是使用等宽字体是需要的 比如Bitstream Vera Sans Mono
use_spacer none

    
# 是否从已用内存中减去系统缓冲区
no_buffers yes
# 是否全部英文文本大写
uppercase no

  https://www.cnblogs.com/hellofriland/p/16029445.html

  https://conky.cc/config_settings

======

原始代码

~/.conky/Gotham/Gotham

conky.config = {
	use_xft = true,
	font = '123:size=8',
	xftalpha = 0.1,
	update_interval = 1,
	total_run_times = 0,

	own_window = true,
	own_window_type = 'normal',
	own_window_transparent = true,
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
	own_window_colour = '#000000',
	own_window_argb_visual = false,
	own_window_argb_value = 0,

	double_buffer = true,
--minimum_size 250 5
--maximum_width 500
	draw_shades = false,
	draw_outline = false,
	draw_borders = false,
	draw_graph_borders = false,
	default_color = 'white',
	default_shade_color = 'red',
	default_outline_color = 'green',
	alignment = 'top_middle',
	gap_x = 0,
	gap_y = 20,
	no_buffers = true,
	uppercase = false,
	cpu_avg_samples = 2,
	net_avg_samples = 1,
	override_utf8_locale = true,
	use_spacer = 'yes',


	minimum_width = 0, minimum_height = 0,
};

conky.text = [[
${voffset 10}${color EAEAEA}${font GE Inspira:pixelsize=120}${time %I:%M}${font}${voffset -84}${offset 10}${color FFA300}${font GE Inspira:pixelsize=42}${time %d} ${voffset -15}${color EAEAEA}${font GE Inspira:pixelsize=22}${time  %B} ${time %Y}${font}${voffset 24}${font GE Inspira:pixelsize=58}${offset -148}${time %A}${font}
${voffset 1}${offset 12}${font Ubuntu:pixelsize=12}${color FFA300}HD ${offset 9}$color${fs_free /} / ${fs_size /}${offset 30}${color FFA300}RAM ${offset 9}$color$mem / $memmax${offset 30}${color FFA300}CPU ${offset 9}$color${cpu cpu0}%


]];

原始文件的问题:不支持中文显示。

更多选择  https://cn.linux-console.net/?p=10192#google_vignette

Conky 现在看起来非常漂亮,正如您在下面的屏幕截图中看到的那样。

不过,我们只涉及了一些基本配置。只要您有一点知识和想象力,您就可以用 Conky 做无限的事情。例如,看看下面的配置看起来有多广泛:

对这个配置感兴趣吗?只需将以下代码粘贴到我们之前编辑的 Conky 配置文件中即可:

conky.config = {
	
	update_interval = 1,
	cpu_avg_samples = 2,
	net_avg_samples = 2,
	out_to_console = false,
	override_utf8_locale = true,
	double_buffer = true,
	no_buffers = true,
	text_buffer_size = 32768,
	imlib_cache_size = 0,
	own_window = true,
	own_window_type = 'normal',
	own_window_argb_visual = true,
	own_window_argb_value = 50,
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
	border_inner_margin = 5,
	border_outer_margin = 0,
	xinerama_head = 1,
	alignment = 'bottom_right',
	gap_x = 0,
	gap_y = 33,
	draw_shades = false,
	draw_outline = false,
	draw_borders = false,
	draw_graph_borders = false,
	use_xft = true,
	font = 'Ubuntu Mono:size=12',
	xftalpha = 0.8,
	uppercase = false,
	default_color = 'white',
	own_window_colour = '#000000',
	minimum_width = 300, minimum_height = 0,
	alignment = 'top_right',

};
conky.text = [[
${time %H:%M:%S}${alignr}${time %d-%m-%y}
${voffset -16}${font sans-serif:bold:size=18}${alignc}${time %H:%M}${font}
${voffset 4}${alignc}${time %A %B %d, %Y}
${font}${voffset -4}
${font sans-serif:bold:size=10}SYSTEM ${hr 2}
${font sans-serif:normal:size=8}$sysname $kernel $alignr $machine
Host:$alignr$nodename
Uptime:$alignr$uptime
File System: $alignr${fs_type}
Processes: $alignr ${execi 1000 ps aux | wc -l}

${font sans-serif:bold:size=10}CPU ${hr 2}
${font sans-serif:normal:size=8}${execi 1000 grep model /proc/cpuinfo | cut -d : -f2 | tail -1 | sed 's/\s//'}
${font sans-serif:normal:size=8}${cpugraph cpu1}
CPU: ${cpu cpu1}% ${cpubar cpu1}

${font sans-serif:bold:size=10}MEMORY ${hr 2}
${font sans-serif:normal:size=8}RAM $alignc $mem / $memmax $alignr $memperc%
$membar
SWAP $alignc ${swap} / ${swapmax} $alignr ${swapperc}%
${swapbar}

${font sans-serif:bold:size=10}DISK USAGE ${hr 2}
${font sans-serif:normal:size=8}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /}%
${fs_bar /}

${font Ubuntu:bold:size=10}NETWORK ${hr 2}
${font sans-serif:normal:size=8}Local IPs:${alignr}External IP:
${execi 1000 ip a | grep inet | grep -vw lo | grep -v inet6 | cut -d \/ -f1 | sed 's/[^0-9\.]*//g'}  ${alignr}${execi 1000  wget -q -O- http://ipecho.net/plain; echo}
${font sans-serif:normal:size=8}Down: ${downspeed enp0s3}  ${alignr}Up: ${upspeed enp0s3} 
${color lightgray}${downspeedgraph enp0s3 80,130 } ${alignr}${upspeedgraph enp0s3 80,130 }$color
${font sans-serif:bold:size=10}TOP PROCESSES ${hr 2}
${font sans-serif:normal:size=8}Name $alignr PID   CPU%   MEM%${font sans-serif:normal:size=8}
${top name 1} $alignr ${top pid 1} ${top cpu 1}% ${top mem 1}%
${top name 2} $alignr ${top pid 2} ${top cpu 2}% ${top mem 2}%
${top name 3} $alignr ${top pid 3} ${top cpu 3}% ${top mem 3}%
${top name 4} $alignr ${top pid 4} ${top cpu 4}% ${top mem 4}%
${top name 5} $alignr ${top pid 5} ${top cpu 5}% ${top mem 5}%
${top name 6} $alignr ${top pid 6} ${top cpu 6}% ${top mem 6}%
${top name 7} $alignr ${top pid 7} ${top cpu 7}% ${top mem 7}%
${top name 8} $alignr ${top pid 8} ${top cpu 8}% ${top mem 8}%
${top name 9} $alignr ${top pid 9} ${top cpu 9}% ${top mem 9}%
${top name 10} $alignr ${top pid 10} ${top cpu 10}% ${top mem 10}%
]];

样例 A:

-- Conky, a system monitor https://github.com/brndnmtthws/conky
--
-- This configuration file is Lua code. You can write code in here, and it will
-- execute when Conky loads. You can use it to generate your own advanced
-- configurations.
--
-- Try this (remove the `--`):
--
--   print("Loading Conky config")
--
-- For more on Lua, see:
-- https://www.lua.org/pil/contents.html
--
-- https://blog.csdn.net/ken2232/article/details/137214196
-- -- 修改日期:20240402

conky.config = {
    alignment = 'bottom_right',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'black',
    default_shade_color = 'black',
--        default_outline_color = 'white',
--        default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'DejaVu Sans Mono:size=12',
    gap_x = 60,
    gap_y = 60,
    minimum_height = 5,
    minimum_width = 5,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_wayland = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
--    update_interval = 5.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
--   
    own_window_argb_visual = true,
    own_window_argb_value = 0,
    double_buffer = true,
}

conky.text = [[
${voffset 10}${color EAEAEA}${font Noto Sans CJK SC Light:pixelsize=120}${time %I:%M}${font}\
${voffset -84}${offset 15}${color FFA300}${font Noto Sans CJK SC Light:pixelsize=42}${time %d} \
${voffset -15}${color EAEAEA}${font Noto Sans CJK SC Light:pixelsize=20}${time  %B} ${time %Y}${font}\
${voffset 40}${font Noto Sans CJK SC Light:pixelsize=30}${offset -135}${time %A}${font}

${voffset 1}${offset 12}${font Ubuntu:pixelsize=18}${color FFA300}HD ${offset 9}$color${fs_free /} / ${fs_size /}${offset 30}${color FFA300}RAM \
${offset 9}$color$mem / $memmax${offset 30}${color FFA300}CPU ${offset 9}$color${cpu cpu0}%




]]

样例 B /C /D 的源码下载:

  https://download.csdn.net/download/ken2232/89073134

运行环境:

~$ conky --version
conky 1.12.2 compiled 2022-02-23 for Linux x86_64

配套源码:conky 的配置文件:样例、解释(***)  https://blog.csdn.net/ken2232/article/details/137289272

样例 B:

用途:在设置了隐藏全部菜单之后,造成当前桌面没有时间显示。

解决:如下。

需要代码、或鼠标操作,实现:

Always on top 功能。

好处:

可以移动到屏幕的其他位置。

样例 C:

1. 不需要窗口的标题栏的支持。缺点:不能移动。

2. 需要使用 wmctrl ,以及用户自行设置的快捷键。

快捷键方法:在 Linux 中保持窗口始终位于最前面 / Always on top : wmctrl (***) https://blog.csdn.net/ken2232/article/details/137263473

样例 D:

透明背景;白字、黑色轮廓。

参考:

如何在 Linux 中保持窗口始终位于最前面 / Always on top  https://blog.csdn.net/ken2232/article/details/137263473

  • 19
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值