Saturday, June 5, 2010

Fun with conky

Conky is a great little app that can display on your desktop pertinent information about your computer. I currently have two instances of conky running on my openbox window manager... the first one on the right shows CPU usage and temperature, RAM usage, file system space, processes running, and network information. The one on the left shows a clock, a calendar (with the current date highlighted), and detailed weather information for my city.

Here is a copy of my startup script for reference
pcmanfm &
conky -c conkyclock &
conky &
fbpanel &
volwheel &
eval `cat $HOME/.fehbg` &
xscreensaver -no-splash &
export OOO_FORCE_DESKTOP=gnome &

Here are the conky scripts
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 25
gap_y 15
maximum_width 225
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 normal
own_window yes
stippled_borders 2
update_interval 2
uppercase no
use_spacer yes
use_xft yes
xftalpha 0.8
xftfont arial:size=9

${color #9DCAFF}${font impact:size=12}$sysname $kernel ${alignr}
${color #9DCAFF}$nodename
${font arial:size=5}
${color #0077ff}${font arial:bold:size=12}System:
${color #0077ff}${font arial:size=9}Uptime:$color $uptime ${color #0077ff} Load:$color $loadavg
${color #0077ff}CPU 0(${freq}mhz):${alignr}$color ${cpu cpu1}%
${color #0077ff}${cpubar cpu1}
${color #0077ff}CPU 1(${freq}mhz):${alignr}$color ${cpu cpu2}%
${color #0077ff}${cpubar cpu2}
${color lightgrey}Core0:$color ${platform coretemp.0 temp 1} °C${color grey} @$color ${cpu cpu1}%
${color lightgrey}Core1:$color ${platform coretemp.1 temp 1} °C${color grey} @$color ${cpu cpu2}%
${color #0077ff}RAM Usage:${alignr}$color $mem${color #0077ff}/${color}$memmax - $memperc%
${color #0077ff}$membar
${color #0077ff}Swap Usage:${alignr}$color $swap${color #0077ff}/${color}$swapmax - $swapperc%
${color #0077ff}${swapbar}

${color #0077ff}${font arial:bold:size=12}File Systems:
${color #0077ff}${font arial:size=9}/ ${alignr}$color${fs_used /}/${fs_size /}
${color #0077ff}${fs_bar /}
${color #0077ff}/home ${alignr}$color${fs_used /home}/${fs_size /home}
${color #0077ff}${fs_bar /home}

${color #0077ff}${font arial:bold:size=12}Processes:
${color #0077ff}${font arial:size=9}Top CPU ${alignr}CPU% MEM%
$color ${top name 1} ${alignr}${top cpu 1} ${top mem 1}
$color ${top name 2} ${alignr}${top cpu 2} ${top mem 2}
$color ${top name 3} ${alignr}${top cpu 3} ${top mem 3}
${color #0077ff}Total Processes:$color ${processes}

${color #0077ff}${font arial:bold:size=12}Network:
${font arial:size=9}${color #0077ff}
${color #0077ff}Net Down:$color ${downspeed eth0} k/s
${color #0077ff}${downspeedgraph eth0 104E8B 0077ff}
${color #0077ff}Net Up:$color ${upspeed eth0} k/s
${color #0077ff}${upspeedgraph eth0 104E8B 0077ff}

alignment top_left
background no
gap_x 10
gap_y 15
minimum_size 200 5
maximum_width 250

update_interval 1
total_run_times 0
double_buffer yes
no_buffers yes
text_buffer_size 1248

cpu_avg_samples 2
net_avg_samples 2

use_xft yes

xftfont HanelGotD:size=9
xftalpha 0.5
override_utf8_locale yes
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints below,undecorated,sticky,skip_taskbar,skip_pager
#below, normal override

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

#default_color 454e57
default_color light blue
#default_shade_color 7a999c
default_outline_color green

#MD0: ${alignr}${fs_used /mnt/disks} / ${fs_size /mnt/disks}
#${color slate gray}/var/log/everything.log:
#${color}${exec tail -n33 /var/log/everything.log}
#${font Sans:normal:size=7}${color1}${exec dmesg | uniq | tail -n 5}

${offset 4}${voffset -3}${color light blue}${font URW Gothic L:size=60}${time %I}
${offset 100}${voffset -125}${color light blue}${font URW Gothic L:size=32}${time :%M}
${offset 165}${voffset -73}${color light blue}${font URW Gothic L:size=13}${time %S}${color}
${offset 165}${voffset -7}${color light blue}${font URW Gothic L:size=13}${time :%P}${color}

#${color #1793d1}${hr 1}${font}${color}
${color #9DCAFF}${hr 1}${font}${color}

${font DejaVu Sans Mono :size=10}${execpi 60 DJS=`date +%_d`; cal | sed s/"$DJS"'\b'/'${color #8a6a3e}'"$DJS"'$color'/ | sed s/^/'${offset 20}'/}

${color Cyan}Crystal Lake Weather ${hr 2}$color${execi 600 sh /home/lleu/conky_weather/}
${font conkyweather:size=35}${execi 600 sed -n '4p' /home/lleu/conky_weather/weather1}${font} ${voffset -20}${execi 600 sed -n '1p' /home/lleu/conky_weather/weather1}

${rss 10 item_title 1}
${font conkyweather:size=35}${execi 600 sed -n '5p' /home/lleu/conky_weather/weather1}${font} ${voffset -20}${execi 600 sed -n '2p' /home/lleu/conky_weather/weather1}

${rss 10 item_title 2}
${font conkyweather:size=35}${execi 600 sed -n '6p' /home/lleu/conky_weather/weather1}${font} ${voffset -20}${execi 600 sed -n '3p' /home/lleu/conky_weather/weather1}

To get the weather section running correctly be sure to visit this thread for reference
The relevant information is in the first section labeled 1)Accuweather RSS

Have fun with conky!

No comments: