SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#801 2012-11-17 22:16:33

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

ive been doing a little testing and i dont think this is going to be as easy as i thought  sad

Offline

Be excellent to each other!

#802 2012-11-17 22:33:25

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

you can have 2 different conkies calling 2 different copies of v9000 (v9000.lua and v9001.lua) ahd have each of the copies load a different config files without the need to edit but a couple of lines
Screenshot_at_2012_11_17_16_30_39.jpg
but i think getting 2 locations from the same conky might be tricky

Offline

#803 2012-11-17 23:45:28

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

mrpeachy wrote:

you can have 2 different conkies calling 2 different copies of v9000 (v9000.lua and v9001.lua) ahd have each of the copies load a different config files without the need to edit but a couple of lines
http://s17.postimage.org/q3mg1y63f/Screenshot_at_2012_11_17_16_30_39.jpg
but i think getting 2 locations from the same conky might be tricky


Can the "location" be loaded via the templates?

I'm thinking conkyForecast - there was a default location in the ~/.conkyForecast.config but people could use a:

--location=xyz

in the templates and over ride it.

Just a thought.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#804 2012-11-18 01:12:17

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

Sector11 wrote:
mrpeachy wrote:

you can have 2 different conkies calling 2 different copies of v9000 (v9000.lua and v9001.lua) ahd have each of the copies load a different config files without the need to edit but a couple of lines
http://s17.postimage.org/q3mg1y63f/Screenshot_at_2012_11_17_16_30_39.jpg
but i think getting 2 locations from the same conky might be tricky


Can the "location" be loaded via the templates?

I'm thinking conkyForecast - there was a default location in the ~/.conkyForecast.config but people could use a:

--location=xyz

in the templates and over ride it.

Just a thought.

this is possible with a couple of changes

put this into the top of the template

function set_location()
local web="http://www.intellicast.com/Local/Forecast.aspx?unit=F&location=USCA0638"
return web
end

and change line 30 and onward in v9000.lua to this

if timer==0 or start==1 then--######
start=nil--#######################################
local web=set_location()
if web==nil then web=settings_table[2] end
local alert_check=settings_table[13]
--################################################

but the changes wont take effect until the next time v9000 triggers

Offline

#805 2012-11-18 02:02:12

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

ok, it was easier than i thought it was going to be

here is the lua section of my conkyrc

lua_load ~/v9000/v9000.lua
lua_load ~/v9000/template_9000.lua
lua_draw_hook_post weather
###################################################
## load button script #############################
###################################################
lua_load ~/conky/luai/button_script.lua
##################################
## activate mouse click logging ##
##################################
lua_draw_hook_pre get_mouse {"interactiveconkyrc","/tmp/xdo"} 
## after function call, table containing window title and path to click log file
## before running script create a blank log file first.  In the example above "/tmp/xdo" credate a blank file called xdo in your /tmp directory 
###################################################
## restart click logging on conkyrc save/startup ##
###################################################
lua_startup_hook start_xdo /tmp/xdo
## send click file location following function call if not set up in lua script
###################################################
## kill xdotool process on conkyrc save/shutdown ##
###################################################
lua_shutdown_hook stop_xdo
###################################################

a change in v9000 line 29 to 36 was this

local timer=(updates %tonumber(settings_table[1]))
--################################################
if timer==0 or start=="s" then--######
start=nil--#######################################
local web=settings_table[2]
local alert_check=settings_table[13]
--################################################
print ("gathering data with curl")

change to this

local timer=(updates %tonumber(settings_table[1]))
--################################################
web,change=set_location()
if web==nil then
change=0
web=settings_table[2]
end
--################################################
if timer==0 or start==1 or change==1 then--######
start=nil--#######################################

the rest of the script stays the same

and this addition in the template

function set_location()
change1=do_button({btype=3,bname="change_weather",blx_off=200,bly_off=200,bw_off=50,bh_off=50,draw=1})
change2=do_button({btype=3,bname="change_weather",blx_off=280,bly_off=200,bw_off=50,bh_off=50,draw=1})
if change1==1 then
web="http://www.intellicast.com/Local/Forecast.aspx?unit=F&location=UKXX1789"
change=1
--local web="http://www.intellicast.com/Local/Forecast.aspx?unit=F&location=USMO0787"
elseif change2==1 then
--web="http://www.intellicast.com/Local/Forecast.aspx?unit=F&location=UKXX1789"
change=1
web="http://www.intellicast.com/Local/Forecast.aspx?unit=F&location=USMO0787"
elseif change1==0 and change2==0 then
change=nil
end
return web,change
end
change=nil

--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############

http://youtu.be/HRc1AM5jCgI

one thing to note is that on every click the v9000 script downloads new info and processes it... so rapid clicking might cause a problem smile

Last edited by mrpeachy (2012-11-18 19:38:32)

Offline

#806 2012-11-18 16:36:57

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

mrpeachy wrote:

but the changes wont take effect until the next time v9000 triggers

OK I think I misunderstood (because of the next post with the button).

I was thinking like this: 1 conky - 4 templates (as per conkyForecast example)
adzNLepo.jpg

TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.3}
${execpi 1800 conkyForecast --location=CAXX0829 --template=/media/5/Conky/templates/J01.template}\
${execpi 1800 conkyForecast --location=CAXX0255 --template=/media/5/Conky/templates/J02.template}\
${execpi 1800 conkyForecast --template=/media/5/Conky/templates/J03.template}\
${execpi 1800 conkyForecast --location=AYXX0005 --template=/media/5/Conky/templates/J04.template}

J01.template

 ${tztime Canada/Eastern %H:%M} | [--datatype=CN], [--datatype=CO]
 ${color4}[--datatype=CC]${color}
 ${font Zekton:bold:size=11}               ${color3}[--datatype=HT --hideunits]   ${color}[--datatype=LT --hideunits]${font}${image [--datatype=WI] -p 5,45 -s 40x40}${image [--datatype=MI] -p 150,30 -s 40x40}
         ${color9}[--datatype=HT --startday=0 --hideunits] ${color7}[--datatype=LT --startday=0 --hideunits]
         ${color3}Hum: ${color}[--datatype=HM --hideunits]
         ${color3}Vis: ${color}[--datatype=VI]
 ${color3}Wind: ${color}[--datatype=WA]°([--datatype=WD]) ${color3}@ ${color}[--datatype=WS]${color}
 ${color3}UV: ${color}[--datatype=UI] - ${color}[--datatype=UT]
 ${color3}Bar: ${color}[--datatype=BR] - [--datatype=BD]${color}
 ${color8}R:[--datatype=SR] ${color1}S:[--datatype=SS] ${color}D:[--datatype=DL]
${color4}${hr}${color}

J02.template

 ${tztime Canada/Eastern %H:%M} | [--datatype=CN], [--datatype=CO]
 ${color4}[--datatype=CC]${color}
 ${font Zekton:bold:size=11}               ${color3}[--datatype=HT --hideunits]   ${color}[--datatype=LT --hideunits]${font}${image [--datatype=WI] -p 5,195 -s 40x40}${image [--datatype=MI] -p 150,180 -s 40x40}
         ${color9}[--datatype=HT --startday=0 --hideunits] ${color7}[--datatype=LT --startday=0 --hideunits]
         ${color3}Hum: ${color}[--datatype=HM --hideunits]
         ${color3}Vis: ${color}[--datatype=VI]
 ${color3}Wind: ${color}[--datatype=WA]°([--datatype=WD]) ${color3}@ ${color}[--datatype=WS]${color}
 ${color3}UV: ${color}[--datatype=UI] - ${color}[--datatype=UT]
 ${color3}Bar: ${color}[--datatype=BR] - [--datatype=BD]${color}
 ${color8}R:[--datatype=SR] ${color1}S:[--datatype=SS] ${color}D:[--datatype=DL]
${color4}${hr}${color}

J03.template NOTE: no txtime data in the template,  and no "--location" in the conky line - it's the default

 ${time %H:%M} | [--datatype=CN], Arg.
 ${color4}[--datatype=CC]${color}
 ${font Zekton:bold:size=11}               ${color3}[--datatype=HT --hideunits]   ${color}[--datatype=LT --hideunits]${font}${image [--datatype=WI] -p 5,343 -s 40x40}${image [--datatype=MI] -p 150,328 -s 40x40}
         ${color9}[--datatype=HT --startday=0 --hideunits] ${color7}[--datatype=LT --startday=0 --hideunits]
         ${color3}Hum: ${color}[--datatype=HM --hideunits]
         ${color3}Vis: ${color}[--datatype=VI]
 ${color3}Wind: ${color}[--datatype=WA]°([--datatype=WD]) ${color3}@ ${color}[--datatype=WS]${color}
 ${color3}UV: ${color}[--datatype=UI] - ${color}[--datatype=UT]
 ${color3}Bar: ${color}[--datatype=BR] - [--datatype=BD]${color}
 ${color8}R:[--datatype=SR] ${color1}S:[--datatype=SS] ${color}D:[--datatype=DL]
${color4}${hr}${color}

J04.template - Base Marambio is an Argentinian base and uses BsAs time.

 ${time %H:%M} | Marambio Antarctica
 ${color4}[--datatype=CC]${color}
 ${font Zekton:bold:size=11}               ${color3}[--datatype=HT --hideunits]   ${color}[--datatype=LT --hideunits]${font}${image [--datatype=WI] -p 5,495 -s 40x40}${image [--datatype=MI] -p 150,478 -s 40x40}
         ${color9}[--datatype=HT --startday=0 --hideunits] ${color7}[--datatype=LT --startday=0 --hideunits]
         ${color3}Hum: ${color}[--datatype=HM --hideunits]
         ${color3}Vis: ${color}[--datatype=VI]
 ${color3}Wind: ${color}[--datatype=WA]°([--datatype=WD]) ${color3}@ ${color}[--datatype=WS]${color}
 ${color3}UV: ${color}[--datatype=UI] - ${color}[--datatype=UT]
 ${color3}Bar: ${color}[--datatype=BR] - [--datatype=BD]${color}
 ${color8}R:[--datatype=SR] ${color1}S:[--datatype=SS] ${color}D:[--datatype=DL]
