当前位置: 首页 > 工具软件 > Conky > 使用案例 >

conky安装与配置文件

查锦程
2023-12-01

1.安装

sudo apt-get install conky
zcat /usr/share/doc/conky/examples/conky.conf.gz > ~/.conkyrc

可能提示找不到文件。

2.编辑配置文件

 sudo gedit ~/.conkyrc

 

添加下面内容:

 

use_spacer right
use_xft yes
font Microsoft YaHei:size=8
xftfont Microsoft YaHei:size=8
#xftfont WenQuanYi Zen Hei:pixelsize=12
override_utf8_locale yes
update_interval 1.0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 206 5
maximum_width 400
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff
default_shade_color 000000
default_outline_color 000000
alignment top_right
gap_x 10
gap_y 30
cpu_avg_samples 2
uppercase no # set to yes if you want all text to be in uppercase

TEXT
${font Microsoft YaHei:style=Bold:pixelsize=30}${alignc}${time %H:%M:%S}
${font Microsoft YaHei:pixelsize=18}${alignc}${time %b%d日 星期%a}${font Microsoft YaHei:pixelsize=12}
${color #ffd700}${hr 1}$color
${color #98c2c7}主机名:${color #db7093} $alignr$nodename
${color #98c2c7}内核: ${color #db7093}$alignr$kernel
${color #98c2c7}已开机: ${color #db7093}$alignr$uptime
${color #98c2c7}IP地址: ${color #db7093} ${alignr} ${addr eth0}
${color #98c2c7}CPU使用率: ${color #db7093} $alignr$cpu%
${color #78af78}$cpubar
${color #ddaa00} ${top name 1}$alignr ${top cpu 1}
${color lightgrey} ${top name 2}$alignr ${top cpu 2}
${color lightgrey} ${top name 3} $alignr${top cpu 3}
${color #98c2c7}物理内存:${color #4169e1}$alignr ${color}$mem ${color #98c2c7}/${color}$memmax${color #4169e1}${color #db7093}$memperc%
${color #78af78}${membar}
${color #98c2c7}根分区: ${color}${alignr}${fs_free /} / ${fs_size /}
${color #78af78}${fs_bar 4 /}
${color #98c2c7}Home分区: ${color}${alignr}${fs_free /home} / ${fs_size /home}
${color #78af78}${fs_bar 4 /home}
${color #98c2c7}下载速度:${color} ${downspeed eth0} k/s
${color #98c2c7}上传速度:${color} ${upspeed eth0} k/s
${color #ffd700}${hr 1}$color

 

3.随机启动:

建立一个脚本文件,内容如下:

#!/bin/bash

sleep 8 && conky

然后添加到启动应用程序里。

 类似资料: