Conkynetwork.sh (en)

From Conky PitStop

Jump to: navigation, search

conkynetwork.sh

 Language   English   Français   


Script-crinos512-conkynetwork.png

Here is my Network script, and as you can see it is fairly straight forward using mostly built in conky functions except for the very last line which requires vnstat. You may also need to change eth0 to a different network connection if you use it on your own system, but eth0 is the default on most systems.

#!/bin/sh
# conkynetwork.sh
# by Crinos512
# Usage:
#  ${execp ~/.conky/conkyparts/conkynetwork.sh}
#
Month=\"`date +"%b '%y"`\"

echo "\${color1}\${stippled_hr 1}\${color}"
echo "\${voffset -6}  Network: (Internal: \${color2}\${addrs eth0}\${color}, External: \${color2}\${exec wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g'}\${color} )"
echo "\${voffset -6}\${color1}\${stippled_hr 1}\${color}"
echo "\${voffset -5}\$alignc\${downspeedgraph eth0 60,175 110000 550000 -t} \${upspeedgraph eth0 60,175 001100 005500 -t}"
echo "\${voffset -68}     \`Down\${goto 110}\${color2}\${downspeedf eth0} k/s \${color}\${goto 200}\`Up:\${goto 310}\${color2}\${upspeedf eth0} k/s\${color}"
echo "     \`Total Down:\${goto 110}\${color2}\${totaldown eth0}\${color}\${goto 200}\`Total Up:\${goto 310}\${color2}\${totalup eth0}\${color}"
echo "     \`Weekly Down:\${goto 110}\${color2}\${exec vnstat -w -i eth0 | grep \"current week\" | awk '{print \$3 \$4}'}\${color}\${goto 200}\`Weekly Up:\${goto 310}\${color2}\${exec vnstat -w -i eth0 | grep \"current week\" | awk '{print \$6 \$7}'}\${color}"
echo "     \`Monthly Down:\${goto 110}\${color2}\${exec vnstat -m -i eth0 | grep $Month | awk '{print \$3 \$4}'}\${color}\${goto 200}\`Monthly Up:\${goto 310}\${color2}\${exec vnstat -m -i eth0 | grep $Month | awk '{print \$6 \$7}'}\${color}"
echo ""

exit 0


[UPDATED: 12 Sept. 2009]

Personal tools
Namespaces
Variants
Actions
Navigation
English
Français
Toolbox