${color4}${hr}${color}

So I was thinking something like this, but I'm not well versed in the ways of LUA:

lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load /media/5/Conky/LUA/weather_1.template.lua
lua_load /media/5/Conky/LUA/weather_2.template.lua
lua_load /media/5/Conky/LUA/weather_3.template.lua

From your previous post it is this part that bothers me:

mrpeachy wrote:

and change line 30 and onward in v9000.lua to this

if timer==0 or start==1 then--######
start=nil--#######################################
local web=set_location()
if web==nil then web=settings_table[2] end
local alert_check=settings_table[13]
--################################################

That's effectively clipping out 1100+ lines of code.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#807 2012-11-18 16:37:57

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

mrpeachy wrote:

ok, it was easier than i thought it was going to be

http://youtu.be/HRc1AM5jCgI

one thing to note is that on every click the v9000 script downloads new info and processes it... so rapid clicking might cause a problem smile

Yea, that looks nice - button huh - something I need to explore more.

Last edited by Sector11 (2012-11-18 16:38:33)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#808 2012-11-18 19:25:56

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

^^ ah, that was worded badly big_smile
the rest of the script is still there!

giv me a bit and ill edit my post to be more accurate

Offline

#809 2012-11-18 19:26:08

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: weather in conky (LUA scripts) updated 12/26/13!

Dang Peachy.. you really are 20% cooler!  big_smile

Offline

#810 2012-11-18 19:41:24

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

why thank you falldown big_smile

@sector11 - the functionality you describe, having more than 1 location running simultaneously is possible but would require a significant re-write of v9000

Offline

#811 2012-11-18 20:43:10

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: weather in conky (LUA scripts) updated 12/26/13!

@mrpeachy

a rewrite of v9000? this sounds good smile please add more 'text-features'. it would be nice if it would be possible to use bold text!!!

Offline

#812 2012-11-18 21:19:08

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

mrpeachy wrote:

why thank you falldown big_smile

@sector11 - the functionality you describe, having more than 1 location running simultaneously is possible but would require a significant re-write of v9000

No!  Don't do that!  Not at all what I meant or wanted.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#813 2012-11-18 21:59:23

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

^ dont worry, i wasnt planning on it smile

Offline

#814 2012-11-19 01:52:50

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

OK rusty_jones, a new user to Linux and Crunchbang, asked for this and since there are a few new tweaks to it, here goes.

First off welcome to CrunchBang and the DarkSide rusty_jones.

Next, if you don't already have it, you will need mrpeachy's v9000 weather script, the link to download the script is in the first post.  Don't forget to leave a thank you to mrpeachy.  big_smile

abrtfq3E.jpg
How it looks depends on spacing and the fonts used,

~/Conky/S11_v9_H.conky

## To use #! in a conky use: ${exec echo '#!'}
## killall conky && conky -c ~/Conky/S11_v9_H.conky &
##
## The latest script is a lua only weather script. aka: v9000
## http://crunchbang.org/forums/viewtopic.php?id=16100
##
## the file:
## http://dl.dropbox.com/u/19008369/current%20v9000/v9000.tar.gz
##
## mrppeachys LUA Tutorial
## http://crunchbang.org/forums/viewtopic.php?id=17246
##
##
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_hints below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title Horizontal v9000

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0

minimum_size 860 260  ##820 260   ## width, height
maximum_width 860     ##820       ## width, usually a good idea to equal minimum width

gap_x 0        ### left &right
gap_y 10        ### up & down

alignment top_middle
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Anonymous Pro:size=9

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color gray
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 B22222 #178  34  34	FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.5
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
############### V9000 ########################################################
#starts the lua weather data gathering function, call once at top of conkyrc
lua_load ~/v9000/v9000.lua
lua_draw_hook_post weather
lua_load ~/Conky/LUA/h-10d-template.lua
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1800

###  NOTE: Make sure there is a blank space after TEXT
TEXT

Next the ~/Conky/LUA/h-10d-template.lua

--[[
The latest script is a lua only weather script. aka: v9000
 http://crunchbang.org/forums/viewtopic.php?id=16100

the file:
 http://dl.dropbox.com/u/19008369/current%20v9000/v9000.tar.gz

mrppeachys LUA Tutorial
 http://crunchbang.org/forums/viewtopic.php?id=17246

sun_rise_24[n]
sun_set_24[n]
moon_rise_24[n]
moon_set_24[n]
now["time_24"]
now["fc_hour1_time_24"]
now["fc_hour2_time_24"]
now["fc_hour3_time_24"]

]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
--default_font="Anonymous Pro"--font must be in quotes
default_font="monofur"--font must be in quotes
default_font_size=12
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
out({c=0x00BFFF,a=1,x=10,y=15,txt=now["date"].." "..now["month_short"].." "..now["year"]..": Fetched @ "..now["time_24"]})
image({x=20,y=20,h=40,w=40,file=now["weather_icon"]})
-- Temp / FeelsLike & CONDITIONS TEXT
out({c=0x48D1CC,a=1,f="digitalk",face="normal",fs=50,x=80,y=60,txt=now["temp"]})
out({c=0x00BFFF,a=1,f="digitalk",face="normal",fs=50,x=140,y=60,txt=now["feels_like"]})
out({c=0xA4FFA4,a=1,x=81,y=72,txt="Temp     WC·HI"})

out({c=0x48D1CC,a=1,f="Zekton",fs=18,x=10,y=94,txt=now["conditions_short"]})	-- this is not Zekton (Clear)

-- data titles
--    data output
datay=110   -- y=datay or
datayy=15   -- y=datay+(datayy*1) use 1 or more

out({c=0xFAFAEC,a=1,x=10,y=datay,txt="Wind Chill:"})		-- this is Zekton font ???????
   out({c=0x48D1CC,a=1,x=85,y=datay,txt=now["wind_chill"].."°"})
out({c=0xFAFAEC,a=1,x=110,y=datay,txt="Heat Index:"})
   out({c=0xFF8C00,a=1,x=185,y=datay,txt=now["heat_index"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*1),txt="Today's Hi·Lo:"})
   out({c=0xFF8C00,a=1,x=110,y=datay+(datayy*1),txt=high_temp[1].."°"})
   out({c=0x48D1CC,a=1,x=150,y=datay+(datayy*1),txt=low_temp[1].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*2),txt="Wind:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*2),txt=now["wind_km"]})
   out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*2),txt=now["wind_nesw"]})
   out({c=0xFAFAEC,a=1,x=140,y=datay+(datayy*2),txt="@"})
   out({c=0x48D1CC,a=1,x=165,y=datay+(datayy*2),txt=now["wind_deg"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*3),txt="Hum:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*3),txt=now["humidity"].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*3),txt="DP:"})
   out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*3),txt=now["dew_point"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*4),txt="Bar:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*4),txt=now["pressure_mb"]})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*4),txt="Vis:"})
   out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*4),txt=now["visibility"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*5),txt="Ceil:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*5),txt=now["ceiling"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*6),txt="Precip:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*6),txt=precipitation[1].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*6),txt="Cloud:"})
   out({c=0x48D1CC,a=1,x=150,y=datay+(datayy*6),txt=cloud_cover[1].."%"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*7),txt="UV:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*7),txt=uv_index_num[1]})
   out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*7),txt=uv_index_txt[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*8),txt="Sun:"})
   out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*8),txt=sun_rise_24[1]})
   out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*8),txt=sun_set_24[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*9),txt="Moon:"})
   out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*9),txt=moon_rise_24[1]})
   out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*9),txt=moon_set_24[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*10),txt="Phase:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*10),txt=moon_phase[1]})

-- line
image({x=205,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})
-- 3 hour output
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=15,txt="Next 3"})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=30,txt="Hours"})
-- 1st hour
out({c=0xA4FFA4,x=220,y=50,txt=now["fc_hour1_time_24"]..":00"})
image({w=30,h=30,x=223,y=55,file=now["fc_hour1_wicon"]}) -- image({w=30,h=30,x=223,y=55,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=100,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0xA4FFA4,x=220,y=datay+(datayy*1),txt=now["fc_hour2_time_24"]..":00"})
image({w=30,h=30,x=223,y=130,file=now["fc_hour2_wicon"]}) -- image({w=30,h=30,x=223,y=130,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=180,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xA4FFA4,x=220,y=210,txt=now["fc_hour3_time_24"]..":00"})
image({w=30,h=30,x=223,y=215,file=now["fc_hour3_wicon"]}) -- image({w=30,h=30,x=223,y=215,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=datay+(datayy*10),txt=now["fc_hour3_temp"] .."°"})
-- line
image({x=275,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})

--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=10
topy=15
topyy=135 -- topy+(topyy*1)
topx=285
topxx=120
--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1]        =topx            ,topy
   top_left_x_coordinate[2],top_left_y_coordinate[2]     =topx+(topxx*1)  ,topy
top_left_x_coordinate[3],top_left_y_coordinate[3]        =topx+(topxx*2)  ,topy
   top_left_x_coordinate[4],top_left_y_coordinate[4]     =topx+(topxx*3)  ,topy
