I recently discovered Conky, and now I'm hooked on it! Unfortunately, that means I'm up til wee hours of the morning doing code...
Anyways. I'm trying to get weather available on Conky, and I've tried doing two methods, both of which don't work for some odd reason:
This is the entire Conky code for me:
Code: Select all
# Use Xft?
use_xft yes
xftfont Trebuchet MS:size=9
xftalpha 0.8
text_buffer_size 2048
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Create own window instead of using desktop (required in nautilus)
own_window no
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
minimum_size 180 0
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_margins 3
# border width
border_width 1
# Default colors and also border colors
default_color DarkRed
own_window_colour white
# Text alignment, other possible values are commented
alignment top_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 35
gap_y 50
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
TEXT
SYSTEM ${hr 2}
Host: ${alignr}${nodename}
Kernel: ${alignr}${kernel}
CPU: ${cpu cpu}% ${alignr}${cpubar 8,60 cpu}
RAM: $memperc% ${alignr}${membar 8,60}
Uptime: ${alignr}${uptime}
DATE ${hr 2}
${alignc 35}${font Trebuchet MS:size=26}${time %H:%M}${font}
${alignc}${time %a %d %b %Y}
HD ${hr 2}
Home:
${fs_free /home}/${fs_size /home} ${alignr}${fs_bar 8,60 /home}
Root:
${fs_free /root}/${fs_size /root} ${alignr}${fs_bar 8,60 /root}
NETWORK ${hr 2}
${if_existing /proc/net/route wlan0}
${voffset -6}${font PizzaDude Bullets:size=14}C${font} Up: ${upspeed wlan0} kb/s ${alignr}${upspeedgraph wlan0 8,60 BEBEBE BEBEBE}
${voffset 4}${font PizzaDude Bullets:size=14}D${font} Down: ${downspeed wlan0} kb/s ${alignr}${downspeedgraph wlan0 8,60 BEBEBE BEBEBE}
${voffset 4}${font PizzaDude Bullets:size=14}J${font} Upload: ${alignr}${totalup wlan0}
${voffset 4}${font PizzaDude Bullets:size=14}O${font} Download: ${alignr}${totaldown wlan0}
${voffset 4}${font PizzaDude Bullets:size=14}Y${font} Signal: ${wireless_link_qual wlan0}% ${alignr}${wireless_link_bar 8,60 wlan0}
${voffset 4}${font PizzaDude Bullets:size=14}A${font} Local Ip: ${alignr}${addr wlan0}
${else}${if_existing /proc/net/route eth0}
${voffset -6}${font PizzaDude Bullets:size=14}C${font} Up: ${upspeed eth0} kb/s ${alignr}${upspeedgraph eth0 8,60 789E2D A7CC5C}
${voffset 4}${font PizzaDude Bullets:size=14}D${font} Down: ${downspeed eth0} kb/s ${alignr}${downspeedgraph eth0 8,60 789E2D A7CC5C}
${voffset 4}${font PizzaDude Bullets:size=14}J${font} Upload: ${alignr}${totalup eth0}
${voffset 4}${font PizzaDude Bullets:size=14}O${font} Download: ${alignr}${totaldown eth0}
${voffset 4}${font PizzaDude Bullets:size=14}Y${font} Local Ip: ${alignr}${addr eth0}
${endif}${else}${if_existing /proc/net/route eth1}
${voffset -6}${font PizzaDude Bullets:size=14}A${font} Up: ${upspeed eth1} kb/s ${alignr}${upspeedgraph eth1 8,60 789E2D A7CC5C}
${voffset 4}${font PizzaDude Bullets:size=14}U${font} Down: ${downspeed eth1} kb/s ${alignr}${downspeedgraph eth1 8,60 789E2D A7CC5C}
${voffset 4}${font PizzaDude Bullets:size=14}N${font} Upload: ${alignr}${totalup eth1}
${voffset 4}${font PizzaDude Bullets:size=14}T${font} Download: ${alignr}${totaldown eth1}
${voffset 4}${font PizzaDude Bullets:size=14}a${font} Local Ip: ${alignr}${addr eth1}
${endif}${else}
${font PizzaDude Bullets:size=14}4${font} Network Unavailable
${endif}
WEATHER ${hr 2}
${execi 1800 /home/cdjoya/.nsweather/nwsweather.sh}
${endif}
Code: Select all
#!/bin/sh
#
#----------------------------------------------------------------
# This script will take current ASOS observations from an
# XML file from the National Weather Service website and
# feed it to an XML stylesheet for display in the
# desktop system monitor, conky.
#----------------------------------------------------------------
# The script and xslt can be found at the following address:
# http://www.meteor.iastate.edu/~bschwedl/nwsweather.tar.gz
#----------------------------------------------------------------
# Instructions for modification of the display can be found
# throughout the files.
#----------------------------------------------------------------
# Usage:
# ${execi 1800 /path/to/weather/nwsweather.sh}
# Put this line in your .conkyrc file to update the data
# Since this data updates each hour, a 30 minutes time
# interval should be good enough to keep the data up to date.
# 1800 is the update interval in seconds.
#----------------------------------------------------------------
# Creator: Benjamin Schwedler
# Contact: bschwedler@gmail.com
#
# Changelog:
# [2007.11.27]
# File Created
# [2008.07.28]
# DATAXML variable changed to reflect new data hierarchy on
# NWS website
#----------------------------------------------------------------
# Set your location here. The location is the ICAO airport
# code which can be found by exploring the following NWS site:
# http://www.nws.noaa.gov/data/current_obs/
LOC="KBUF"
# This is the directory where you have places the script and
# xslt file.
DIRPATH="/home/cdjoya/.nwsweather"
# curl and xsltproc needed to properly parse the files
# http://curl.haxx.se/
# http://xmlsoft.org/XSLT/
XSLTPATH=/usr/bin/xsltproc
CURLPATH=/usr/bin/curl
# DATAXML is the page from which the observed data is fetched
DATAXML=http://www.nws.noaa.gov/xml/current_obs/KBUF.xml
# Calls the xslt for parsing of the data.
# This file can be modified to display the desired output.
DATAXSLT=$DIRPATH/nwsweather.xslt
# Runs the command to parse data and display in conky
eval "$CURLPATH \"$DATAXML\" 2>/dev/null | $XSLTPATH $DATAXSLT -"
I've tried both methods, and neither work... What in the world am I doing wrong?