1.前言
好记性不如烂笔头,给自己做一份备忘,也给需要朋友们做一个参考!
我主要使用conky来看一下CPU的温度和内存占用,还是很实用的。
wbar主要就是美化桌面了,有点mac os那味了。
2.安装过程
sudo apt-get install wbar wbar-config
sudo apt-get install conky
wget -O /home/pi/.conkyrc https://raw.githubusercontent.com/novaspirit/rpi_conky/master/rpi3_conkyrc
wbar
conky
注:这些步骤建议在桌面完成,没有外接显示屏,可以用vnc等等。
3.解决报错
https://raw.githubusercontent.com/novaspirit/rpi_conky/master/rpi3_conkyrc这个链接没法正常使用了了,但是打开上面的网址,复制所有内容,之后直接用nano创建下面这段
sudo nano /home/pi/.conkyrc
打开以后,粘贴你刚才复制的东西,之后ctrl+o保存,回车,ctrl+x
然后直接打开conky就行了
#需要粘贴的内容
background yes
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 0.5
total_run_times 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 250 5
maximum_width 400
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color gray
default_shade_color red
default_outline_color green
alignment top_right
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale no
use_spacer right
TEXT
${font Arial:size=20}${color Tan1}RPI${color Ivory}LINUX
${voffset -90}
${color DimGray}
${font}
${font Arial:bold:size=10}${color Tan1}SYSTEM ${color DarkSlateGray} ${hr 2}
$font${color DimGray}$sysname $kernel $alignr $machine
Frequency $alignr${freq_g cpu0}Ghz
Uptime $alignr${uptime}
File System $alignr${fs_type}
${font Arial:bold:size=10}${color Tan1}CPU ${color DarkSlateGray}${hr 2}
$font${color DimGray}Temp: $alignr ${exec /opt/vc/bin/vcgencmd measure_temp | cut -c6-9} C
$font${color DimGray}CPU1 ${cpu cpu1}% ${cpubar cpu1}
CPU2 ${cpu cpu2}% ${cpubar cpu2}
CPU3 ${cpu cpu3}% ${cpubar cpu3}
CPU4 ${cpu cpu4}% ${cpubar cpu4}
${cpugraph DimGray DarkSlateGray} $color
${font Arial:bold:size=10}${color Tan1}MEMORY ${color DarkSlateGray}${hr 2}
$font${color DimGray}MEM $alignc $mem / $memmax $alignr $memperc%
$membar
$font${color DimGray}SWAP $alignc $swap / $swapmax $alignr $swapperc%
$swapbar
${font Arial:bold:size=10}${color Tan1}HDD ${color DarkSlateGray}${hr 2}
$font${color DimGray}/home $alignc ${fs_used /home} / ${fs_size /home} $alignr ${fs_free_perc /home}%
${fs_bar /home}
${font Arial:bold:size=10}${color Tan1}TOP PROCESSES ${color DarkSlateGray}${hr 2}
${color DimGray}$font${top_mem name 2}${alignr}${top mem 2} %
$font${top_mem name 3}${alignr}${top mem 3} %
$font${top_mem name 4}${alignr}${top mem 4} %
$font${top_mem name 5}${alignr}${top mem 5} %
${font Arial:bold:size=10}${color Tan2}NETWORK ${color DarkSlateGray}${hr 2}
$font${color DimGray}IP on wlan0 $alignr ${addr wlan0}
Down $alignr ${downspeed wlan0} kb/s
Up $alignr ${upspeed wlan0} kb/s
Downloaded: $alignr ${totaldown wlan0}
Uploaded: $alignr ${totalup wlan0}
注:wbar默认在右边,我们可以点击第一个wbar的图标,可以进行设置,比如选择bottom,把插件放在底部。
如上图,此时就可以正常使用这两个插件了。