top_left_x_coordinate[5],top_left_y_coordinate[5]        =topx+(topxx*4)  ,topy
   top_left_x_coordinate[6],top_left_y_coordinate[6]     =topx            ,topy+(topyy*1)
top_left_x_coordinate[7],top_left_y_coordinate[7]        =topx+(topxx*1)  ,topy+(topyy*1)
   top_left_x_coordinate[8],top_left_y_coordinate[8]     =topx+(topxx*2)  ,topy+(topyy*1)
top_left_x_coordinate[9],top_left_y_coordinate[9]        =topx+(topxx*3)  ,topy+(topyy*1)
   top_left_x_coordinate[10],top_left_y_coordinate[10]   =topx+(topxx*4)  ,topy+(topyy*1)
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
out({c=0xA4FFA4,a=1,x=tlx,y=tly,txt=forecast_day_short[i].."  "..forecast_date[i].."  "..forecast_month_short[i]})
image({x=tlx,y=tly+5,h=30,w=30,file=weather_icon[i]})
out({c=0xFF8C00,a=1,x=tlx+35,y=tly+15,txt=high_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx+35,y=tly+30,txt=low_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx,y=tly+50,txt=conditions_short[i]})

out({c=0xFAFAEC,a=1,x=tlx,y=tly+65,txt="P: "..precipitation[i].."%"})
   out({c=0xFAFAEC,a=1,x=tlx+50,y=tly+65,txt="UV: "..uv_index_num[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+80,txt="H: "..humidity[i].."%"})
	out({c=0xFAFAEC,a=1,x=tlx+50,y=tly+80,txt=uv_index_txt[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+95,txt="S: "..sun_rise_24[i]})
   out({c=0x48D1CC,a=1,x=tlx+60,y=tly+95,txt=sun_set_24[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+110,txt="M: "..moon_rise_24[i]})
   out({c=0x48D1CC,a=1,x=tlx+60,y=tly+110,txt=moon_set_24[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################

The template above has some changes that are not in the current ~/v9000/v9000.lua that you will download (or have) so copy this over:

~/v9000/v9000.lua

--weather v9000 by mrpeachy 01/10/12; released: Feb 29, 2012
require 'cairo'
require 'imlib2'
local username = os.getenv("USERNAME")
--you can enter your username here in case of errors,
--enter username in quotes like this username = "yourname"
local username = "sector11"
package.path = '/home/'..username..'/.v9000_config.lua'
require '.v9000_config'
start=1
--INITIALIZE SETTINGS-- need only be run once
settings_table=weather_settings()
--##################################
--######## main function ###########
function conky_weather()--##########
--##################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
--###UNCOMMENT THE BELOW LINE TO ENABLE CPU DELAY####################################################
--if updates>5 then--###### YOU WILL ALSO HAVE TO UNCOMMENT THE MATCHING end ON LINE 923 ############
--###################################################################################################
local testing=0--this setting is for script testing, if not in testing set to 0
--###################################################################################################
--############start of timed section#################################################################
--###################################################################################################
local timer=(updates %tonumber(settings_table[1]))
--################################################
if timer==0 or start==1 then--######
start=nil--#######################################
local web=settings_table[2]
local alert_check=settings_table[13]
--################################################
print ("gathering data with curl")
local f=io.popen("curl --max-time 60 '"..web.."' | sed 's/%//g'")
allweatherdata=f:read("*a")
f:close()
allweatherdata=string.gsub(allweatherdata,"[\n\r]","")
testall=string.find(allweatherdata,">10 Day Forecast&nbsp")
--CHECK FOR WEATHER ALERTS
if testall~=nil and alert_check==1 then
local alert=string.find(allweatherdata,"Severe Weather Alert!")
	if alert~=nil then
	print ("getting weather alerts")
	--get alert web
	local a,b,alertchunk=string.find(allweatherdata,">Local Information</div>(.*)>Severe Weather Alert!<")
	local a,b,alertsite=string.find(alertchunk,"><a href=%p(.*)%p><img src=")
	local f=io.popen("curl --max-time 60 'http://www.intellicast.com"..alertsite.."' | sed 's/%//g'")
	alertdata=f:read("*a")
	f:close()
	alertdata=string.gsub(alertdata,"[\n\r]","")
	alerttest=string.find(alertdata,"%a")
	else
	print ("you have no weather alerts")
	alerttest=0
	end--if alert~=nil
else
print ("not checking for alerts")
alerttest=1
end--if testall and alert check
processall=1
end--of timed data gathering section
--#########################################################################
--#########################################################################
--in case curl craps up it should retry until it works
if testall==nil or  alerttest==nil then
print ("curl attempt timed out, trying again")
local web=settings_table[2]
local alert_check=settings_table[13]
local f=io.popen("curl --max-time 60 '"..web.."' | sed 's/%//g'")
allweatherdata=f:read("*a")
f:close()
allweatherdata=string.gsub(allweatherdata,"[\n\r]","")
testall=string.find(allweatherdata,">10 Day Forecast&nbsp")
--CHECK FOR WEATHER ALERTS
if testall~=nil and alert_check==1 then
local alert=string.find(allweatherdata,"Severe Weather Alert!")
	if alert~=nil then
	print ("getting weather alerts")
	--get alert web
	local a,b,alertchunk=string.find(allweatherdata,">Local Information</div>(.*)>Severe Weather Alert!<")
	local a,b,alertsite=string.find(alertchunk,"><a href=%p(.*)%p><img src=")
	local f=io.popen("curl --max-time 60 'http://www.intellicast.com"..alertsite.."' | sed 's/%//g'")
	alertdata=f:read("*a")
	f:close()
	alertdata=string.gsub(alertdata,"[\n\r]","")
	alerttest=string.find(alertdata,"%a")
	else
	print ("you have no weather alerts")
	alerttest=0
	end--if alert~=nil
else
print ("not checking for alerts")
alerttest=1
end--if testall and alert_check
processall=1
end--if testall==nil
--end or curl reruns ######################################################
--START PROCESSING ###########################################################################
if testall~=nil and alerttest~=nil and processall==1 then
local weathericons=settings_table[3]
local con_short=settings_table[4]
local visibility_unit=settings_table[6]
local wind_mph_unit=settings_table[7]
local wind_km_unit=settings_table[8]
local wind_kts_unit=settings_table[9]
local ceiling_unit=settings_table[10]
local wind_degrees_unit=settings_table[11]
local translate=settings_table[12]
local alert_check=settings_table[13]
--#########################################################################
--LOAD TRANSLATE TABLES IF TRANSLATE SETTING = 1
	if translate==1 then
	monthshort=settings_table[21]
	monthnames=settings_table[20]
	dayhort=settings_table[19]
	daynames=settings_table[18]
	neswtext=settings_table[14]
	tsuffix=settings_table[15]
	uvindextext=settings_table[16]
	moonphases=settings_table[17]
	additional=settings_table[22]
	else--neswtext,tsuffix,uvindextext,moonphases,daynames,dayshort,monthnames,monthshort
	dayshort={Monday="Mon",Tuesday="Tue",Wednesday="Wed",Thursday="Thu",Friday="Fri",Saturday="Sat",Sunday="Sun"}
	monthshort={January="Jan",February="Feb",March="Mar",April="Apr",May="May",June="Jun",July="Jul",August="Aug",September="Sep",October="Oct",November="Nov",December="Dec"}
	end--end if translate =1
--#########################################################################
--process data tables
--intellicast to conky weather icon conversion
wimage={
wx_65="32",  -- Clear
wx_66="30",  -- Partly Cloudy
wx_67="26",  -- Cloudy
wx_68="32",  -- Clear
wx_69="28",  -- Mostly Cloudy
wx_70="20",  -- Fog
wx_71="32",  -- Clear
wx_72="21",  -- Haze
wx_73="36",  -- Hot
wx_74="14",  -- Light Snow Showers
wx_75="28",  -- Mostly Cloudy
wx_76="18",  -- Sleet
wx_77="14",  -- Light Snow Showers
wx_78="23",  -- Blustery
wx_79="05",  -- Mixed Rain and Snow
wx_80="15",  -- Drifting Snow
wx_81="15",  -- Drifting Snow
wx_82="11",  -- Light Rain
wx_83="16",  -- Snow
wx_84="00",  -- Tornado
wx_85="32",  -- Clear
wx_86="25",  -- N/A
wx_87="09",  -- Drizzle
wx_88="05",  -- Mixed Rain and Snow
wx_89="18",  -- Sleet
wx_90="18",  -- Sleet
wx_91="39",  -- Scattered Showers
wx_92="39",  -- Scattered Showers
wx_93="39",  -- Scattered Showers
wx_94="39",  -- Scattered Showers
wx_95="37",  -- Isolated Thunderstorms
wx_96="37",  -- Isolated Thunderstorms
wx_97="31",  -- Clear
wx_98="29",  -- Partly Cloudy
wx_99="27",  -- Mostly Cloudy
wx_100="47",  -- Isolated Thunderstorms
wx_101="47",  -- Isolated Thunderstorms
wx_102="33",  -- Fair
wx_103="26",  -- Cloudy
wx_104="20",  -- Fog
wx_105="45",  -- Scattered Showers
wx_106="45",  -- Scattered Showers
wx_107="11",  -- Light Rain
wx_108="46",  -- Snow Showers
wx_109="46",  -- Snow Showers
wx_110="06",  -- Mixed Rain and Sleet
wx_111="18",  -- Sleet
wx_112="06",  -- Mixed Rain and Sleet
wx_113="46",  -- Snow Showers
wx_114="46",  -- Snow Showers
wx_115="31",  -- Clear
wx_116="47",  -- Isolated Thunderstorms
}--end w image table
--convert intellicast icons to weather font
wfont={
wx_65="a",
wx_66="c",
wx_67="f",
wx_68="a",
wx_69="d",
wx_70="0",
wx_71="a",
wx_72="9",
wx_73="5",
wx_74="p",
wx_75="d",
wx_76="w",
wx_77="p",
wx_78="6",
wx_79="x",
wx_80="8",
wx_81="8",
wx_82="h",
wx_83="q",
wx_84="m",
wx_85="a",
wx_86="-",
wx_87="h",
wx_88="x",
wx_89="w",
wx_90="w",
wx_91="g",
wx_92="g",
wx_93="g",
wx_94="g",
wx_95="k",
wx_96="k",
wx_97="A",
wx_98="C",
wx_99="D",
wx_100="K",
wx_101="K",
wx_102="B",
wx_103="f",
wx_104="0",
wx_105="G",
wx_106="G",
wx_107="h",
wx_108="O",
wx_109="O",
wx_110="x",
wx_111="w",
wx_112="x",
wx_113="O",
wx_114="O",
wx_115="A",
wx_116="K",
}--end w font table
--conversion day and month tables
moonfontt={
["New"]="@",
["Full"]="=",
["First Quarter"]="T",
["Last Quarter"]="G",
["Waning Gibbous"]="D",
["Waning Crescent"]="J",
["Waxing Crescent"]="Q",
["Waxing Gibbous"]="W",
}--end of moon font table
moonicont={
["New"]=weathericons.."moon_new.png",
["Full"]=weathericons.."moon_full.png",
["First Quarter"]=weathericons.."moon_first_quarter.png",
["Last Quarter"]=weathericons.."moon_last_quarter.png",
["Waning Gibbous"]=weathericons.."moon_waning_gibbous.png",
["Waning Crescent"]=weathericons.."moon_waning_crescent.png",
["Waxing Crescent"]=weathericons.."moon_waxing_crescent.png",
["Waxing Gibbous"]=weathericons.."moon_waxing_gibbous.png",
}--end of moon icon table
windfontt={
S="9",
SSW=":",
SW=";",
WSW="<",
W="=",
WNW=">",
NW="?",
NNW="@",
N="1",
NNE="2",
NE="3",
ENE="4",
E="5",
ESE="6",
SE="7",
SSE="8"
}--end of wind direction font table
--#########################################################################

--#########################################################################
--setup tables for forecast weather
forecast_day={}
forecast_day_caps={}
forecast_day_lc={}
forecast_day_short={}
forecast_day_short_caps={}
forecast_day_short_lc={}
forecast_month={}
forecast_month_caps={}
forecast_month_lc={}
forecast_month_short={}
forecast_month_short_caps={}
forecast_month_short_lc={}
forecast_date={}
weather_icon={}
weather_font={}
high_temp={}
low_temp={}
conditions={}
conditions_caps={}
conditions_lc={}
conditions_short={}
conditions_short_caps={}
conditions_short_lc={}
sun_rise={}
sun_rise_lc={}
sun_rise_time={}
sun_rise_24={}
moon_rise={}
moon_rise_lc={}
moon_rise_time={}
moon_rise_24={}
moon_rise_ampm={}
moon_rise_ampm_lc={}
sun_set={}
sun_set_lc={}
sun_set_time={}
sun_set_24={}
moon_set={}
moon_set_lc={}
moon_set_time={}
moon_set_24={}
moon_set_ampm={}
moon_set_ampm_lc={}
humidity={}
precipitation={}
snow={}
cloud_cover={}
moon_phase={}
moon_phase_caps={}
moon_phase_lc={}
moon_font={}
moon_icon={}
wind_mph={}
wind_km={}
wind_kts={}
wind_font={}
wind_icon={}
wind_deg={}
wind_nesw={}
uv_index_num={}
uv_index_txt={}
uv_index_txt_caps={}
uv_index_txt_lc={}
--#########################################################################

--#########################################################################
--get forecast chunk
local a,b,allweather=string.find(allweatherdata,">10 Day Forecast&nbsp(.*)>More from Intellicast</div>")
--extract information into tables
local start=0
local f=1
while f~=nil do
--match forecast day name and date
local s,f,t=string.find(allweather,"<td colspan=\"2\"><strong>([%a,%s%d]*)</strong></td>",start)
	if t~=nil then
	--split name from month and date
	local a,b,day=string.find(t,"(%a*),%s")
	local a,b,month=string.find(t,",%s(%a*)%s")
	local a,b,date=string.find(t,"(%d*)$")
	--ser day names, regular, caps, lowercase and short
	table.insert(forecast_day_short,dayshort[day])
	table.insert(forecast_day_short_caps,string.upper(dayshort[day]))
	table.insert(forecast_day_short_lc,string.lower(dayshort[day]))
		if translate==1 then
		day=daynames[day]
		else
		day=day
		end
	table.insert(forecast_day,day)
	table.insert(forecast_day_caps,string.upper(day))
	table.insert(forecast_day_lc,string.lower(day))
	--set month types
	table.insert(forecast_month_short,monthshort[month])
	table.insert(forecast_month_short_caps,string.upper(monthshort[month]))
	table.insert(forecast_month_short_lc,string.lower(monthshort[month]))
		if translate==1 then
		month=monthnames[month]
		else
		month=month
		end
	table.insert(forecast_month,month)
	table.insert(forecast_month_caps,string.upper(month))
	table.insert(forecast_month_lc,string.lower(month))
	--set date
	table.insert(forecast_date,date)
	end--if t~= nil
--intellicast weather icon match
local s,f,t=string.find(allweather,"40_white/(wx_[%d]*).png\"",start)
--convert to conkyweather icon
	if t~=nil then
	table.insert(weather_icon,weathericons..wimage[t]..".png")
	--convert to weather font
	table.insert(weather_font,wfont[t])
	end
--match conditions
local s,f,t=string.find(allweather," /><br />([%a%s%p]*)</td>",start)
	if t~=nil then
	table.insert(conditions,t)
	table.insert(conditions_caps,string.upper(t))
	table.insert(conditions_lc,string.lower(t))
	--set short versions--------------------------------
	local cons=t
        for k,v in pairs(con_short) do
            local cons_length=string.len(cons)
            local match_length=string.len(k)
            if cons_length==match_length then
            cons=string.gsub(cons,k,v)
            end
        end
	table.insert(conditions_short,cons)
	table.insert(conditions_short_caps,string.upper(cons))
	table.insert(conditions_short_lc,string.lower(cons))
	-----------------------------------------------------
	end
--match high temp
local s,f,t=string.find(allweather,"\"Hi\">([%p%d]*)&deg",start)
table.insert(high_temp,t)
--match low temp
local s,f,t=string.find(allweather,"\"Lo\">([%p%d]*)&deg",start)
table.insert(low_temp,t)
--match sun rise times
local s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",start)
	if t~=nil then
	--get time only
	local a,b,tm=string.find(t,"([%d%p]*)")
	--get suffix only
	local a,b,suf=string.find(t,"(%u%u)")
--###############################
--24 hour conversion
table.insert(sun_rise_24,convert24(tm,suf))
--###############################
		if translate==1 then
		suf=tsuffix[suf]
		else
		suf=suf
		end
	table.insert(sun_rise,tm.." "..suf)
	table.insert(sun_rise_lc,string.lower(tm.." "..suf))
	table.insert(sun_rise_time,tm)
	end
--match sun set times
local s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then
	--get time only
	local a,b,tm=string.find(t,"([%d%p]*)")
	--get suffix only
	local a,b,suf=string.find(t,"(%u%u)")
--###############################
--24 hour conversion
table.insert(sun_set_24,convert24(tm,suf))
--###############################
		if translate==1 then
		suf=tsuffix[suf]
		else
		suf=suf
		end
	table.insert(sun_set,tm.." "..suf)
	table.insert(sun_set_lc,string.lower(tm.." "..suf))
	table.insert(sun_set_time,tm)
	end
--moon rise
local s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then
	--get time only
	local a,b,tm=string.find(t,"([%d%p]*)")
	--get suffix only
	local a,b,suf=string.find(t,"(%u%u)")
--###############################
--24 hour conversion
table.insert(moon_rise_24,convert24(tm,suf))
--###############################
		if translate==1 then
		suf=tsuffix[suf]
		else
		suf=suf
		end
	table.insert(moon_rise,tm.." "..suf)
	table.insert(moon_rise_lc,string.lower(tm.." "..suf))
	table.insert(moon_rise_time,tm)
	table.insert(moon_rise_ampm,suf)
	table.insert(moon_rise_ampm_lc,string.lower(suf))
	end
--moon set
local s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
	if t~=nil then
	--get time only
	local a,b,tm=string.find(t,"([%d%p]*)")
	--get suffix only
	local a,b,suf=string.find(t,"(%u%u)")
--###############################
--24 hour conversion
table.insert(moon_set_24,convert24(tm,suf))
--###############################
		if translate==1 then
		suf=tsuffix[suf]
		else
		suf=suf
		end
	table.insert(moon_set,tm.." "..suf)
	table.insert(moon_set_lc,string.lower(tm.." "..suf))
	table.insert(moon_set_time,tm)
	table.insert(moon_set_ampm,suf)
	table.insert(moon_set_ampm_lc,string.lower(suf))
	end
--match uv index
local s,f,tuv=string.find(allweather,"UV Index:</strong>%s*(%d*%s*%([%a%s]*%))%s*<br />",start)
if tuv~=nil then
	--get just number
	local a,b,unm=string.find(tuv,"(%d*)%s*%([%a%s]*%)")
	--get just text
	local a,b,utx=string.find(tuv,"%d*%s*%(([%a%s]*)%)")
	table.insert(uv_index_num,unm)
		if translate==1 then
		utx=uvindextext[utx]
		else
		utx=utx
		end
	table.insert(uv_index_txt,utx)
	table.insert(uv_index_txt_caps,string.upper(utx))
	table.insert(uv_index_txt_lc,string.lower(utx))
	end
--match humidity
local s,f,t=string.find(allweather,"Humidity:</strong> (%d*)<br />",start)
table.insert(humidity,t)
--match ppt
local s,f,t=string.find(allweather,"Precipitation:</strong> (%d*)<br />",start)
table.insert(precipitation,t)
--match snow %
local s,f,t=string.find(allweather,"Snow Probability:</strong>%s*(%d*)<br />",start)
table.insert(snow,t)
--match cloud coveage
local s,f,t=string.find(allweather,"Cloud Coverage:</strong> (%d*)<br />",start)
table.insert(cloud_cover,t)
--match moon phase
local s,f,t=string.find(allweather,"Moon Phase:</strong> ([%a%s]*) <br />",start)
--set moon phase text
	if t~= nil then
	--set moon phase font and icon
	table.insert(moon_font,moonfontt[t])
	table.insert(moon_icon,moonicont[t])
		if translate==1 then
		t=moonphases[t]
		else
		t=t
		end
	table.insert(moon_phase,t)
	table.insert(moon_phase_caps,string.upper(t))
	table.insert(moon_phase_lc,string.lower(t))
	end
--match wind speeds
local s,f,tmph=string.find(allweather,"Wind Speed:</strong> (%d*)Mph",start)
local tmph=tonumber(tmph)
table.insert(wind_mph,tmph)
local s,f,t=string.find(allweather,"Mph%s*%((%d*)Km,",start)
table.insert(wind_km,t)
local s,f,t=string.find(allweather,"Km,%s*(%d*)Kts%)",start)
table.insert(wind_kts,t)
--match wind direction
local s,f,twd=string.find(allweather,"Wind Direction:</strong> ([%d&;%s%(%a%)]*)%s*</div>",start)
	if twd~=nil then
	local a,b,tdeg=string.find(twd,"(%d*)&deg;")
	table.insert(wind_deg,tdeg)
	--match wind font and nesw
	local a,b,tnesw=string.find(twd,"%((%a*)%)")
	table.insert(wind_font,windfontt[tnesw])
		if tmph>0 and tmph<19 then
		table.insert(wind_icon,weathericons.."green_"..string.lower(tnesw)..".png")
		elseif tmph>18 and tmph<38 then
		table.insert(wind_icon,weathericons.."yellow_"..string.lower(tnesw)..".png")
		elseif tmph>37 and tmph<64 then
		table.insert(wind_icon,weathericons.."orange_"..string.lower(tnesw)..".png")
		elseif tmph>63 then
		table.insert(wind_icon,weathericons.."green_"..string.lower(tnesw)..".png")
		elseif tmph==0 then
		table.insert(wind_icon,weathericons.."no_wind.png")
		end
		if translate==1 then
		tnesw=neswtext[tnesw]
		else
		tnesw=tnesw
		end
	table.insert(wind_nesw,tnesw)
	end
if f==nil then break end
start=f
end--while
--#########################################################################################################################################

--#########################################################################
--get location
local a,b,wl=string.find(allweatherdata,"<title>%s*Intellicast%s%p%s(.*)</title>")
weather_location=string.gsub(wl," Extended Forecast in",",")
--#########################################################################

--#########################################################################
--format now weather
--extract current data
--get now weather chunk
local a,b,nowweather=string.find(allweatherdata,">Current Conditions&nbsp(.*)>View Detailed Observations for the last<br />")
now={}
monthlong={Jan="January",Feb="February",Mar="March",Apr="April",May="May",Jun="June",Jul="July",Aug="August",Sep="September",Oct="October",Nov="November",Dec="December"}
local s,f,tnow=string.find(nowweather,"<div style=\"float:right;color:#666;\">  As of ([%d%p%a%s]*) %(Local Time%)")
local s,f,t=string.find(tnow,"(%d*%p%d*%s%a*) on")
--get time only
local a,b,ntm=string.find(t,"(%d*%p%d*)")
--get suffix only
local a,b,suf=string.find(t,"(%u%u)")
--###############################
--24 hour conversion
now["time_24"]=convert24(ntm,suf)
--###############################
if translate==1 then
suf=tsuffix[suf]
else
suf=suf
end
now["time"]=ntm.." "..suf
now["time_lc"]=string.lower(ntm.." "..suf)
now["time_num"]=ntm
now["time_ampm"]=suf
now["time_ampm_lc"]=string.lower(suf)
--get day
local s,f,t=string.find(tnow,"on (%a*)%s%d*")
if translate==1 then
day=daynames[t]
else
day=t
end
now["day"]=day
now["day_caps"]=string.upper(day)
now["day_lc"]=string.lower(day)
--short day names
local ds=dayshort[t]
now["day_short"]=ds
now["day_short_caps"]=string.upper(ds)
now["day_short_lc"]=string.lower(ds)
--get date
local s,f,t=string.find(tnow,"%s(%d%d)%s")
now["date"]=t
--get months
local s,f,t=string.find(tnow,"%d%d%s(%a*)%s%d")
if translate==1 then
mnth=monthlong[t]
now["month_short"]=monthshort[mnth]
now["month_short_caps"]=string.upper(monthshort[mnth])
now["month_short_lc"]=string.lower(monthshort[mnth])
mnth=monthnames[mnth]
else
now["month_short"]=t
now["month_short_caps"]=string.upper(t)
now["month_short_lc"]=string.lower(t)
mnth=monthlong[t]
end
now["month"]=mnth
now["month_caps"]=string.upper(mnth)
now["month_lc"]=string.lower(mnth)
--get year
local s,f,t=string.find(tnow,"%a%a%a%s(%d%d%d%d)")
now["year"]=t
--get weather icon
local s,f,t=string.find(nowweather,"40_white/(wx_[%d]*)%ppng%p%stitle=%p")
now["weather_icon"]=weathericons..wimage[t]..".png"
now["weather_font"]=wfont[t]
--class=%pIcon%p /> ([%a%s]*)%s*</td>
local s,f,t=string.find(nowweather,"class=%pIcon%p /> ([%a%s%p]*)%s*%s*</td>%s*<td class=%pEmpty%p>&nbsp;")
local t=t:gsub("^%s*(.-)%s*$", "%1")
now["conditions"]=t
now["conditions_caps"]=string.upper(t)
now["conditions_lc"]=string.lower(t)
--set short versions------------------------
	local cons=t
        for k,v in pairs(con_short) do
            local cons_length=string.len(cons)
            local match_length=string.len(k)
            if cons_length==match_length then
            cons=string.gsub(cons,k,v)
            end
        end
	now["conditions_short"]=cons
	now["conditions_short_caps"]=string.upper(cons)
	now["conditions_short_lc"]=string.lower(cons)
--------------------------------------------
local s,f,t=string.find(nowweather,"Temperature\">([%p%d]*)&deg")
now["temp"]=t
local s,f,t=string.find(nowweather,">Feels Like: ([%p%d]*)&deg;</a>")
now["feels_like"]=t
local s,f,t=string.find(nowweather,">Wind Chill: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["wind_chill"]=t
local s,f,t=string.find(nowweather,">Ceiling: </a></td>%s*<td>([%a%d]*)</td>")
if t~="Unl" then
local s,f,t=string.find(t,"([%d%p]*)")
tc=t..ceiling_unit
else
	if translate==1 then unlset=additional.Unl else unlset=t end
tc=unlset
end
now["ceiling"]=tc
now["ceiling_caps"]=string.upper(tc)
now["ceiling_lc"]=string.lower(tc)
--get heat index
local s,f,t=string.find(nowweather,">Heat Index: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["heat_index"]=t
--get visibility
local s,f,t=string.find(nowweather,">Visibility: </a></td>%s*<td>([%a%d%p]*)</td>")
if t~="Unl" then
local s,f,t=string.find(t,"([%d%p]*)")
tv=t..visibility_unit
else
	if translate==1 then unlset=additional.Unl else unlset=t end
tv=unlset
end
now["visibility"]=tv
now["visibility_caps"]=string.upper(tv)
--get dew point
local s,f,t=string.find(nowweather,">Dew Point: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["dew_point"]=t
--get wind speed
local s,f,t=string.find(nowweather,">Wind: </a></td>%s*<td>(%d*)mph</td>")
local tmph=tonumber(t)
now["wind_mph"]=t..wind_mph_unit
now["wind_mph_caps"]=string.upper(t..wind_mph_unit)
--convert mph to km and knots #################################################
--[[1 mile per hour = 0.869 international nautical mile per hour (knot)
     1 mile per hour = 1.609 kilometers per hour
     1 mile per hour = 0.4470 meter per second
     1 knot = 1.852 kilometers per hour
     1 knot = 0.5144 meter per second
     1 meter per second = 3.6 kilometers per hour]]
now["wind_km"]=round(tonumber(t)*1.609)..wind_km_unit
now["wind_km_caps"]=string.upper(round(tonumber(t)*1.609)..wind_km_unit)
now["wind_kts"]=round(tonumber(t)*0.869)..wind_kts_unit
now["wind_kts_caps"]=string.upper(round(tonumber(t)*0.869)..wind_kts_unit)
--#############################################################################
local s,f,t=string.find(nowweather,">Humidity: </a></td>%s*<td>(%d*)</td>")
now["humidity"]=t
--get wind direction #######################################################
local s,f,twd=string.find(nowweather,">Direction: </a></td>%s*<td style=[%p%a]*>([%d&;%s%(%a%)]*)</td>%s*</tr>")
--check for NA
local a,b,t=string.find(twd,"(%a*)")
local tnesw=t
if tnesw~="NA" then
local a,b,t=string.find(twd,"(%d*)&deg;")
now["wind_deg"]=t..wind_degrees_unit
local a,b,tnesw=string.find(twd,"%((%a*)%)")
	if tmph>0 and tmph<19 then
	now["wind_icon"]=weathericons.."green_"..string.lower(tnesw)..".png"
	elseif tmph>18 and tmph<38 then
	now["wind_icon"]=weathericons.."yellow_"..string.lower(tnesw)..".png"
	elseif tmph>37 and tmph<64 then
	now["wind_icon"]=weathericons.."orange_"..string.lower(tnesw)..".png"
	elseif tmph>63 then
	now["wind_icon"]=weathericons.."green_"..string.lower(tnesw)..".png"
	end
now["wind_font"]=windfontt[tnesw]
--################################
	if translate==1 then
	tnesw=neswtext[tnesw]
	else
	tnesw=tnesw
	end
--################################
now["wind_nesw"]=tnesw
else
	if translate==1 then naset=additional.NA else naset="NA" end
now["wind_deg"]=naset
now["wind_icon"]=weathericons.."no_wind.png"
now["wind_nesw"]=naset
now["wind_font"]=windfontt["N"]
end
--END WIND DIRECTION #######################################################
--get pressure
local s,f,t=string.find(nowweather,">Pressure: </a></td>%s*<td>([%d%p]*)\"</td>")
now["pressure"]=t
--convert pressures ########################################################
--[[ 1 inch of mercury = 25.4 mm of mercury = 33.86 millibars
     = 33.86 hectoPascals]]
now["pressure_mb"]=round(tonumber(t)*33.86)
--##########################################################################
local s,f,t=string.find(nowweather,">Gusts: </a></td>%s*<td>([%d%a]*)</td>")
if t~="NA" then
local s,f,t=string.find(t,"(%d*)")
tg=t..wind_mph_unit
tgkm=round(tonumber(t)*1.609)..wind_km_unit
tgkts=round(tonumber(t)*0.869)..wind_kts_unit
else
	if translate==1 then naset=additional.NA else naset="NA" end
tg=naset
tgkm=naset
tgkts=naset
end
now["wind_gusts"]=tg
now["wind_gusts_caps"]=string.upper(tg)
now["wind_gusts_km"]=tgkm
now["wind_gusts_km_caps"]=string.upper(tgkm)
now["wind_gusts_kts"]=tgkts
now["wind_gusts_kts_caps"]=string.upper(tgkts)
--##########################################################################
--get hourly forecast options hour1--------------------
--get day 1 bit
local s,f,hfc=string.find(nowweather,"<td class=%pHour%p%sstyle=%ppadding%pleft([%a%d%p%s]*)%pdeg%p</strong>",1)
--get time and conditions
--<strong>1 PM</strong><br />%s*P Cloudy%s*</td>%s*<td class=%pHour%p
local a,b,tm=string.find(hfc,"<strong>([%d%p]*)[%s%a]*</strong><br",1)
local a,b,suf=string.find(hfc,"<strong>[%d%p%s]*([%a]*)</strong><br",1)
--24 hour conversion ######################
now["fc_hour1_time_24"]=convert24(tm,suf)
--#########################################
		if translate==1 then
		suf=tsuffix[suf]
		else
		suf=suf
		end
now["fc_hour1_time"]=tm
now["fc_hour1_ampm"]=suf
now["fc_hour1_ampm_lc"]=string.lower(suf)
local a,b,t=string.find(hfc,"</strong><br%s/>%s*([%p%s%a]*)%s*</td>%s*<td class=%pHour%p",1)
now["fc_hour1_cond"]=t
now["fc_hour1_cond_lc"]=string.lower(t)
now["fc_hour1_cond_caps"]=string.upper(t)
----------set short versions--------------------------------
	local cons=t
        for k,v in pairs(con_short) do
            local cons_length=string.len(cons)
            local match_length=string.len(k)
            if cons_length==match_length then
            cons=string.gsub(cons,k,v)
            end
        end
	now["fc_hour1_cond_short"]=cons
	now["fc_hour1_cond_short_caps"]=string.upper(cons)
	now["fc_hour1_cond_short_lc"]=string.lower(cons)
-------------------------------------------------------------
--get weather icon and font
local a,b,t=string.find(hfc,"32_white/(wx_[%d]*)%ppng%p%stitle=%p",1)
now["fc_hour1_wicon"]=weathericons..wimage[t]..".png"
now["fc_hour1_wfont"]=wfont[t]
--get temperature
--><strong>-5&deg;</strong></td>
local a,b,t=string.find(hfc,"><strong>([%p%d]*)&deg;</strong></td>",1)
now["fc_hour1_temp"]=t
--end of hour1 data gathering--repeat 2 more times
--get hourly forecast options hour2--------------------
local start=tonumber(b)
--get time and conditions
--<strong>1 PM</strong><br />%s*P Cloudy%s*</td>%s*<td class=%pHour"%p
local a,b,tm=string.find(hfc,"<strong>([%d%p]*)[%s%a]*</strong><br",start)
local a,b,suf=string.find(hfc,"<strong>[%d%p%s]*([%a]*)</strong><br",start)
--24 hour conversion ######################
now["fc_hour2_time_24"]=convert24(tm,suf)
--#########################################
		if translate==1 then
		suf=tsuffix[suf]
		else
		suf=suf
		end
now["fc_hour2_time"]=tm
now["fc_hour2_ampm"]=suf
now["fc_hour2_ampm_lc"]=string.lower(suf)
local a,b,t=string.find(hfc,"</strong><br%s/>%s*([%a%s%p]*)%s*</td>%s*<td class=%pHour%p",start)
now["fc_hour2_cond"]=t
now["fc_hour2_cond_lc"]=string.lower(t)
now["fc_hour2_cond_caps"]=string.upper(t)
----------set short versions--------------------------------
	local cons=t
        for k,v in pairs(con_short) do
            local cons_length=string.len(cons)
            local match_length=string.len(k)
            if cons_length==match_length then
            cons=string.gsub(cons,k,v)
            end
        end
	now["fc_hour2_cond_short"]=cons
	now["fc_hour2_cond_short_caps"]=string.upper(cons)
	now["fc_hour2_cond_short_lc"]=string.lower(cons)
-------------------------------------------------------------
--get weather icon and font
local a,b,t=string.find(hfc,"32_white/(wx_[%d]*)%ppng%p%stitle=%p",start)
now["fc_hour2_wicon"]=weathericons..wimage[t]..".png"
now["fc_hour2_wfont"]=wfont[t]
--get temperature
--><strong>-5&deg;</strong></td>
local a,b,t=string.find(hfc,"><strong>([%p%d]*)&deg;</strong></td>",start)
now["fc_hour2_temp"]=t
--end of hour2 data gathering--repeat 1 more times
--get hourly forecast options hour3--------------------
local start=tonumber(b)
--get time and conditions
--<strong>1 PM</strong><br />%s*P Cloudy%s*</td>%s*<td class=%pHour"%p
local a,b,tm=string.find(hfc,"<strong>([%d%p]*)[%s%a]*</strong><br",start)
local a,b,suf=string.find(hfc,"<strong>[%d%p%s]*([%a]*)</strong><br",start)
--24 hour conversion ######################
now["fc_hour3_time_24"]=convert24(tm,suf)
--#########################################
		if translate==1 then
		suf=tsuffix[suf]
		else
		suf=suf
		end
now["fc_hour3_time"]=tm
now["fc_hour3_ampm"]=suf
now["fc_hour3_ampm_lc"]=string.lower(suf)
local a,b,t=string.find(hfc,"</strong><br%s/>%s*([%a%s%p]*)%s*</td>%s*<td class=%pHour%p",start)
now["fc_hour3_cond"]=t
now["fc_hour3_cond_lc"]=string.lower(t)
now["fc_hour3_cond_caps"]=string.upper(t)
----------set short versions--------------------------------
	local cons=t
        for k,v in pairs(con_short) do
            local cons_length=string.len(cons)
            local match_length=string.len(k)
            if cons_length==match_length then
            cons=string.gsub(cons,k,v)
            end
        end
	now["fc_hour3_cond_short"]=cons
	now["fc_hour3_cond_short_caps"]=string.upper(cons)
	now["fc_hour3_cond_short_lc"]=string.lower(cons)
-------------------------------------------------------------
--get weather icon and font
local a,b,t=string.find(hfc,"32_white/(wx_[%d]*)%ppng%p%stitle=%p",start)
now["fc_hour3_wicon"]=weathericons..wimage[t]..".png"
now["fc_hour3_wfont"]=wfont[t]
--get temperature
--><strong>-5&deg;</strong></td>
local a,b,t=string.find(hfc,"><strong>([%p%d]*)",start)
now["fc_hour3_temp"]=t
--end of hour3 data gathering--finished for all hours
--ALERTS###############################################################
if alert_check==1 then
--set tables
alert_type={}
alert_issued={}
if alerttest~=0 then
alert_icon=weathericons.."icon_alert_1.gif"
--extract information into tables
local start=0
local f=1
while f~=nil do
local s,f,t=string.find(alertdata,"><strong class='Alert'>([%a%s]*)</strong><br/>",start)
	if t~=nil then
	table.insert(alert_type,string.upper(t))
	end--if t~=nil
local s,f,t=string.find(alertdata,"<br />([%d%a%s:]*)<br /><br />",start)
	if t~=nil then
	table.insert(alert_issued,t)
	end--if t~=nil
if f==nil then break end
start=f
alert_number=#alert_type
end--while
else
alert_icon=weathericons.."icon_alert_0.gif"
table.insert(alert_type,"NO ALERTS")
table.insert(alert_issued,"")
alert_number=0
end--alerttest~=nil
else
alert_type={}
alert_issued={}
alert_icon=weathericons.."icon_alert_0.gif"
table.insert(alert_type,"alerts turned off")
table.insert(alert_issued,"")
alert_number=0
end--if alert check ###########################################
--###############end of data processing########################

--#########################################################################
if testing==0 then
processall=0
print ("processing complete")
elseif testing==1 then
processall=1
end--if testing ==0
--###################################################################################
end--of data processing section #####################################################
--###################################################################################
if processall==0 or testing==1 then
_G.weather_script()
end
--#########################################################################################################
--###UNCOMMENT THE BELOW LINE TO ENABLE CPU DELAY##########################################################
--end--####### end of if updates>5 #############################
--#########################################################################################################

cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
--######################################
end-- end main function ################
--######################################
function round(num)
	local idp=tonumber(settings_table[5])
	local mult = 10^(idp or 0)
	return math.floor(num * mult + 0.5) / mult
end--of round function #################################################################
function string:split(delimiter)--######################################################
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end--string split ##############################################################
-- #############################################################################
-- #############################################################################
--[[
function out(tx)--##############################################################
c=nil
c=(tx.c or default_color)
a=nil
a=(tx.a or default_alpha)
f=nil
f=(tx.f or default_font)
fs=nil
fs=(tx.fs or default_font_size)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,x,y)
cairo_show_text (cr,txt)
cairo_stroke (cr)
end--function out ##############################################################
	]]
-- #############################################################################

function out(tx)--##############################################################
--#############################
--font needs to be set first #########
f=nil
f=(tx.f or default_font)
--#############################
--additional face settings
face=nil
face=(tx.face or default_face)  -- old is: face=(tx.face or "normal")
if face=="normal" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bold" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
elseif face=="italic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bolditalic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
end
--##############################################################################
c=nil
c=(tx.c or default_color)
a=nil
a=(tx.a or default_alpha)
fs=nil
fs=(tx.fs or default_font_size)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,x,y)
cairo_show_text (cr,txt)
cairo_stroke (cr)
end--function out ##############################################################

-- #############################################################################
function image(im)--#################################################################
x=nil
x=(im.x or 0)
y=nil
y=(im.y or 0)
w=nil
w=(im.w or default_image_width)
h=nil
h=(im.h or default_image_height)
file=nil
file=tostring(im.file)
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then
width=imlib_image_get_width()
else
width=tonumber(w)
end
if tonumber(h)==0 then
height=imlib_image_get_height()
else
height=tonumber(h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(x, y)
imlib_free_image()
show=nil
end--function image ##################################################################
function convert24(tm,suf)
local tmlen=string.len(tm)
local colon=string.find(tm,":")
	if colon~=nil then
	tmhr=string.sub(tm,1,colon-1)
	tmmn=string.sub(tm,colon+1,tmlen)
	else
	tmhr=tm
	tmmn=""
	end
if suf=="PM" and tonumber(tmhr)~=12 then
tmhr=tmhr+12
elseif suf=="PM" and tonumber(tmhr)==12  then
tmhr=12
elseif suf=="AM" and tonumber(tmhr)<10 then
tmhr="0"..tmhr
elseif suf=="AM" and tonumber(tmhr)>=10 and tonumber(tmhr)~=12 then
tmhr=tmhr
elseif suf=="AM" and tonumber(tmhr)==12 then
tmhr="00"
end
if colon~=nil then
return tmhr..":"..tmmn
else
return tmhr
end--if colon~=nil
end--of function
--END OF SCRIPT

Once you have it at the beginning of the file change "Sector11" to your user name.

local username = os.getenv("USERNAME")
--you can enter your username here in case of errors,
--enter username in quotes like this username = "yourname"
local username = "sector11"
package.path = '/home/'..username..'/.v9000_config.lua'

Next because it is called in the conky: ~/Conky/LUA/draw-bg.lua

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

Above and After TEXT  (requires a composite manager or it blinks!)

 lua_load ~/wea_conky/draw_bg.lua
 TEXT
 ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}

OR Both above TEXT (no composite manager required - no blinking!)

 lua_load ~/wea_conky/draw_bg.lua
 lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
 TEXT

Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
  See below:        1  2 3 4 5 6        7

${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20             corner_radius
2 = 0             x_position
3 = 0             y_position
3 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

######### calendar function ##################################################

then to use it, you activate the calendar function BELOW TEXT like this

${lua luacal {settings}}

#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
#    x=x position top left
#    y=y position top left
#    tf=title font, eg "mono" must be in quotes
#    tfs=title font size
#    tc=title color
#    ta=title alpha
#    bf=body font, eg "mono" must be in quotes
#    bfs=body font size
#    bc=body color
#    ba=body alpha
#    hf=highlight font, eg "mono" must be in quotes
#    hfs=highlight font size
#    hc=highlight color
#    ha=highlight alpha
#    sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts

#    gt=gap from title to body
#    gh=gap horizontal between columns
#    gv=gap vertical between rows
#    sd=start day, 0=Sun, 1=Mon

#    hstyle = heading style, 0=just days, 1=date insert
#    tdf=title date font, eg "mono" must be in quotes
#    tdfs=title date font size
#    tdc=title date color
#    tda=title date alpha

# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}


]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf        or "mono"
local tfontsize=caltab.tfs    or 12
local tc=caltab.tc        or 0xffffff
local ta=caltab.ta        or 1
local bfont=caltab.bf        or "mono"
local bfontsize=caltab.bfs    or 12
local bc=caltab.bc        or 0xffffff
local ba=caltab.ba        or 1
local hfont=caltab.hf        or "mono"
local hfontsize=caltab.hfs    or 12
local hc=caltab.hc        or 0xff0000
local ha=caltab.ha        or 1
local spacer=caltab.sp        or " "
local gaph=caltab.gh        or 20
local gapt=caltab.gt        or 15
local gapl=caltab.gv        or 15
local sday=caltab.sd        or 0
local hstyle=caltab.hstyle    or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
    if i<=start_day then
    dnum[i]="  "
    else
    dn=i-start_day
        if dn=="nil" then dn=0 end
        if dn<=9 then dn=(spacer .. dn) end
        if i>x then dn="" end
        dnum[i]=dn
        dnumh[i]=dn
        if dn==(spacer .. today) or dn==today then
        dnum[i]=""
        end
        if dn==(spacer .. today) or dn==today then
        dnumh[i]=dn
        place=i
        else dnumh[i]="  "
        end
    end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
    if tonumber(sday)==0 then
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    else
    dys={"MO","TU","WE","TH","FR","SA","SU"}
    end
    --draw calendar titles
elseif hstyle==1 then
    if tonumber(sday)==0 then
    dys={"SU","MO"," ","  ","  ","FR","SA"}
    cairo_text_extents(cr,"MO",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    else
    dys={"MO","TU"," ","  ","  ","SA","SU"}
    cairo_text_extents(cr,"TU",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function#######################################################

Fonts required:

  1. monofur

  2. Zekton

  3. Anonymous Pro

  4. digitalk

Any questions, just ask.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#815 2012-11-19 02:45:11

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: weather in conky (LUA scripts) updated 12/26/13!

Thanks for the quick reply. Being from Windows for 20 some yrs. I can pretty much find and do what I need. Linux is a different animal.
Even the basic things have me pulling my hair. If I don't figure this out I'll be back in a month.

Rusty

Offline

#816 2012-11-19 02:54:58

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

rusty_jones wrote:

Thanks for the quick reply. Being from Windows for 20 some yrs. I can pretty much find and do what I need. Linux is a different animal.
Even the basic things have me pulling my hair. If I don't figure this out I'll be back in a month.

Rusty

We've all been there.  You'll be flyin' before you know it.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#817 2012-11-19 03:18:46

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

lionhead wrote:

@mrpeachy

a rewrite of v9000? this sounds good smile please add more 'text-features'. it would be nice if it would be possible to use bold text!!!

you should know enough about lua to edit the out function in v9000 to allow bold type smile

anyway, a mini update is planned soon with an enhanced text out function
ill also put the code for location swapping into v9000 itself.  It will still run any existing setup as before

Offline

#818 2012-11-19 11:24:50

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: weather in conky (LUA scripts) updated 12/26/13!

i really hope that i can use the new features with my pixel-font smile it would be cool if i could display the wlan-section as italic text!

here is my actual screenshot:

vZ2Q2MA

Last edited by lionhead (2012-11-19 11:28:50)

Offline

#819 2012-11-23 04:28:23

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: weather in conky (LUA scripts) updated 12/26/13!

Offline

#820 2012-11-23 04:36:44

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: weather in conky (LUA scripts) updated 12/26/13!

I forgot the template

--[[
 The latest script is a lua only weather script. aka: v9000
 http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/

 the file:
http://dl.dropbox.com/u/19008369/v9000.tar.gz

 mrppeachys LUA Tutorial
 http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Anonymous Pro:bold"--font must be in quotes
default_font_size=11
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
out({c=0x00BFFF,a=1,x=10,y=15,txt=now["date"].." "..now["month_short"].." "..now["year"]..": Fetched @ "..now["time"]})
image({x=20,y=20,h=40,w=40,file=now["weather_icon"]})
-- Temp / FeelsLike & CONDITIONS TEXT
out({c=0x48D1CC,a=1,f="Digital-7",fs=50,x=80,y=60,txt=now["temp"]})
out({c=0x00BFFF,a=1,f="Digital-7",fs=50,x=140,y=60,txt=now["feels_like"]})
out({c=0xA4FFA4,a=1,x=81,y=72,txt="Temp          WC · HI"})

out({c=0x48D1CC,a=1,f="Zekton",fs=18,x=10,y=94,txt=now["conditions"]})

-- data titles
--    data output 
datay=110   -- y=datay or
datayy=15   -- y=datay+(datayy*1) use 1 or more

out({c=0xFAFAEC,a=1,x=10,y=datay,txt="Wind Chill:"})
   out({c=0x48D1CC,a=1,x=70,y=datay,txt=now["wind_chill"].."°"})
out({c=0xFAFAEC,a=1,x=100,y=datay,txt="Heat Index:"})
   out({c=0xFF8C00,a=1,x=165,y=datay,txt=now["heat_index"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*1),txt="Today's Hi·Lo:"})
   out({c=0xFF8C00,a=1,x=100,y=datay+(datayy*1),txt=high_temp[1].."°"})
   out({c=0x48D1CC,a=1,x=140,y=datay+(datayy*1),txt=low_temp[1].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*2),txt="Wind:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*2),txt=now["wind_km"]})
   out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*2),txt=now["wind_nesw"]})
   out({c=0xFAFAEC,a=1,x=140,y=datay+(datayy*2),txt="@"})
   out({c=0x48D1CC,a=1,x=165,y=datay+(datayy*2),txt=now["wind_deg"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*3),txt="Hum:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*3),txt=now["humidity"].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*3),txt="DP:"})
   out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*3),txt=now["dew_point"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*4),txt="Bar:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*4),txt=now["pressure_mb"]})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*4),txt="Vis:"})
   out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*4),txt=now["visibility"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*5),txt="Ceil:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*5),txt=now["ceiling"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*6),txt="Precip:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*6),txt=precipitation[1].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*6),txt="Cloud:"})
   out({c=0x48D1CC,a=1,x=150,y=datay+(datayy*6),txt=cloud_cover[1].."%"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*7),txt="UV:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*7),txt=uv_index_num[1]})
   out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*7),txt=uv_index_txt[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*8),txt="Sun:"})
   out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*8),txt=sun_rise_lc[1]})
   out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*8),txt=sun_set_lc[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*9),txt="Moon:"})
   out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*9),txt=moon_rise_lc[1]})
   out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*9),txt=moon_set_lc[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*10),txt="Phase:"})
   out({c=0x48D1CC,a=1,x=55,y=datay+(datayy*10),txt=moon_phase[1]})

