Salve! Quasi certamente molti di voi che mi seguono via feed, saranno stupiti dal fatto che sono tornato a scrivere un aricolo.
By the way oggi voglio parlare di conky.
Conky è un programma di system monitor per X Window System. È disponibile per Linux e FreeBSD. È free software rilasciato con licenza BSD.
Conky è in grado di monitorare diverse variabili di sistema, tra cui la CPU, la memoria, lo swap, lo spazio disco, la temperature, l’output di top, il traffico in upload, in download, i messaggi di sistema e molto altro.
È estremamente configurabile, anche se la configurazione può risultare difficile da imparare.
Vi riporto uno screenshoot della mia configurazione.
Per ottenere questo risultato il file di configurazione che ho sviluppato è questo:
alignment top_right
background no
border_inner_margin 20
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color black
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades yes
use_xft yes
xftfont PizzadudeBullets weather x-spiral Webdings STYLBCC_
gap_x 5
gap_y 60
minimum_size 5 5
net_avg_samples 2
double_buffer yes
out_to_console no
out_to_stderr no
extra_newline yes
own_window yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
update_interval 2.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no
TEXT
${image /usr/share/icons/Elegant-AwOken/clear/24×24/places/distributor-logo.png -p 0,18}${offset 35}$sysname $kernel on $machine
${offset 3}${voffset 10}${font StyleBats:size=18}q${font}${voffset -3} Work: ${uptime_short}
TEMP ${voffset -3}${hr 2}
${voffset -3}
#${offset 8}${font weather:size=20}z ${font}${voffset -2}CPU 1 ${execi 1 ~/scripts/cputemp.sh 1} °C
#${offset 8}${font weather:size=20}y ${font}${voffset -2}CPU 2 ${execi 1 ~/scripts/cputemp.sh 2} °C
${offset 8}${font weather:size=20}y ${font}${voffset -2}CPU ${execi 1 ~/scripts/cputemp.sh avg} °C
${offset 8}${font weather:size=20}x ${font}${voffset -2}NVIDIA ${execi 1 nvidia-settings -q [gpu:0]/GPUCoreTemp | grep ‘):’ | awk ‘{print $4}’ | sed ‘s/\.//’} °C
${offset 8}${font weather:size=20}x ${font}${voffset -2}HDD ${execi 1 ~/scripts/hddmonit.sh} °C
PROCESSOR ${voffset -3}${hr 2}
${voffset -3}
${font StyleBats:size=18}A${font} CPU 1: ${cpu cpu0}%
${cpubar cpu0}
${font StyleBats:size=18}A${font} CPU 2: ${cpu cpu1}%
${cpubar cpu1}
HDD & MEMORY ${voffset -3}${hr 2}
${voffset -3}
Root: ${fs_used /} / ${fs_size /}
${fs_bar /}
Home: ${fs_used /home} / ${fs_size /home}
${fs_bar /home}
RAM: $mem / $memmax
$membar
NETWORK ${voffset -3}${hr 2}
${voffset -3}
${execi 1 sh ~/scripts/ip.sh}
Come potete notare utilizzo dei font non standard (PizzadudeBullets weather x-spiral Webdings STYLBCC_) e utilizzo anche due script che ho realizzato in bash: uno per monitorare la temperatura del processore (richiede sensors)
#script cputemp.sh
#!/bin/bash
list=`sensors | grep Core | sed ‘s/°.*//’ | sed ‘s/^.*+//’`
cont=1
acc=0
for cpu in $list
do
if [ $1 = "avg" ]; then
acc=`echo “” | awk ‘{print ‘$acc’ + ‘$cpu’}'`
else
if [ $cont -eq $1 ]; then
echo $cpu
break
fi
fi
((cont=cont+1))
done
if [ $1 = "avg" ]; then
echo “” | awk ‘{print ‘$acc’ / (‘$cont’ – 1)}’
fi
e l’altro per ottenere dati sulle connessioni di rete
#script ip.sh
#!/bin/bash
devices=`ifconfig | grep HWaddr | grep -v vm | sed ‘s/Link.*//g’`
for device in $devices
do
ip=`ifconfig $device | grep “inet addr:” | sed ‘s/.*:\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*[B|P].*/\1/g’`
if [ ! -z $ip ];then
isWireless=`iwconfig $device 2>/dev/null | grep ESSID | sed ‘s/.*ESSID:\”\(.*\)\”/\1/g’`
isVirtual=`echo $device | egrep “tun|tap”`
if [ ! -z $isWireless ]; then
device_p=$device” (Wireless)”
elif [ ! -z $isVirtual ]; then
device_p=$device” (Virtual)”
else
device_p=$device” (Wired)”
fi
echo $device_p
echo “ ip address: “$ip
if [ ! -z $isWireless ]; then
echo “ essid: “$isWireless
fi
fi
done