Conky Sensors App

Conky on my desktopUnder Mint/MATE Linux, Conky polls the system sensors to display status for you. It is fairly straight forward for a programmer to configure and has info at http://conky.sourceforge.net/. The configuration file goes into .conkyrc in your home directory. The script I started with and changed can be downloaded at
http://www.ferns16.plus.com/MyLinuxRamblings/conkyrc. Also see the instructions at http://www.wikihow.com/Configure-Conky and https://help.ubuntu.com/community/SettingUpConky

# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# – tail of /var/log/messages
# – netstat connections to your computer
#
# — Pengo (conky@pengo.us)
#

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_hints below

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft no

# Update interval in seconds
update_interval 3.0

#Maximum Width of Window
maximum_width 300

# Minimum size of text area
# minimum_size 250 5

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
font arial
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_margin 5

# border width
border_width 6

# Default colors and also border colors, grey90 == #e5e5e5
default_color FFFFCC

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 10

# stuff after ‘TEXT’ will be formatted on screen

TEXT
$color
${color CC9900}SYSTEM ${hr 2}$color
$nodename $sysname $kernel on $machine
${color slate grey}Kernel:${color }$kernel

${color slate grey}${time %a, } ${color }${time %e %B %G} ${time %H:%M:%S} ${time %Z}
${color slate grey}UpTime: ${color }$uptime
${color slate grey}CPU:${color } $cpu% ${acpitemp}C ${color slate grey}Load: ${color }$loadavg
${color slate grey}Users: ${color cccccc}$user_names

#battery stats
$color
${color CC9900}BATTERY ${hr 2}$color
${color 006600}${battery} ${battery_percent}%
${battery_bar}

$color
${color CC9900}CPU ${hr 2}$color
Total CPU: ${cpu cpu0}% ${acpitemp}C Load: ${color }$loadavg
${color 597DB2}${cpubar cpu0}$color
${cpugraph cpu0 00ff00 ff0000}
Core 1: ${freq 1} MHz Temprature: $color ${exec sensors|grep ‘Core0’|awk ‘{print $3}’}
${cpu cpu1}% ${color 597DB2}${cpubar cpu1}$color
Core 2: ${freq 2} MHz Temprature: $color ${exec sensors|grep ‘Core1’|awk ‘{print $3}’}
${cpu cpu2}% ${color 597DB2}${cpubar cpu2}$color
Core 3: ${freq 3} MHz Temprature: $color ${exec sensors|grep ‘Core2’|awk ‘{print $3}’}
${cpu cpu3}% ${color 597DB2}${cpubar cpu3}$color
Core 4: ${freq 4} MHz Temprature: $color ${exec sensors|grep ‘Core3’|awk ‘{print $3}’}
${cpu cpu4}% ${color 597DB2}${cpubar cpu4}$color
Core 5: ${freq 5} MHz Temprature: $color ${exec sensors|grep ‘Core4’|awk ‘{print $3}’}
${cpu cpu5}% ${color 597DB2}${cpubar cpu5}$color
Core 6: ${freq 6} MHz Temprature: $color ${exec sensors|grep ‘Core5’|awk ‘{print $3}’}
${cpu cpu6}% ${color 597DB2}${cpubar cpu6}$color

NAME PID CPU% MEM%
${color CCFFFF}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}$color

${color CC9900}MEMORY ${hr 2}$color
RAM Used: $memperc% ${mem} Free: $memfree / $memmax
${color FF6600} ${membar 6}$color
Swap: $swapperc% ${swap} Free: $swapfree / $swapmax
${color FF6600} ${swapbar 6}$color

${color CC9900}DISK ${hr 2}$color
sda5 ${fs_type} /: Used: ${fs_used_perc /}% Free: ${fs_free /} / ${fs_size /}
${color FFFF33} ${fs_bar 6 /}$color
#sda2 ${fs_type}: ${fs_free_perc /media/data}% ${color FFFF33} ${fs_bar 6 /media/data}$color
sdb1 ${fs_type} nash: Used: ${fs_used_perc /nash_data}% Free: ${fs_free /nash_data} / ${fs_size /nash_data}
${color FFFF33} ${fs_bar 6 /nash_data}$color
sdc1 ${fs_type} /c: Used: ${fs_used_perc /c}% Free: ${fs_free /c} / ${fs_size /c}
${color FFFF33} ${fs_bar 6 /c}$color

${color CC9900}NETWORK (${addr eth0}) ${hr 2}$color
Down: $color${downspeed eth0} k/s ${alignr}Up: ${upspeed eth0} k/s
${downspeedgraph eth0 25,140 000000 ff0000} ${alignr}${upspeedgraph eth0
25,140 000000 00ff00}$color
Total: ${totaldown eth0} ${alignr}Total: ${totalup eth0}
Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768
61000 count}${alignr}Total: ${tcp_portmon 1 65535 count}

${color CC9900}LOGGING ${hr 2}$color
${color 339900}${execi 30 tail -n3 /var/log/syslog | fold -w50}$color

For weather setup I highly recommend you visit the Raging Penguin at http://www.ragingpenguin.us/2013/01/19-simple-conky-weather-and-mail-config/