-- line
image({x=205,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})
-- 3 hour output
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=15,txt="Next 3"})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=30,txt="Hours"})
-- 1st hour
out({c=0xA4FFA4,x=220,y=50,txt=now["fc_hour1_time"].."  "..now["fc_hour1_ampm"]})
image({w=30,h=30,x=223,y=55,file=now["fc_hour1_wicon"]}) -- image({w=30,h=30,x=223,y=55,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=100,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0xA4FFA4,x=220,y=datay+(datayy*1),txt=now["fc_hour2_time"].."  "..now["fc_hour2_ampm"]})
image({w=30,h=30,x=223,y=130,file=now["fc_hour2_wicon"]}) -- image({w=30,h=30,x=223,y=130,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=180,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xA4FFA4,x=220,y=210,txt=now["fc_hour3_time"].."  "..now["fc_hour3_ampm"]})
image({w=30,h=30,x=223,y=215,file=now["fc_hour3_wicon"]}) -- image({w=30,h=30,x=223,y=215,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=datay+(datayy*10),txt=now["fc_hour3_temp"] .."°"})
-- line
image({x=275,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})

--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=5
topy=15
topyy=135 -- topy+(topyy*1)
topx=285
topxx=137.5
--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1]        =topx            ,topy
   top_left_x_coordinate[2],top_left_y_coordinate[2]     =topx ,150
