-
apt-get install hddtemp curl lm-sensors conky-all
-
sudo chmod u+s /usr/sbin/hddtemp
-
vim ~/.conkyrc
然后把以下内容复制进 conkyrc 内 注意修改已有的磁盘名称/dev/vdb 和网卡名称 eth0 修改成自己电脑的磁盘和网卡名称。
alignment top_right
background yes
border_width 1
cpu_avg_samples 2
default_color cornflowerblue
default_outline_color white
default_shade_color white
double_buffer yes
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
gap_x 15
gap_y 35
maximum_width 330
max_port_monitor_connections 64
#max_specials 512
max_user_text 16384
minimum_size 330 10
net_avg_samples 2
no_buffers yes
out_to_console no
#wm_class_name Conky
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type desktop
own_window yes
stippled_borders 2
update_interval 2
uppercase no
use_spacer none
use_xft yes
xftalpha 0.8
xftfont Bitstream Vera Sans Mono:size=9
TEXT
{color #0077ff}nodename {alignc}sysname kernel {alignr}color{time %H:%M}
{color #0077ff}Uptime:color uptime {color #0077ff} Load:color loadavg
{color #0077ff}CPU: {cpu}% {color #0077ff}{cpubar 5,80} {color #0077ff}Disk I/O: color${diskio}
{color #0077ff}{cpugraph 0 32,155 104E8B 0077ff} alignr{color #0077ff}${diskiograph 32,155 104E8B 0077ff 750}
{color #0077ff}RAM Usage:color mem{color #0077ff}/{color}memmax - memperc% {color #0077ff}$membar
{color #0077ff}Swap Usage:color swap{color #0077ff}/{color}swapmax - swapperc% {color #0077ff}${swapbar}
{color #0077ff}Procs:color processes {color #0077ff}Run:color running_processes color {color #0077ff} CPU:color {exec sensors | grep 'Core 0' | cut -c16-17}°C {exec sensors | grep 'Core 2' | cut -c16-17}°C {color #0077ff} HD:color {exec hddtemp /dev/sdb -n -u=C}°C
{color #0077ff}Entropy: {color}{entropy_avail}{color #0077ff}/{color}{entropy_poolsize} {color #0077ff}{entropy_bar}
{color #0077ff}Net Down:color {downspeed eth0} k/s {color #0077ff}Net Up:color {upspeed eth0} k/s
{color #0077ff}{downspeedgraph eth0 32,155 104E8B 0077ff} alignr{color #0077ff}${upspeedgraph eth0 32,155 104E8B 0077ff}
${color #0077ff}File systems:
{color #0077ff}/ color{fs_used /}/{fs_size /}{alignr}{color #0077ff}${fs_bar 5,120 /}
{color #0077ff}/home color{fs_used /home}/{fs_size /home}{alignr}{color #0077ff}${fs_bar 5,120 /home}
{color #0077ff}/opt color{fs_used /opt}/{fs_size /opt}{alignr}{color #0077ff}${fs_bar 5,120 /opt}
{color #0077ff}/usr/local color{fs_used /usr/local}/{fs_size /usr/local}{alignr}{color #0077ff}${fs_bar 5,120 /usr/local}
{color #0077ff}/var color{fs_used /var}/{fs_size /var}{alignr}{color #0077ff}${fs_bar 5,120 /var}
{color #0077ff}/WWW color{fs_used /mnt/www}/{fs_size /mnt/www}{alignr}{color #0077ff}${fs_bar 5,120 /mnt/www}
${color #0077ff}Top Processes:
${color #0077ff}Name PID CPU% MEM%
color {top name 1} {top pid 1} {top cpu 1} ${top mem 1}
color {top name 2} {top pid 2} {top cpu 2} ${top mem 2}
color {top name 3} {top pid 3} {top cpu 3} ${top mem 3}
${color #0077ff}Mem usage
color {top_mem name 1} {top_mem pid 1} {top_mem cpu 1} ${top_mem mem 1}
color {top_mem name 2} {top_mem pid 2} {top_mem cpu 2} ${top_mem mem 2}
color {top_mem name 3} {top_mem pid 3} {top_mem cpu 3} ${top_mem mem 3}
{color #0077ff}Port(s) {alignr} #Connections$color
color Inbound: {tcp_portmon 1 32767 count} Outbound: {tcp_portmon 32768 61000 count}{alignr}ALL: ${tcp_portmon 1 65535 count}
{color #0077ff}Inbound Connection {alignr} Local Service/Port$color
{tcp_portmon 1 32767 rhost 0} {alignr} ${tcp_portmon 1 32767 lservice 0}
{tcp_portmon 1 32767 rhost 1} {alignr} ${tcp_portmon 1 32767 lservice 1}
{tcp_portmon 1 32767 rhost 2} {alignr} ${tcp_portmon 1 32767 lservice 2}
{tcp_portmon 1 32767 rhost 3} {alignr} ${tcp_portmon 1 32767 lservice 3}
{tcp_portmon 1 32767 rhost 4} {alignr} ${tcp_portmon 1 32767 lservice 4}
{color #0077ff}Outbound Connection {alignr} Remote Service/Port$color
{tcp_portmon 32768 61000 rhost 0} {alignr} ${tcp_portmon 32768 61000 rservice 0}
{tcp_portmon 32768 61000 rhost 1} {alignr} ${tcp_portmon 32768 61000 rservice 1}
{tcp_portmon 32768 61000 rhost 2} {alignr} ${tcp_portmon 32768 61000 rservice 2}
{tcp_portmon 32768 61000 rhost 3} {alignr} ${tcp_portmon 32768 61000 rservice 3}
{tcp_portmon 32768 61000 rhost 4} {alignr} ${tcp_portmon 32768 61000 rservice 4}
终端输入 conky 即可
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于