${color CC9900}WEATHER ${hr 2}$color
${execi 3600 curl -s http://weather.noaa.gov/pub/data/observations/metar/decoded/KFWA.TXT | sed -n 3,9p}
#Emergency Information
${font Verdana:style=bold:size=10}Warnings:${font}${color}
${execi 3580 wget -q –output-document=”/tmp/wraw.txt” http://alerts.weather.gov/cap/wwaatmget.php?x=INC003&y=0}\
${execi 3590 cat /tmp/wraw.txt | grep “” | sed -n 2,4p | sed -e ‘s/^[[:space:]]*//’ | sed -e ‘s/\///’ | sed -e ‘s///g’ | sed -e ‘s/ until/\nuntil/’ | sed “s/\([a-zA-Z]\)\s*$/\1/” > /tmp/walerts.txt}\ ${execi 3600 cat /tmp/walerts.txt}

Also found that to get conky to start when I log in, it was necessary to change the “window” commands at the top:
temperature_unit fahrenheit

# Create own window instead of using desktop (required in nautilus)
own_window yes
#own_window_type override
#own_window_hints below
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# UBUNTU-CONKY
# modded by jdnash 4AUG2014
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# – tail of /var/log/messages
# – netstat connections to your computer
#
# — Pengo (conky@pengo.us)
#

temperature_unit fahrenheit

# Create own window instead of using desktop (required in nautilus)
own_window yes
#own_window_type override
#own_window_hints below
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft yes

# Update interval in seconds
update_interval 3.0

#Maximum Width of Window
maximum_width 300

# Minimum size of text area
# minimum_size 250 5

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
font arial:size=9
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_margin 5

# border width
border_width 6

# Default colors and also border colors, grey90 == #e5e5e5
default_color FFFFCC

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 10
# stuff after ‘TEXT’ will be formatted on screen

TEXT
$color
${color CC9900}SYSTEM ${hr 2}$color
$nodename $sysname $kernel on $machine
${color yellow}Kernel:${color } $kernel ${color yellow}UpTime: ${color }$uptime
${color yellow}Users: ${color } $user_names

#battery stats
${color CC9900}BATTERY ${hr 2}$color
${apcupsd localhost 3551}${color} Time Left: ${color green}${apcupsd_timeleft} minutes${color} Remaining: ${apcupsd_charge}%
Load: ${color green}${apcupsd_load}% ${color ivory} ${apcupsd_loadbar}${color}

${color CC9900}CPU ${hr 2}$color
${cpugraph cpu0 00ff00 ff0000}
Total CPU: ${color green}${cpu cpu0}% ${color yellow}${acpitemp}°F ${color} Avg Load: ${color }$loadavg
Core 1: ${freq 1} MHz ${cpu cpu1}% ${color 597DB2}${cpubar cpu1}$color
Core 2: ${freq 2} MHz ${cpu cpu2}% ${color 597DB2}${cpubar cpu2}$color
Core 3: ${freq 3} MHz ${cpu cpu3}% ${color 597DB2}${cpubar cpu3}$color
Core 4: ${freq 4} MHz ${cpu cpu4}% ${color 597DB2}${cpubar cpu4}$color
Core 5: ${freq 5} MHz ${cpu cpu5}% ${color 597DB2}${cpubar cpu5}$color
Core 6: ${freq 6} MHz ${cpu cpu6}% ${color 597DB2}${cpubar cpu6}$color

${color CC9900}MEMORY ${hr 2}$color
RAM: ${color green}$memperc%${color} ${mem} Free: $memfree / $memmax
${color FF6600} ${membar 6}$color
Swap: ${color green}$swapperc%${color} ${swap} Free: $swapfree / $swapmax
${color FF6600} ${swapbar 6}$color
${alignr}${font fixed:size=10}NAME PID CPU% MEM% XXXX
${alignr}${color CCFFFF}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${alignr}${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${alignr}${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${alignr}${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} ${font}

${color CC9900}DISK ${hr 2}$color
sda5 ${fs_type} /: Used: ${fs_used_perc /}% Free: ${fs_free /}/${fs_size /}
${color FFFF33} ${fs_bar 6 /}$color
#sda2 ${fs_type}: ${fs_free_perc /media/data}% ${color FFFF33} ${fs_bar 6 /media/data}$color
sdb1 ${fs_type} nash: Used: ${fs_used_perc /nash_data}% Free: ${fs_free /nash_data}/${fs_size /nash_data}
${color FFFF33} ${fs_bar 6 /nash_data}$color
sdc1 ${fs_type} /c: Used: ${fs_used_perc /c}% Free: ${fs_free /c}/${fs_size /c}
${color FFFF33} ${fs_bar 6 /c}$color

${color CC9900}NETWORK (${addr eth0}) ${hr 2}$color
Down: $color${downspeed eth0} k/s ${alignr}Up: ${upspeed eth0} k/s
${downspeedgraph eth0 25,140 000000 ff0000} ${alignr}${upspeedgraph eth0 25,140 000000 00ff00}$color
Total: ${totaldown eth0} ${alignr}Total: ${totalup eth0}
Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768 61000 count}${alignr}Total: ${tcp_portmon 1 65535 count}

${color CC9900}WEATHER ${hr 2}$color
${execi 300 curl -s http://weather.noaa.gov/pub/data/observations/metar/decoded/KFWA.TXT | sed -n 3,9p}
#Emergency Information
${font Verdana:style=bold:size=10}Warnings:${font}${color}
${execi 3580 wget -q –output-document=”/tmp/wraw.txt” http://alerts.weather.gov/cap/wwaatmget.php?x=INC003&y=0}\
${execi 590 cat /tmp/wraw.txt | grep “<title>” | sed -n 2,4p | sed -e ‘s/^[[:space:]]*//’ | sed -e ‘s/\///’ | sed -e ‘s/<title>//g’ | sed -e ‘s/ until/\nuntil/’ | sed “s/\([a-zA-Z]\)\s*$/\1/” > /tmp/walerts.txt}\
${execi 600 cat /tmp/walerts.txt}

${color CC9900}TIME ${hr 2}$color
${font arial:bold:size=80}${time %H:%M:%S}${font}

${alignr}${color green}${time %a} ${color}${time %e %B %G} ${time %H:%M:%S} ${time %Z}${color}

Hope this helps!
–john

Comments are closed