top_left_x_coordinate[3],top_left_y_coordinate[3]        =10  ,290
   top_left_x_coordinate[4],top_left_y_coordinate[4]     =10+(topxx*1) ,290
top_left_x_coordinate[5],top_left_y_coordinate[5]        =10+(topxx*2)  ,290
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
out({c=0xA4FFA4,a=1,x=tlx,y=tly,txt=forecast_day_short[i].."  "..forecast_date[i].."  "..forecast_month_short[i]})
image({x=tlx,y=tly+5,h=30,w=30,file=weather_icon[i]})
out({c=0xFF8C00,a=1,x=tlx+35,y=tly+15,txt=high_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx+35,y=tly+30,txt=low_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx,y=tly+50,txt=conditions_short[i]})

out({c=0xFAFAEC,a=1,x=tlx,y=tly+65,txt="P: "..precipitation[i].."%"})
   out({c=0xFAFAEC,a=1,x=tlx+50,y=tly+65,txt="UV: "..uv_index_num[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+80,txt="H: "..humidity[i].."%"})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+95,txt="S: "..sun_rise_lc[i]})
   out({c=0x48D1CC,a=1,x=tlx+73,y=tly+95,txt=sun_set_lc[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+110,txt="M: "..moon_rise_lc[i]})
   out({c=0x48D1CC,a=1,x=tlx+73,y=tly+110,txt=moon_set_lc[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################AAA

Offline

#821 2012-11-23 15:18:47

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

rusty_jones wrote:

I forgot the template

Hi Rusty, I've been bust with other things sorry I half abandoned you.

That template calls for three fonts: Anonymous Pro, Zekton and Digital-7

Digital-7 has stopped working for me with that name (the top gets cut off.) but this works: "Digital\-7"

In your text editor do a search for:

/home/sector11/

there are 5 of them related to images: two active (bold) lines and two commented out (bold / italics) delete them all or comment out the two active lines:

-- line
image({x=205,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})
-- 3 hour output
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=15,txt="Next 3"})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=30,txt="Hours"})
-- 1st hour
out({c=0xA4FFA4,x=220,y=50,txt=now["fc_hour1_time"].."  "..now["fc_hour1_ampm"]})
image({w=30,h=30,x=223,y=55,file=now["fc_hour1_wicon"]}) -- image({w=30,h=30,x=223,y=55,file="/home3/Conky/images/red-1.png"})
out({x=228,y=100,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0xA4FFA4,x=220,y=datay+(datayy*1),txt=now["fc_hour2_time"].."  "..now["fc_hour2_ampm"]})
image({w=30,h=30,x=223,y=130,file=now["fc_hour2_wicon"]}) -- image({w=30,h=30,x=223,y=130,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=180,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xA4FFA4,x=220,y=210,txt=now["fc_hour3_time"].."  "..now["fc_hour3_ampm"]})
image({w=30,h=30,x=223,y=215,file=now["fc_hour3_wicon"]}) -- image({w=30,h=30,x=223,y=215,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=datay+(datayy*10),txt=now["fc_hour3_temp"] .."°"})
-- line
image({x=275,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})

what happens now when you run the conky?

Last edited by Sector11 (2012-11-23 15:19:31)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#822 2012-11-23 15:34:45

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

OK you want the extended forecasts for that so it would be:

http://www.intellicast.com/Local/Forecast.aspx?location=USPA0311

You need that in the hidden file: /home/YOUR_USERNAME/.v9000_config.lua

the line that starts with:

local web=

Change it to:

local web="http://www.intellicast.com/Local/Forecast.aspx?location=USPA0311" --insert unit=C& after? for C

my line to show the Celsius Degrees if you want that:

local web="http://www.intellicast.com/Local/Forecast.aspx?unit=C&location=ARBA0009"--insert unit=C& after? for C

Next change change "benjamin" to what your user name is, mine is below for an example only:

--set location of weather images (replace "benjamin" with your own username)
local weathericons="/home/sector11/v9000/additional_files/weathericons/"
--short conditions setup

Also in /home/YOUR_USERNAME/v9000/v9000.lua

local username = os.getenv("USERNAME")
--you can enter your username here in case of errors,
--enter username in quotes like this username = "yourname"
local username = "sector11"
package.path = '/home/'..username..'/.v9000_config.lua'
require '.v9000_config'

Check that and put your "username " where you see "sector11" if you need to.
I don't need to but did it anyway.

Hope that helps.

Last edited by Sector11 (2012-11-23 15:35:05)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#823 2012-11-23 16:37:47

rusty_jones
#! Member
Registered: 2011-05-05
Posts: 57

Re: weather in conky (LUA scripts) updated 12/26/13!

I've already done that.  when I start the script it only works to the precip line. Mrpeachy had me post the weather url to see if was correct and the template so he could check itt out.

Offline

#824 2012-11-23 19:00:13

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,821
Website

Re: weather in conky (LUA scripts) updated 12/26/13!

rusty_jones wrote:

I've already done that.  when I start the script it only works to the precip line. Mrpeachy had me post the weather url to see if was correct and the template so he could check itt out.

Oh ok, sorry.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

Be excellent to each other!

#825 2012-11-23 20:50:28

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: weather in conky (LUA scripts) updated 12/26/13!

^sector11 is right
if the link you posted here http://crunchbang.org/forums/viewtopic. … 97#p273997
is the address in the config file, then it needs to be changed (it doesnt point to the extended forecast)
the link you need is this

Sector11 wrote:
http://www.intellicast.com/Local/Forecast.aspx?location=USPA0311

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo