SEARCH

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

You are not logged in.

#1 2011-11-16 17:37:44

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

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

UPDATED POST UPDATED POST UPDATED POST UPDATED POST

GET THE SCRIPT!
UPDATED!
A recent change to the intellicast website broke parts of the old script
here is an updated version that has taken into account the changes and added new functions
get the latest script and associated files here:
https://dl.dropboxusercontent.com/u/190 … ate.tar.gz
NOTE: if you already have v9000 setup and are looking to fix the current script, to get the update to work you need the new v9000.lua AND the new .v9000_config.lua.

open the archive with archive manager or similar and extract the files to your home/username directory

dont right click and choose "extract here", when i do this a folder called v9000 is created and the files are inside that folder instead f being put into /home/username directly

there is a readme text file inside the v9000 folder


INTRODUCTION
This thread covers the development and use of weather scripts to be used in conky
CURRENTLY the latest script is a lua only weather script aka v9000 smile

There are plenty of other weather scripts out there to use, most try to emulate the functionality of ConkyForecast.  A previous weather script (v6), discussed also in this thread, attempts this approach also.  But I was never happy with the performance of this script.

V9000 is much lighter on system resources, and has some nice features which the lua only method allows.
here are a couple of v9000 displays
nowplus8.jpg
screenshot-1302.png

However, I would not say that v9000 is aimed at the beginner although I believe it is no harder to learn to write the code v9000 requires as it is to learn how to write the code in a conkyrc or write setups using other weather scripts.  It is perhaps a little more daunting if you have little or no exposure to script writing.

If you are looking for conky weather that behaves more like the original ConkyForecast (all configured in the conkyrc for example),
then TeoBigusGeekus has just set up shop in the forum too
go here to take a look: http://crunchbanglinux.org/forums/topic … eathercom/
But if you want to the LUA way then read on!

HOWTO
i have written a how to in several parts regarding the operation of this script
PART 1 - Editing settings.  Set up conkyrc and available data option
http://crunchbang.org/forums/viewtopic. … 82#p177782

PART 2 - how to use the out() function
http://crunchbang.org/forums/viewtopic. … 83#p177783

PART 3 - how to use the image function
http://crunchbang.org/forums/viewtopic. … 85#p177785

PART 4 - how to use the forecast repeat
http://crunchbang.org/forums/viewtopic. … 87#p177787

PART 5 - setting up and using the short conditions option
http://crunchbang.org/forums/viewtopic. … 19#p178119

PART 6 - how to work with a seperate display script and main script
http://crunchbang.org/forums/viewtopic. … 02#p178402
NOTE - the most recent script now uses a separate main script and display script

PART 7 - how to use xout() function
http://crunchbang.org/forums/viewtopic. … 76#p179176

PART 8 - how to use the translate functions
http://crunchbang.org/forums/viewtopic. … 15#p181415

PART 9 - how to get your v9000 to work with a slow conky update_interval setting
http://crunchbang.org/forums/viewtopic. … 77#p186277
NOTE - the most recent script now has these steps implemented

PART 10 - how to display weather alerts
http://crunchbang.org/forums/viewtopic. … 08#p188508
NOTE: weather alerts are only available for US locations

this link is to a collection of weather conditions used by intellicast
http://crunchbang.org/forums/viewtopic. … 62#p191462

here is a link to the interactive weather thread
http://crunchbang.org/forums/viewtopic.php?id=18419

get falldown's setup here http://dl.dropbox.com/u/60081679/cyber- … ate.tar.gz
see what it does here http://youtu.be/54nZwEuaKA8

UPDATED POST UPDATED POST UPDATED POST UPDATED POST

Last edited by mrpeachy (2014-01-06 21:47:55)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-11-16 17:50: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!

this post will hold the translation tables for different languages

GERMAN:
con_short table

con_short={--start of table, put entries below in form eg: ["Thunderstorm"]="T.Strm",
["AM Clouds/PM Sun"]="vormittags bewölkt/nachmittags sonnig",
["AM Rain/Snow Showers"]="vormittags Regen-/Schneeschauer",
["AM Showers"]="vormittags Regenschauer",
["AM Snow Showers/Wind"]="vormittags Schneeschauer/windig",
["AM Fog/PM Sun"]="vormittags Nebel/nachmittags Sonne",
["AM Drizzle"]="vormittags Nieselregen",
["PM Light Rain"]="nachmittags leichter Regen",
-- ["PM Drizzle"]
-- ["Drizzle Late"]
-- ["Early Drizzle"]
["Broken Clouds"]="überwiegend bewölkt",
["Drizzle"]="Nieselregen",
["Few Clouds"]="leichte Bewölkung",
["Few Showers"]="wenig Regenschauer",
["Few Snow Showers"]="wenig Schneeschauer",
["Freezing Rain"]="überfrierender Regen",
["Freezing Drizzle"]="überfrierender Nieselregen",
["Partly Cloudy"]="teilweise bewölkt",
["Partly Cloudy/Wind"]="teilweise bewölkt/windig",
["Haze"]="schwül/neblig",
["Heavy Rain"]="starker Regen",
["Heavy Snow"]="starker Schneefall",
["Hot"]="sehr warm",
["Isolated Thunderstorms"]="vereinzelt Gewitter",
["Light Rain"]="leichter Regen",
["Light Rain Late"]="leichter Regen nachmittags",
["Light Rain/Wind"]="leichter Regen/windig",
["Light Snow"]="leichter Schneefall",
["Light Fog"]="leichter Nebel",
["Fog Late"]="dichter Nebel",
["Mixed Rain and Hail"]="verm. Regen und Hagel",
["Mixed Rain and Snow"]="verm. Regen und Schnee",
["Mixed Rain and Sleet"]="verm. Regen und Graupel",
["Mixed Precipitation"]="verschiedener Niederschlag",
["Moderate Fog"]="mäßig neblig",
["Moderate Rain"]="mäßiger Regen",
["Mostly Cloudy"]="meist bewölkt",
["Mostly Sunny"]="meist sonnig",
["Mostly Clear"]="meist klar",
["Rain/Snow"]="Schneeregen",
["Rain Showers"]="Regenschauer",
["Rain/Snow Showers"]="Regen-/Schneeschauer",
["Drifting Snow"]="Treibschnee",
["Scattered Thunderstorms"]="vereinzelt Gewitter",
["Scattered Clouds"]="gering bewölkt",
["Scattered Showers"]="vereinzelt leichter Regen",
["Snow Showers"]="Schneeschauer",
["Snow Showers Late"]="Schneeschauer nachmittags",
["Snow Flurries"]="Schneeaufwirbelung",
["Showers Early"]="leichter Regen",
["Clear"]="klar, heiter",
["Clear/Wind"]="klar/windig",
["Blustery"]="stürmisch",
["Cloudy"]="bewölkt",
["Overcast"]="zunehmend bedeckt",
["Showers"]="Schauer",
["Sprinkles"]="Sprühregen",
["Sunny"]="sonnig",
["Thunderstorm"]="Gewitter / Unwetter",
--["Thunderstorms/Wind"]="T.Storms/Wnd"
["Wind Early"]="früh oder am morgen windig",
["Wind"]="windig", 
}--this bracket closes the table

units

--NOTE ALSO EDIT THESE SETTINGS FOR TRANSLATION PURPOSES
local visibility_unit=" mi"
local wind_mph_unit=" mph"
local wind_km_unit=" km/h"
local wind_kts_unit=" kts"
local ceiling_unit=" ft"
local wind_degrees_unit="°"

other tables

--translate NESW text
neswtext={
S="S",
SSW="SSW",
SW="SW",
WSW="WSW",
W="W",
WNW="WNW",
NW="NW",
NNW="NNW",
N="N",
NNE="NNO",
NE="NO",
ENE="ONO",
E="O",
ESE="OSO",
SE="SO",
SSE="SSO",
}--end of  N E S W text table
--translate time suffix
tsuffix={
AM="AM",
PM="AM",
}--end of time suffix table
--enter translations for uv index text
uvindextext={
["Low"]="gering",
["Moderate"]="mittel",
["High"]="hoch",
["Very High"]="sehr hoch",--format is different because of the space in the text
["Extreme"]="extrem",
}--end of uv text table
--enter translations for moonpahse
moonphases={
["New"]="Neumond", -- Mond steht für uns unsichtbar am Taghimmel
["Waxing Crescent"]="zunehmende Sichel",  -- Mond ab Vormittag bis Abend zu sehen
["First Quarter"]="erstes Viertel (Halbmond)", -- Mond ist ab Mittags bis Mitternacht zu sehen
["Waxing Gibbous"]="zunehmender Mond", -- Mond ist ab Nachmittags bis nach Mitternacht zu sehen
["Full"]="Vollmond", -- Mond ist die ganze Nacht zu sehen
["Waning Gibbous"]="abnehmender Mond", -- Mond ist von vor Mitternacht bis zum Vormittag zu sehen
["Last Quarter"]="letztes Viertel (Halbmond)", -- Mond ist von Mitternacht bis zum Mittag zu sehen
["Waning Crescent"]="abnehmende Sichel", -- Mond ist vom Morgen bis Nachmittags zu sehen
}--end of moon phase table
--enter translations for FULL day names
daynames={
Monday="Montag",
Tuesday="Dienstag",
Wednesday="Mittwoch",
Thursday="Donnerstag",
Friday="Freitag",
Saturday="Samstag",
Sunday="Sonntag",
}--end day names table
--enter translations for SHORT day names
dayshort={
Monday="Mo",
Tuesday="Di",
Wednesday="Mi",
Thursday="Do",
Friday="Fr",
Saturday="Sa",
Sunday="So"
}--end short day names table
--enter translation for FULL month names
monthnames={
January="Januar",
February="Februar",
March="März",
April="April",
May="Mai",
June="Juni",
July="Juli",
August="August",
September="September",
October="Oktober",
November="November",
December="Dezember"
}--end of month name translations
--enter translations for SHORT month names
monthshort={
January="Jan",
February="Feb",
March="März",
April="April",
May="Mai",
June="Juni",
July="Juli",
August="Aug",
September="Sep",
October="Okt",
November="Nov",
December="Dez"
}--end of short month name translations
--enter some additional translations
additional={
NA="t_NA",
Unl="t_Unl"--for ceiling data option
}--end of additional translations
--END OF TRANSLATION TABLES

Last edited by mrpeachy (2012-10-20 19:22:44)

Offline

#3 2011-11-16 19:29:09

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

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

another update
now supports ConkyWeather font
Screenshot_2.jpg

lua
http://crunchbanglinux.org/pastebin/1307

example of how to use the font in conkyrc

${lua weather day1.day}
Conditions: ${lua weather day1.con}${font ConkyWeather:size=30}${goto 170}${lua_parse weather font.day1}${font}
${voffset -30}High: ${lua weather day1.hih} F
Low: ${lua weather day1.low} F
${lua_parse weather image.day1 80 130 50 50}

Last edited by mrpeachy (2011-11-16 19:57:56)

Offline

#4 2011-11-16 19:47:49

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

Count me in as a regular!

And I have a hic-cup too, the latest thermometer.conky (thermometer.lua v4) stopped working for me today.  I changed nothing - v3 still works.

1680f7159676029.jpg

thermometer_v4.conky

# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c ~/Conky/thermometer_v4.conky &

 ###  Begin Window Settings  ##################################################
 # Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal #override
own_window_transparent yes
own_window_hints sticky,skip_pager
own_window_argb_visual yes
# own_window_argb_value 255
# own_window_colour brown
own_window_class Conky
own_window_title MrP's Thermometer v4

 # 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 override'
# own_window_argb_visual yes

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

minimum_size 640 500     ## width, height
maximum_width 640       ## width, usually a good idea to equal minimum width

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

### top_left, top_right, top_middle, bottom_left, bottom_right, bottom_middle
### middle_left, middle_middle, middle_right, or none
alignment middle_left
 ####################################################  End Window Settings  ###
 ###  Font Settings  ##########################################################
 # Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont dejavu sans mono:size=8
 # Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
 # 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 grey
default_outline_color black

default_color DCDCDC #Gainsboro
color0 DAA520 #Goldenrod  FFFFF0 #Ivory
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
 #####################################################  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
 #####################################################  End Borders Secton  ###
 ###  Miscellaneous Section  ##################################################

 # Boolean value, if true, Conky will be forked to background when started.
background no

 # 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 1028

 # 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

 ##############################################  End Miscellaneous Section  ###
 ###  LUA Settings  ###########################################################
lua_load ~/Conky/LUA/thermometer_v4.lua
 #######################################################  End LUA Settings  ###

 # The all important - How often conky refreshes.
 # If you have a "Crey" try: 0.2 - smokin' - but watch the CPU usage go UP!
update_interval 1



TEXT
${lua conky_draw_bg 10 0 0 650 510 0x000000 0.5}
${lua conky_weather}${voffset 240}${goto 10}${font digitalk:size=18}${time %T}${font}

thermometer_v4.lua

--[[weather display by mrpeachy nov 2011
version 4
-cleaned up a bit
-temp scale changing
-set mid point temp for color change
-added forecast display
-added wind speed guage
-added hi lo thermometers
]]
--#########################################################################################################
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
secs=300--set update interval
web="http://www.intellicast.com/Local/Forecast.aspx?unit=C&location=ARBA0009"--insert unit=C& after? for C
--get web address by going to the intellicast site and entering your location in the box
--for version 3 you must get click on "Extended Forecast" to get the necessary address
units="C"--set units for C or F
mid=24--this is the temp at which temp scale is yellow, ie mid point in color change scale
--#########################################################################################################

require 'cairo'
------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------

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}'))
if updates>5 then
local timer=(updates %secs)+1
if timer==1 or updates==6 then
local f=io.popen("curl '"..web.."' | grep -A62 'As of ' | gawk -F'>' -v RS='</' 'RT{print $NF}' | sed -e 's/^[ \t]*//' -e '/^$/d' -e 's/&deg;//g' -e 's/%//g' -e 's/  / /g' -e 's/Thunderstorms/T.Storms/g'")
local data1=f:read("*a")
f:close()
local data2=string.split(data1,"\n")
local data={}
for i,v in pairs(data2) do
if string.find(v,"[%a%d]")~=nil then
table.insert(data,data2[i])
end
end
--##############################################
--current
local wdr=string.split(data[25]," ")
now={con=string.gsub(data[2],"[\r\n]",""),tmp=string.gsub(data[4],units,""),flk=string.gsub(data[5],"Feels Like: ",""),wch=data[7],cel=data[10],hid=data[12],vis=string.gsub(data[15],"[ %a]",""),dpt=data[17],wsp=string.gsub(data[20],"[ %a]",""),wdg=(wdr[1]),wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),wgs=string.gsub(data[30],"[ %a]",""),hum=data[22],prs=string.gsub(data[27],"\"","")}
--############################################
--forecast
local f=io.popen("curl '"..web.."' | grep -A554 'View the Calendar Forecast' | gawk -F'>' -v RS='<' 'RT{print $NF}' | sed -e 's/^[ \t]*//' -e 's/&deg;//g' -e 's/  / /g' -e 's/%//g' -e 's/&deg//g' -e 's/Thunderstorms/T.Storms/g'")
local fdata1=f:read("*a")
f:close()
local fdata=string.split(fdata1,"\n")
local fdata2={}
for i,v in pairs(fdata) do
if string.find(v,"[%a%d]")~=nil then
table.insert(fdata2,fdata[i])
end
end
local uvi=string.split(fdata2[20]," ")
local wsp=string.split(fdata2[32]," ")
local wdr=string.split(fdata2[34]," ")
day1={day=fdata2[2],con=fdata2[3],hih=fdata2[4],low=fdata2[5],sri=fdata2[8],sst=fdata2[10],mri=fdata2[12],mst=fdata2[14],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[22],ppt=fdata2[24],snw=fdata2[26],cld=fdata2[28],mph=fdata2[30],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day2
local uvi=string.split(fdata2[53]," ")
local wsp=string.split(fdata2[65]," ")
local wdr=string.split(fdata2[67]," ")
day2={day=fdata2[35],con=fdata2[36],hih=fdata2[37],low=fdata2[38],sri=fdata2[41],sst=fdata2[43],mri=fdata2[45],mst=fdata2[47],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[55],ppt=fdata2[57],snw=fdata2[59],cld=fdata2[61],mph=fdata2[63],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day3
local start=68
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day3={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day4
local start=start+29
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day4={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day5
local start=start+29
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day5={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day6
local start=start+29
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day6={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day7
local start=start+29
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day7={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=wmh,wkm=wkm,wkt=wkt,wdg=wdg,wdi=wdi}
--day8
local start=start+29
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day8={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day9
local start=start+29
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day9={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
--day10
local start=start+29
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day10={day=fdata2[start],con=fdata2[start+1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]","")}
end--timer section
display(now,day1,day2,day3,day4,day5,day6,day7,day8,day9,day10)
--################################################################3
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function display(now,day1,day2,day3,day4,day5,day6,day7,day8,day9,day10)
--print (now.con,now.tmp,now.flk,now.wch,now.cel,now.hid,now.vis,now.dpt,now.wsp,now.wdg,now.wgi,now.wgs,now.hum,now.prs)
--[[
--forecast information, 10 day, options
--use like this  dayX.option (where X=day number (1=today,2=tomorrow))
--eg day1.day
day=forecast day and date
con=conditions summary
hih=high temp
low=low temp
sri=sunrise
sst=sunset
mri=moon rise
mst=moon set
uvi=ultraviolet index
hum=humidity
ppt=chance of precipitation
snw=chance of snow
cld=cloud cover
mph=moon phase
wmh=wind speed in mph
wkm=wind speed in km/h
wkt=wind speed in knots
wdg=wind direction in degrees
wdi=wind direction in nesw
]]
--#####################################
--setup text type and color
local font="Mono"
local fsize=10
local red,green,blue,alpha=1,1,1,1
local xpos=430
local ypos=30--first line
local gap1=fsize+2
---------------------------
text=day1.day;txt(text,xpos,ypos,font,14,red,green,blue,alpha)
text="    Conditions: "..day1.con;gap=gap1+4;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="     High Temp: "..day1.hih.."°"..units;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Low Temp: "..day1.low.."°"..units;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Sun Rise: "..day1.sri;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="       Sun Set: "..day1.sst;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="     Moon Rise: "..day1.mri;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Moon Set: "..day1.mst;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="    Moon Phase: "..day1.mph;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      UV Index: "..day1.uvn.." ("..day1.uvt..")";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Humidity: "..day1.hum.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="Chance of Rain: "..day1.ppt.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="Chance of Snow: "..day1.snw.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="   Cloud Cover: "..day1.cld.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="    Wind Speed: "..day1.wmh.."mph";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="Wind Direction: "..day1.wdg.."° ("..day1.wdi..")";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
ypos=240--first line
gap1=fsize+2
gap=0
text=day2.day;txt(text,xpos,ypos,font,14,red,green,blue,alpha)
text="    Conditions: "..day2.con;gap=gap1+4;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="     High Temp: "..day2.hih.."°"..units;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Low Temp: "..day2.low.."°"..units;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Sun Rise: "..day2.sri;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="       Sun Set: "..day2.sst;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="     Moon Rise: "..day2.mri;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Moon Set: "..day2.mst;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="    Moon Phase: "..day2.mph;gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      UV Index: "..day2.uvn.." ("..day1.uvt..")";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="      Humidity: "..day2.hum.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="Chance of Rain: "..day2.ppt.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="Chance of Snow: "..day2.snw.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="   Cloud Cover: "..day2.cld.."%";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="    Wind Speed: "..day2.wmh.."mph";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
text="Wind Direction: "..day2.wdg.."° ("..day2.wdi..")";gap=gap+gap1;txt(text,xpos,ypos+gap,font,fsize,red,green,blue,alpha)
--#####################################
--thermometers for current temps
--thermometer
local scale=1--1=full size, 0.5=half size, 2=double size
local x=35.5
local y=200.5
local temp=tonumber(now.tmp)
local label="Current Temperature"
thermometer (x,y,temp,label,scale,mid,units)
--thermometer
local scale=0.75
local x=x+70
local y=155.5
local temp=tonumber(now.flk)
local label="Feels Like Temp"
thermometer (x,y,temp,label,scale,mid,units)
--thermometer
local scale=0.75
local x=x+60
local y=y
local temp=tonumber(now.wch)
local label="Wind Chill Temp"
thermometer (x,y,temp,label,scale,mid,units)
--thermometer
local scale=0.75
local x=x+60
local y=y
local temp=tonumber(now.hid)
local label="Heat Index Temp"
thermometer (x,y,temp,label,scale,mid,units)
--thermometer
local scale=0.75
local x=x+60
local y=y
local temp=tonumber(now.dpt)
local label="Dew Point Temp"
thermometer (x,y,temp,label,scale,mid,units)
--#############################################
--hi/lo thermometers for forecast days
--thermometer day1 high
local scale=0.4
local x=628
local y=30+95
local temp=tonumber(day1.hih)
local label="none"
thermometer (x,y,temp,label,scale,mid,units)
text="HI";txt(text,x-22,y-20,"Mono",12,1,1,1,1)
--thermometer day1 low
local scale=0.4
local x=x
local y=y+90
local temp=tonumber(day1.low)
local label="none"
thermometer (x,y,temp,label,scale,mid,units)
text="LO";txt(text,x-22,y-20,"Mono",12,1,1,1,1)
--thermometer day2 high
local scale=0.4
local x=x
local y=240+95
local temp=tonumber(day2.hih)
local label="none"
thermometer (x,y,temp,label,scale,mid,units)
text="HI";txt(text,x-22,y-20,"Mono",12,1,1,1,1)
--thermometer day2 low
local scale=0.4
local x=x
local y=y+90
local temp=tonumber(day2.low)
local label="none"
thermometer (x,y,temp,label,scale,mid,units)
text="LO";txt(text,x-22,y-20,"Mono",12,1,1,1,1)
--#############################################
--wind direction compass
compass(170,245,50,tonumber(now.wdg),now.wsp,now.wgs)
--windspeed dial
wspeed_dial(now.wsp,325,300)
--################################################################3
--pressure barometer
barometer(tonumber(now.prs),130,395)
--#########################################
--humidity bar
humidity(340.5,20.5,tonumber(now.hum))
--#########################################
--current conditions display
text="Currently:";txt(text,250,450,"Mono",12,1,1,1,1)
text=now.con;txt(text,250,470,"Mono",22,1,1,1,1)
text="Visibility: "..now.vis.." miles, Ceiling: "..now.cel;txt(text,250,490,"Mono",10,1,1,1,1)
end--display
--#############################################################################################################################################################
function wspeed_dial(ws,px,py)
--0 to 60 mph
--draw circle
cairo_set_line_width (cr,1)
local router=110
cairo_set_source_rgba (cr,0.1,0.1,0.1,1)
cairo_arc (cr,px,py,router,(math.pi/180),0)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_arc (cr,px,py,router,(math.pi/180),0)
cairo_stroke (cr)
-------------------------------------------
--mph scale
local rout1=80
local rin1=rout1-10
for i=0,60 do
if i==5 or i==15 or i==25 or i==35 or i==45 then
rin=rin1--set line length for 5s
cairo_set_line_width (cr,1)
elseif i==0 or i==10 or i==20 or i==30 or i==40 or i==50 or i==60 then
rin=rin1+7--set line length for 10's
cairo_set_line_width (cr,3)
else
rin=rin1+5--set other lines
cairo_set_line_width (cr,1)
end--if i==
arc=(math.pi/180)*(210+(i*(300/60)))
ppx=0+rout1*(math.sin(arc))
ppy=0-rout1*(math.cos(arc))
arc=(math.pi/180)*(210+(i*300/60))
pix=0+rin*(math.sin(arc))
piy=0-rin*(math.cos(arc))
cairo_move_to (cr,px+ppx,py+ppy)
cairo_line_to (cr,px+pix,py+piy)
cairo_stroke (cr)
end--for i=
--mph reading
mph={0,10,20,30,40,50,60}
local rin=rin1-2
for i=1,#mph do
arc=(math.pi/180)*(210+((i-1)*(300/6)))
ppx=0+rin*(math.sin(arc))
ppy=0-rin*(math.cos(arc))
text=mph[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
width=extents.width
height=extents.height
cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end--for i= print inches
--kmh lines and numbers
--60kmh=96.5606
cairo_set_line_width (cr,1)
local m1=300/96.5606
local rout2=60
local rin2=rout2-5
local num=95
--print lines---------------
for i=0,num do
if i==0 or i==10 or i==20 or i==30 or i==40 or i==50 or i==60 or i==70 or i==80 or i==90 then
rin=rin2-5--set length for 10s
elseif i==5 or i==15 or i==25 or i==35 or i==45 or i==55 or i==65 or 1==75 or i==85 or i==95 then
rin=rin2-2--set length for 5's
else
rin=rin2
end--if i=
---------------------------------------------------
arc=(math.pi/180)*(210+(i*m1))
ppx=0+rout2*(math.sin(arc))
ppy=0-rout2*(math.cos(arc))
arc=(math.pi/180)*(210+(i*m1))
pix=0+rin*(math.sin(arc))
piy=0-rin*(math.cos(arc))
cairo_move_to (cr,px+ppx,py+ppy)
cairo_line_to (cr,px+pix,py+piy)
cairo_stroke (cr)
end--for i --line drawing
--kmh reading
kmh={0,10,20,30,40,50,60,70,80,90}
local rout=rin2-18
for i=1,#kmh do
arc=(math.pi/180)*(210+((i-1)*(m1*10)))
ppx=0+rout*(math.sin(arc))
ppy=0-rout*(math.cos(arc))
text=kmh[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
width=extents.width
height=extents.height
cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end--kmh lines and numbers
--knots
--60kmh=52.1386
cairo_set_line_width (cr,1)
local m1=300/52.1386
local rout3=90
local rin3=rout3-5
local num=50
--print lines---------------
for i=0,num do
if i==0 or i==10 or i==20 or i==30 or i==40 or i==50 then
rout=rout3-1--set length for 10s
cairo_set_line_width (cr,3)
elseif i==5 or i==15 or i==25 or i==35 or i==45 then
rout=rout3+4--set length for 5's
cairo_set_line_width (cr,1)
else
rout=rout3
cairo_set_line_width (cr,1)
end--if i=
---------------------------------------------------
arc=(math.pi/180)*(210+(i*m1))
ppx=0+rout*(math.sin(arc))
ppy=0-rout*(math.cos(arc))
arc=(math.pi/180)*(210+(i*m1))
pix=0+rin3*(math.sin(arc))
piy=0-rin3*(math.cos(arc))
cairo_move_to (cr,px+pix,py+piy)
cairo_line_to (cr,px+ppx,py+ppy)
cairo_stroke (cr)
end--for i --line drawing
--kmh reading
knot={0,10,20,30,40,50}
local rout=rin3+15
for i=1,#kmh do
arc=(math.pi/180)*(210+((i-1)*(m1*10)))
ppx=0+rout*(math.sin(arc))
ppy=0-rout*(math.cos(arc))
text=knot[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
width=extents.width
height=extents.height
cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end
--scale labels
local text="mph"
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,px-(width/2),py+rin1)
cairo_show_text (cr,text)
cairo_stroke (cr)
local text="kmh"
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,px-(width/2),py+rin2)
cairo_show_text (cr,text)
cairo_stroke (cr)
local text="knots"
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,px-(width/2),py+rin3)
cairo_show_text (cr,text)
cairo_stroke (cr)
local text="Wind Speed"
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,px-(width/2),py+rin3+16)
cairo_show_text (cr,text)
cairo_stroke (cr)
--pointer
if ws==nil then ws=0 end
local wspd=ws
local m1=300/60
local m2=wspd*m1
local rout1=rout3
local arc=(math.pi/180)*(210+m2)
local ppx=0+rout1*(math.sin(arc))
local ppy=0-rout1*(math.cos(arc))
------------------------------
local arc=(math.pi/180)*(210+m2+180)
local ppox=0+rout1*(math.sin(arc))
local ppoy=0-rout1*(math.cos(arc))
-------------------------------
local rin3=7
local arc=(math.pi/180)*(210+m2-90)
local pilx=0+rin3*(math.sin(arc))
local pily=0-rin3*(math.cos(arc))
local arc=(math.pi/180)*(210+m2+90)
local pirx=0+rin3*(math.sin(arc))
local piry=0-rin3*(math.cos(arc))
--------------------------------
cairo_move_to (cr,px+pilx,py+pily)
cairo_line_to (cr,px+ppx,py+ppy)
cairo_line_to (cr,px+pirx,py+piry)
cairo_line_to (cr,px+pilx,py+pily)
cairo_set_source_rgba (cr,1,0,0,1)
cairo_fill (cr)
cairo_arc (cr,px,py,rin3,(math.pi/180),0)
cairo_fill (cr)
---------------------------------
cairo_move_to (cr,px+pilx,py+pily)
cairo_line_to (cr,px+ppox,py+ppoy)
cairo_line_to (cr,px+pirx,py+piry)
cairo_line_to (cr,px+pilx,py+pily)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,0,0,1)
cairo_arc (cr,px,py,rin3,(math.pi/180),0)
cairo_fill (cr)
-----------------------------------
cairo_set_source_rgba (cr,0,0,0,1)
cairo_arc (cr,px,py,rin3-1,(math.pi/180),0)
cairo_fill (cr)
end--wspeed dial function
--#############################################################################################################################################################
function circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,1,1,1,1);
local inum=string.len(text)
local deg=(finish-start)/(inum-1)
local degrads=(math.pi/180)
local textcut=string.gsub(text, ".", "%1|")
texttable=string.split(textcut, "|")
for i=1,inum do
interval=(degrads*(start+(deg*(i-1))))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval)
end
end--circlewriting
--#############################################################################################################################################################
--#############################################################################################################################################################
function humidity(x,y,hval1)
hval=hval1*1.5
yt=y-1
rh=151
rw=30
local pat = cairo_pattern_create_linear (0,yt,0,yt+rh);
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 1, 0);
cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 1, 1);
cairo_rectangle (cr,x,yt,rw, rh);
cairo_set_source (cr, pat);
cairo_fill (cr);
cairo_pattern_destroy (pat);
----------
for i=1,11 do
lwid=-1
cairo_set_source_rgba (cr,1,1,1,1)
cairo_move_to (cr,x+rw,(y+150)-((i-1)*15))
cairo_rel_line_to (cr,lwid,0)
cairo_stroke(cr)
end
----------
cairo_set_source_rgba (cr,1,1,1,1)
hh=5
hw1=19
hw2=hw1+10
if hval==nil then hval=0 end
tx,ty=x+hw1,(y+150)-(hval+hh)
ix,iy=x+hw2,(y+150)-hval
bx,by=x+hw1,(y+150)-(hval-hh)
cairo_move_to (cr,tx,ty)
cairo_line_to (cr,ix,iy)
cairo_line_to (cr,bx,by)
cairo_line_to (cr,tx,ty)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,1,1,1)
font="Mono"
fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_move_to (cr,x+hw2+3,(y+150)-(hval-hh))
cairo_show_text (cr,hval1.."%")
cairo_stroke (cr)
label="Relative Humidity"
cairo_move_to (cr,x+12,y+150)
cairo_rotate (cr,(math.pi/180)*(-90))
cairo_show_text (cr,label)
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(90))
end--humidity
--#############################################################################################################################################################
--#############################################################################################################################################################
function txt(text,xpos,ypos,font,fsize,red,green,blue,alpha)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,red,green,blue,alpha)
cairo_move_to (cr,xpos,ypos)
cairo_show_text (cr,text)
cairo_stroke (cr)
end--function txt
--#############################################################################################################################################################
--#############################################################################################################################################################
function barometer(pr,px,py)
--baromeer 27 inches to 32 inches = 5 inches
cairo_set_line_width (cr,1)
local router=100
cairo_set_source_rgba (cr,0.1,0.1,0.1,1)
cairo_arc (cr,px,py,router,(math.pi/180),0)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_arc (cr,px,py,router,(math.pi/180),0)
cairo_stroke (cr)
local rout1=75
local rin1=rout1-10
for i=0,40 do
if i==5 or i==15 or i==25 or i==35 then
rout=rout1-7
cairo_set_line_width (cr,3)
elseif i==0 or i==10 or i==20 or i==30 or i==40 then
rout=rout1
cairo_set_line_width (cr,1)
else
rout=rout1-5
cairo_set_line_width (cr,1)
end
arc=(math.pi/180)*(210+(i*(300/40)))
ppx=0+rout*(math.sin(arc))
ppy=0-rout*(math.cos(arc))
arc=(math.pi/180)*(210+(i*300/40))
pix=0+rin1*(math.sin(arc))
piy=0-rin1*(math.cos(arc))
cairo_move_to (cr,px+ppx,py+ppy)
cairo_line_to (cr,px+pix,py+piy)
cairo_stroke (cr)
end
--inches reading
inch={28,29,30,31}
local rout=rout1+2
for i=1,4 do
arc=(math.pi/180)*(210+(300/8)+((i-1)*(300/4)))
ppx=0+rout*(math.sin(arc))
ppy=0-rout*(math.cos(arc))
text=inch[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
width=extents.width
height=extents.height
cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end
--942 to 1056
--27.5=931.25
--31.5=1066.70
cairo_set_line_width (cr,1)
local m1=300/135.45
local m2=m1*8.75--931.25+8.75=940
local rout2=60
local rin2=rout2-5
local num=60
for i=0,num do
if i==0 or i==5 or i==10 or i==15 or i==20 or i==25 or i==30 or i==35 or i==40 or i==45 or i==50 or i==55 or i==60 or i==65 then
rin=rin2-5
else
rin=rin2
end
arc=(math.pi/180)*(210+m2+(i*((m1*(num*2))/num)))
ppx=0+rout2*(math.sin(arc))
ppy=0-rout2*(math.cos(arc))
arc=(math.pi/180)*(210+m2+(i*((m1*(num*2))/num)))
pix=0+rin*(math.sin(arc))
piy=0-rin*(math.cos(arc))
cairo_move_to (cr,px+ppx,py+ppy)
cairo_line_to (cr,px+pix,py+piy)
cairo_stroke (cr)
end
--millibars reading
inch={940,960,980,1000,1020,1040,1060}
local rout=rin2-18
for i=1,7 do
arc=(math.pi/180)*(210+m2+((i-1)*(m1*20)))
ppx=0+rout*(math.sin(arc))
ppy=0-rout*(math.cos(arc))
text=inch[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
width=extents.width
height=extents.height
cairo_move_to (cr,px+ppx-(width/2),py+ppy+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end
--scale labels
local text="inches hg"
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,px-(width/2),py+rin1)
cairo_show_text (cr,text)
cairo_stroke (cr)
local text="millibars"
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,px-(width/2),py+rin2-height)
cairo_show_text (cr,text)
cairo_stroke (cr)
local text="Pressure"
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,px-(width/2),py+rin2+35)
cairo_show_text (cr,text)
cairo_stroke (cr)
--pointer
if pr==nil then pr=27.5 end
local pres=pr-27.5
local m1=300/4
local m2=pres*m1
local rout1=rout1
local arc=(math.pi/180)*(210+m2)
local ppx=0+rout1*(math.sin(arc))
local ppy=0-rout1*(math.cos(arc))
------------------------------
local arc=(math.pi/180)*(210+m2+180)
local ppox=0+rout1*(math.sin(arc))
local ppoy=0-rout1*(math.cos(arc))
-------------------------------
local rin3=7
local arc=(math.pi/180)*(210+m2-90)
local pilx=0+rin3*(math.sin(arc))
local pily=0-rin3*(math.cos(arc))
local arc=(math.pi/180)*(210+m2+90)
local pirx=0+rin3*(math.sin(arc))
local piry=0-rin3*(math.cos(arc))
--------------------------------
cairo_move_to (cr,px+pilx,py+pily)
cairo_line_to (cr,px+ppx,py+ppy)
cairo_line_to (cr,px+pirx,py+piry)
cairo_line_to (cr,px+pilx,py+pily)
cairo_set_source_rgba (cr,1,0,0,1)
cairo_fill (cr)
cairo_arc (cr,px,py,rin3,(math.pi/180),0)
cairo_fill (cr)
---------------------------------
cairo_move_to (cr,px+pilx,py+pily)
cairo_line_to (cr,px+ppox,py+ppoy)
cairo_line_to (cr,px+pirx,py+piry)
cairo_line_to (cr,px+pilx,py+pily)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,0,0,1)
cairo_arc (cr,px,py,rin3,(math.pi/180),0)
cairo_fill (cr)
-----------------------------------
cairo_set_source_rgba (cr,0,0,0,1)
cairo_arc (cr,px,py,rin3-1,(math.pi/180),0)
cairo_fill (cr)
----text
local horiz=px
local verti=py
local radi=87
local text="STORMY"
local font="Mono"
local fsize=12
local start=250
local finish=start+((string.len(text))*5)
circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
local text="RAIN"
local start=300
local finish=start+((string.len(text))*5)
circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
local text="CHANGE"
local start=340
local finish=start+((string.len(text))*5)
circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
local text="FAIR"
local start=395
local finish=start+((string.len(text))*5)
circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
local text="VERY DRY"
local start=435
local finish=start+((string.len(text))*5)
circlewriting(text, font, fsize, radi, horiz, verti, start, finish)
end--barometer
--#############################################################################################################################################################
--#############################################################################################################################################################
function compass(wx,wy,rout,wdeg,w,wg)
local rin=rout-((rout/100)*10)
cairo_set_source_rgba (cr,0.1,0.1,0.1,1)
cairo_arc (cr,wx,wy,rout,(math.pi/180),0)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_arc (cr,wx,wy,rout,(math.pi/180),0)
cairo_stroke (cr)
for i=1,36 do
arc=(math.pi/180)*(i*10)
wpx=0+rout*(math.sin(arc))
wpy=0-rout*(math.cos(arc))
arc=(math.pi/180)*(i*10)
wix=0+rin*(math.sin(arc))
wiy=0-rin*(math.cos(arc))
cairo_move_to (cr,wx+wpx,wy+wpy)
cairo_line_to (cr,wx+wix,wy+wiy)
cairo_stroke (cr)
end
--print directions
local font="Mono"
local fsize=10
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
dirs={"N","NE","E","SE","S","SW","W","NW"}
local rdir=rout-((rout/100)*25)
for i=1,8 do
arc=(math.pi/180)*((i-1)*(360/8))
wdx=0+rdir*(math.sin(arc))
wdy=0-rdir*(math.cos(arc))
text=dirs[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
width=extents.width
height=extents.height
cairo_move_to (cr,wx+wdx-(width/2),wy+wdy+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end
--indicator
local npr=rout-((rout/100)*15)
if wdeg==nil then wdeg=0 end
local arc=(math.pi/180)*(wdeg)
local npx=0+npr*(math.sin(arc))
local npy=0-npr*(math.cos(arc))
cairo_move_to (cr,wx+npx,wy+npy)
local nprm=rout-((rout/100)*88)
local arc=(math.pi/180)*(wdeg+90)
local npmrx=0+nprm*(math.sin(arc))
local npmry=0-nprm*(math.cos(arc))
local arc=(math.pi/180)*(wdeg-90)
local npmlx=0+nprm*(math.sin(arc))
local npmly=0-nprm*(math.cos(arc))
cairo_line_to (cr,wx+npmrx,wy+npmry)
cairo_line_to (cr,wx+npmlx,wy+npmly)
cairo_line_to (cr,wx+npx,wy+npy)
cairo_set_source_rgba (cr,1,0,0,1)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,1,1,1)
---------------------------------
local arc=(math.pi/180)*(wdeg-180)
local spx=0+npr*(math.sin(arc))
local spy=0-npr*(math.cos(arc))
cairo_move_to (cr,wx+spx,wy+spy)
local sprm=nprm
local arc=(math.pi/180)*(wdeg+90-180)
local spmrx=0+sprm*(math.sin(arc))
local spmry=0-sprm*(math.cos(arc))
local arc=(math.pi/180)*(wdeg-90-180)
local spmlx=0+sprm*(math.sin(arc))
local spmly=0-sprm*(math.cos(arc))
cairo_line_to (cr,wx+spmrx,wy+spmry)
cairo_line_to (cr,wx+spmlx,wy+spmly)
cairo_line_to (cr,wx+spx,wy+spy)
cairo_fill (cr)
--------------------------------------
cairo_set_source_rgba (cr,0,0,0,1)
cairo_arc (cr,wx,wy,nprm,(math.pi/180),0)
cairo_fill (cr)
cairo_set_source_rgba (cr,1,0,0,1)
cairo_arc (cr,wx,wy,nprm,(math.pi/180),0)
cairo_stroke (cr)
------------------------
cairo_set_source_rgba (cr,1,1,1,1)
local text="Wind Direction"
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,wx-(width/2),wy-rout-5)
cairo_show_text (cr,text)
cairo_stroke (cr)
end--compass
--#############################################################################################################################################################
--#############################################################################################################################################################
function thermometer(mx,my,temp,label,scale,mid,units)
--by mrpeachy 2011
if scale==nil then scale=1 end
if units=="F" then height=150 elseif units=="C" then height=160 end
local mx=mx*(1/scale)
local my=my*(1/scale)
local font="Mono"
local fsize=10
cairo_scale (cr,scale,scale)
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,1)
--graphics outer
--bottom circle
r_outer=25
local lang_outer=335
local rang_outer=0+(360-lang_outer)
local h_outer=height-4--maybe make this a percentage?###########
cairo_arc (cr,mx,my,r_outer,(math.pi/180)*(rang_outer-90),(math.pi/180)*(lang_outer-90))
--coordinates,left line
local arc=(math.pi/180)*lang_outer
local lxo=0+r_outer*(math.sin(arc))
local lyo=0-r_outer*(math.cos(arc))
cairo_line_to (cr,mx+lxo,my+lyo-h_outer)
--coordinates,left line
local arc=(math.pi/180)*rang_outer
local rxo=0+r_outer*(math.sin(arc))
local ryo=0-r_outer*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxo+((rxo-lxo)/2),my+lyo-h_outer,(rxo-lxo)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxo+((rxo-lxo)),my+lyo)
cairo_stroke (cr)
----------------------------------------------
--graphics inner
--####################################################
if units=="F" then
local str,stg,stb,sta=0,1,1,1
local mr,mg,mb,ma=1,1,0,1
local fr,fg,fb,fa=1,0,0,1
local nd=150
if temp==nil then temp=0 end
local tadj=temp+30
local middle=mid+30
if tadj<(middle) then
colr=((mr-str)*(tadj/(middle)))+str
colg=((mg-stg)*(tadj/(middle)))+stg
colb=((mb-stb)*(tadj/(middle)))+stb
cola=((ma-sta)*(tadj/(middle)))+sta
elseif tadj>=(middle) then
colr=((fr-mr)*((tadj-(middle))/(nd-middle)))+mr
colg=((fg-mg)*((tadj-(middle))/(nd-middle)))+mg
colb=((fb-mb)*((tadj-(middle))/(nd-middle)))+mb
cola=((fa-ma)*((tadj-(middle))/(nd-middle)))+ma
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=temp+30
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if label~="none" then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=15
local lnx=mx+lxo
local lnw=(rxo-lxo)
for i=1,lnn do
lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)
if i==lnn then
lnx=lnx+2
lnw=lnw-4
end
cairo_move_to (cr,lnx,lny)
cairo_rel_line_to (cr,lnw,0)
cairo_stroke (cr)
end
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=8
local lnx=mx+lxo+(rxo-lxo)+4
num={-20,"0°"..units,20,40,60,80,100,120}
for i=1,lnn do
lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label=none
end--if units=F
--#################################################
if units=="C" then
--from -30 to 50 C
local str,stg,stb,sta=0,1,1,1
local mr,mg,mb,ma=1,1,0,1
local fr,fg,fb,fa=1,0,0,1
local nd=160
if temp==nil then temp=0 end
local tadj=(temp*2)+60
local middle=(mid*2)+60
if tadj<(middle) then
colr=((mr-str)*(tadj/(middle)))+str
colg=((mg-stg)*(tadj/(middle)))+stg
colb=((mb-stb)*(tadj/(middle)))+stb
cola=((ma-sta)*(tadj/(middle)))+sta
elseif tadj>=(120) then
colr=((fr-mr)*((tadj-(middle))/(nd-middle)))+mr
colg=((fg-mg)*((tadj-(middle))/(nd-middle)))+mg
colb=((fb-mb)*((tadj-(middle))/(nd-middle)))+mb
cola=((fa-ma)*((tadj-(middle))/(nd-middle)))+ma
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
--cairo_set_source_rgba (cr,0,1,1,1)
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=(temp*2)+60
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if label~="none" then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=17
local lnx=mx+lxo
local lnw=(rxo-lxo)
for i=1,lnn do
lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)
if i==lnn then
lnx=lnx+2
lnw=lnw-4
end
cairo_move_to (cr,lnx,lny)
cairo_rel_line_to (cr,lnw,0)
cairo_stroke (cr)
end
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=9
local lnx=mx+lxo+(rxo-lxo)+4
num={-30,-20,-10,"0°"..units,10,20,30,40,50}
for i=1,lnn do
lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label=none
end--if units=C
--#################################################
--label
if label~="none" then
local font="Mono"
local fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local lbx=mx+lxo-5
local lby=my-r_inner-10-((rxi-lxi)/2)
cairo_move_to (cr,lbx,lby)
cairo_rotate (cr,(math.pi/180)*(-90))
cairo_show_text (cr,label)
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(90))
--temperature readout
cairo_set_source_rgba (cr,0,0,0,1)
local text=temp.."°"..units
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,mx-(width/2),my+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end--if label
------------------------------------
cairo_scale (cr,1/scale,1/scale)
end--thermometer function
--#############################################################################################################################################################
--#############################################################################################################################################################
function conky_draw_bg(r,x,y,w,h,color,alpha)
local function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
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)
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

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5 2011-11-16 19:53:56

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

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

mrpeachy wrote:

another update
now supports ConkyWeather font

example of how to use the font in conkyrc

${lua weather day1.day}
Conditions: ${lua weather day1.con}${font ConkyWeather:size=30}${goto 170}${lua_parse weather font.day1}${font}
${voffset -30}High: ${lua weather day1.hih} F
Low: ${lua weather day1.low} F
${lua_parse weather image.day1 80 130 50 50}

I found overlap of the text with {goto 170}
{goto 210} fixed it here...

Screenshot_12.jpg


Congratulations, you've figured out the sound of one hand clapping...

Offline

#6 2011-11-16 19:56:53

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

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

Sector11 wrote:

Count me in as a regular!

And I have a hic-cup too, the latest thermometer.conky (thermometer.lua v4) stopped working for me today.  I changed nothing - v3 still works.

KFC and restart it works here when I see this.

(your post prior explained this- remember?) smile


Congratulations, you've figured out the sound of one hand clapping...

Offline

#7 2011-11-16 20:02:05

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

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

found some errors in latest version

updated post and here is code also
http://crunchbanglinux.org/pastebin/1307

@ Sector11
if kill restart doesnt do the trick, see if you get any errors in the terminal

also it seems that the thermometer conky suffers from memory leak
and also runs a little hot on the cpu
the memory leak may be due to the way that i seperated the functions... ill test it out
(i just don't have scripts running long enough, or my computer running long enough to pick up memory leaks!)

Last edited by mrpeachy (2011-11-16 20:15:44)

Offline

#8 2011-11-16 20:16:09

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

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

mrpeachy wrote:

also it seems that the thermometer conky suffers from memory leak
and also runs a little hot on the cpu
the memory leak may be due to the way that i seperated the functions... ill test it out

In that you are not showing current temp, the desktop script does not need to run as frequently.

{color6} worked perfect for the desktop light color of the day in both the weatherfont and text(Bonita Lighthouse San Francisco) smile

Last edited by BoredOOMM (2011-11-16 20:16:46)


Congratulations, you've figured out the sound of one hand clapping...

Offline

#9 2011-11-16 20:54:56

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

BoredOOMM wrote:
Sector11 wrote:

Count me in as a regular!

And I have a hic-cup too, the latest thermometer.conky (thermometer.lua v4) stopped working for me today.  I changed nothing - v3 still works.

KFC and restart it works here when I see this.

(your post prior explained this- remember?) smile

I KFC'd that sucker 3 times!  No good!  Been using KFC for years!!!!

@ mrpeachy:

Conky: llua_do_call: function conky_weather execution failed: /home/sector11/Conky/LUA/thermometer_v4.lua:1013: error in function 'cairo_set_source_rgba'.
     argument #2 is 'nil'; 'number' expected.

Conky: llua_do_call: function conky_weather execution failed: /home/sector11/Conky/LUA/thermometer_v4.lua:1013: error in function 'cairo_set_source_rgba'.
     argument #2 is 'nil'; 'number' expected.

over and over and ov....

Also some new additions for your list and where I got them:

New:
Alert, Canada
http://www.intellicast.com/Local/Weathe … n=CAXX0829
AM Snow Showers

Base Marambio Centro Met. Antartico, Antarctica
http://www.intellicast.com/Local/Foreca … n=AYXX0005
Snow Showers/Wind
AM Snow Showers
Snow/Wind
Cloudy/Wind - love the "leaning pine trees" icon

Ushuaia, Argentina
http://www.intellicast.com/Local/Foreca … n=ARTF0105
Broken Clouds - how do you break a cloud?
Showers Late
AM Showers

Buenos Aires, Argentina
http://www.intellicast.com/Local/Foreca … n=ARBA0009
Mostly Clear - is that the same as 'Partly Cloudy'

Tokyo, Japan
http://www.intellicast.com/Local/Foreca … n=JAXX0085
AM Clouds/PM Sun

Oshawa, Canada
http://www.intellicast.com/Local/Foreca … n=CAXX0342
Rain/Snow Showers/Wind

Ulan Bator, Mongolia
http://www.intellicast.com/Local/Foreca … n=MGXX0003
Light Snow

Phnom Penh, Cambodia
http://www.intellicast.com/Local/Foreca … n=CBXX0001
AM Thunderstorms
PM Thunderstorms

Vancouver, Canada
http://www.intellicast.com/Local/Foreca … n=CAXX0518
Rain/Snow

Brasilia, Brazil
http://www.intellicast.com/Local/Foreca … n=BRXX0043
Scattered Clouds


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#10 2011-11-16 20:56:53

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

mrpeachy wrote:

also it seems that the thermometer conky suffers from memory leak
and also runs a little hot on the cpu
the memory leak may be due to the way that i seperated the functions... ill test it out
(i just don't have scripts running long enough, or my computer running long enough to pick up memory leaks!)

I run them in a window - look at them and then kill them.  So I'm not good to find memory leaks.  BUT it's a good thing to fix.

Last edited by Sector11 (2011-11-16 23:32:53)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#11 2011-11-16 22:48:05

psyco430404
#! Die Hard
From: Las Vegas, Nevada
Registered: 2011-07-04
Posts: 804

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

dang these are some really nice scripts, very impressive smile good job


"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Offline

#12 2011-11-16 23:41:02

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

psyco430404 wrote:

dang these are some really nice scripts, very impressive smile good job

Yea MrP is going full steam on these!  I took his ten day LUA script and "filled it out" - the only thing that didn't work for me was the UV reading:

Darn nice script: 1015c3159710698.jpg

Which reminds me ...

@ mrpeachy:
Is there a way to hook the background LUA into this as a 2nd LUA script?

###  LUA Settings  ###########################################################
# lua_load ~/Conky/LUA/draw_bg.lua

## ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
#######################################################  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 1

lua_load ~/Conky/LUA/forecast.lua
lua_draw_hook_pre weatherdata
 #starts the lua weather data gathering function, call once at top of conkyrc

TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}blah blah blah

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#13 2011-11-17 00:10: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:
psyco430404 wrote:

dang these are some really nice scripts, very impressive :) good job

Yea MrP is going full steam on these!  I took his ten day LUA script and "filled it out" - the only thing that didn't work for me was the UV reading:

Thanks psyco430404

@ Sector11 
what happens when you try UV index?
this works for me

UV index: ${lua weather day1.uvn} (${lua weather day1.uvt})

as for getting the background
yes...

you can load the script above text with lua_load

then call the function below text as you posted

${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}

im currently scouring the world to see all the intellicast weather images and see how they describe them on the page... this should lead to a more dependable way to get images and weather font working

Last edited by mrpeachy (2011-11-17 00:16:44)

Offline

#14 2011-11-17 00:49:26

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

mrpeachy wrote:

@ Sector11 
what happens when you try UV index?
this works for me

UV index: ${lua weather day1.uvn} (${lua weather day1.uvt})

No wonder - my instructions show this:

# uvi=ultraviolet index

No uvn or uvt  smile

mrpeachy wrote:

as for getting the background
yes...

you can load the script above text with lua_load

then call the function below text as you posted

${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}

im currently scouring the world to see all the intellicast weather images and see how they describe them on the page... this should lead to a more dependable way to get images and weather font working

I tried that, at least I thought I had, because it's so logical, but yea, that got it.
I'll try the uvn or uvt variable and repost!  big_smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#15 2011-11-17 01:16:39

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

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

@ Sector11

No Fog in your cities found.
Your conky has no images.

@ Mr Peachy

New error in 1307 script this PM


Conky: llua_do_call: function conky_weather execution failed: /home/bkberger/lua/forecast.lua:588: attempt to concatenate a nil value

-- line 588

Conky: Lua script '/home/bkberger/lua/forecast.lua' reloaded
Conky: Unable to load image '/home/bkberger/conky_intellicast/images/weathericons/32.png'

No 32.png and should be 85.png per website


New error


Congratulations, you've figured out the sound of one hand clapping...

Offline

#16 2011-11-17 01:52:06

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

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

those darn images are giving me a headache smile

im working on getting that aspect more dependable
will post some updated code soon

here is how i am getting on with naming the intellicast icons

wx_65=32--clear/sunny--mostly sunny
wx_66=30--partly cloudy
wx_67=26--cloudy
wx_68=32--clear/sunny
wx_69=28--mostly cloudy
wx_70=20--fog
wx_71=
wx_72=
wx_73=
wx_74=few/scattered snow showers
wx_75=
wx_76=
wx_77=
wx_78=windy day
wx_79=rain/snow showers, snow showers
wx_80=
wx_81=blowing snow
wx_82=rain, rain/wind
wx_83=
wx_84=thunderstorms
wx_85=sunny/clear day
wx_86=
wx_87=few showers/showers
wx_88=
wx_89=
wx_90=
wx_91=
wx_92=
wx_93=
wx_94=
wx_95=isolated thunderstorms day
wx_96=scattered thunderstorms day
wx_97=clear night
wx_98=partly cloudy night/broken clouds night/haze night
wx_99=early clouds=mostly cloudy 27night,28day
wx_100=
wx_101=
wx_102=
wx_103=overcast night
wx_104=
wx_105=
wx_106=
wx_107=heavy rain
wx_108=light snow night
wx_109=
wx_110=
wx_111=
wx_112=
wx_113=
wx_114=snow showers, night
wx_115=

Last edited by mrpeachy (2011-11-17 02:05:11)

Offline

#17 2011-11-17 02:32:10

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

BoredOOMM wrote:

@ Sector11

No Fog in your cities found.
Your conky has no images.

I am showing a conky using forecast.lua v3 - before the images.  I'm a little behind as I am doing other things as well.

Here's what I have now thanks to mrpeachy:

713824159725835.jpg

... and a request for when/if mrpeachy has the time/desire to do so:

The UV Index text:  Very ???

How about:

0-2 V.Low or No Danger
3-5 Low
6-7 High
8-10 V.High or Very High
11+ Ex.High or E.High or Extreme


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#18 2011-11-17 04:02:07

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:

... and a request for when/if mrpeachy has the time/desire to do so:

The UV Index text:  Very ???

reading the text in your screenshot made me chuckle
... im not sure whats going on there!
i suppose there must be some error in the info being displayed by that option

it is supposed to read low/moderate etc
and it does for me... but im probably a version or 3 ahead as you say big_smile

ill try and do some better quality control, code post to code post!
problem is i can be extremely impatient smile

Offline

#19 2011-11-17 06:08:42

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

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

mrpeachy wrote:
Sector11 wrote:

... and a request for when/if mrpeachy has the time/desire to do so:

The UV Index text:  Very ???

reading the text in your screenshot made me chuckle
... im not sure whats going on there!
i suppose there must be some error in the info being displayed by that option

it is supposed to read low/moderate etc
and it does for me... but im probably a version or 3 ahead as you say big_smile

This is what the website says tonight. UV Index: 3 (Moderate)
Wednesday -  UV Index: 2 (Low)

Maybe this is the choices and the parsing is hitting a snag.  Sometimes I have ":" after Day 2 as well...? problems with the website info, not your work MrP.  big_smile

Low
Moderate
High
Very High

Last edited by BoredOOMM (2011-11-17 06:23:45)


Congratulations, you've figured out the sound of one hand clapping...

Offline

#20 2011-11-17 07:43:53

dlm955
#! CrunchBanger
From: Mansfield,Ohio USA
Registered: 2011-07-23
Posts: 128

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

I added the info from post  #16 {not #4}
I discovered something I haven,t seen in other post,I hope is useful ....
When I use use your location the lua works and info is written to the weather.txt file.
when I use my location I recieve two errors

Conky: llua_do_call: function conky_weatherdata execution failed: /home/dlm955/Documents/conkyfiles/forecastv6-2.lua:288: attempt to concatenate field 'day2' (a nil value)

line 288 local datastringfont=font.now.."|"..font.day1.."|"..font.day2.."|"..font.day3.."|"..font.day4.."|"..font.day5.."|"..font.day6.."|"..font.day7.."|"..font.day8.."|"..font.day9.."|"..font.day10

Conky: llua_do_call: function conky_weather execution failed: /home/dlm955/Documents/conkyfiles/forecastv6-2.lua:587: attempt to concatenate a nil value

now="${image "..weathericons..(loadstring("return ".."wimage."..(string.gsub(now.con,"[ %.%/]","")..daynight))())..".png -p "..xpos..","..ypos.." -s "..scale1.."x"..scale2.."}",

and weather.txt file is blank
                 hope this helps
    edit : corrected info on line 1

Last edited by dlm955 (2011-11-17 18:10:46)


Give a man a truth and he will think for a day.
Teach a man to reason and he will think for a lifetime!

Offline

#21 2011-11-17 07:55:38

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

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

thanks for the feedback!

i have completed my intellicast image to conkyforecast image translation
hopefully i got them right, or at least close... with some of those intellicast images it was difficult (without having seen them up on the site) to work out what they were smile

thanks to BoredOOMM for getting me the intellicast icons

@Sector11, what kind of cpu drain are you getting when you have the 10 day forecast up in conky?

@dlm955, hopefully when i get a couple of bugs figured out and post some new code, the problems that have been associated with images and weather font should go away!

hopefully when i'm done intellicast wont decide to redesign their website!

Last edited by mrpeachy (2011-11-17 07:58:09)

Offline

#22 2011-11-17 12:47:53

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

mrpeachy wrote:

@Sector11, what kind of cpu drain are you getting when you have the 10 day forecast up in conky?

hopefully when i'm done intellicast wont decide to redesign their website!

Read this and started my 10 day forecast and left it running while I had breakfast.  So after 20-25 minutes it is sitting at 4% with IceWeasel open and writing this response.  It was at 2% just before opening  IceWeasel.  If I pause my typing ... it drops back to 2%.

I have seen the demise of three scripts that used Weather·com since 2007.

1. a weather.sh script using xslt files grabbed by curl. needs LOCID key as well
2. a perl script by lvleph's Conky Weather Revisited V2, and
3. the latest - the famous Kaivalagi Python Script; conkyForecast

Things change, hair falls out, in the year 2525 ....

Last edited by Sector11 (2011-11-17 12:48:35)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#23 2011-11-17 17:14:59

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,666
Website

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

Just downloaded forecast.lua v5 and applied it to my 10 day forecast conky.  I notice a huge jump in CPU usage. Sitting idle is does not drop below 7% (from 1/2%) and have seen it climb to 25+ just doing simple things - right now - typing in IceWeasel I see 17-19%

Oh oh ... after typing that I did nothing - just watched --- 11/13% - will leave it run for a bit and see what happens.

WOW!!!  Jumped to 72% just saving the message.  sad

Terminal:

  13:33:07 ~
         $ conky -c ~/Conky/Forecast_v5.conky &
[1] 22281

  13:33:09 ~
         $ Conky: desktop window (1ff) is root window
Conky: window type - normal
Conky: drawing to created window (0x2400002)
Conky: drawing to double buffer
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  68178      0 --:--:-- --:--:-- --:--:--   98k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0   101k      0 --:--:-- --:--:-- --:--:--  135k
Conky: llua_do_call: function conky_weatherdata execution failed: /home/sector11/Conky/LUA/forecast_5.lua:172: attempt to index local 'file' (a nil value)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  80899      0 --:--:-- --:--:-- --:--:--  100k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  84383      0 --:--:-- --:--:-- --:--:--  103k
Conky: llua_do_call: function conky_weatherdata execution failed: /home/sector11/Conky/LUA/forecast_5.lua:172: attempt to index local 'file' (a nil value)
         $ XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 17986 requests (17984 known processed) with 0 events remaining.

[1]+  Exit 1                  conky -c ~/Conky/Forecast_v5.conky

  13:34:43 ~
         $ conky -c ~/Conky/Forecast_v5.conky &
[1] 22333

  13:34:46 ~
         $ Conky: desktop window (1ff) is root window
Conky: window type - normal
Conky: drawing to created window (0x2400002)
Conky: drawing to double buffer
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  99417      0 --:--:-- --:--:-- --:--:--  128k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  84313      0 --:--:-- --:--:-- --:--:--  104k
Conky: llua_do_call: function conky_weatherdata execution failed: /home/sector11/Conky/LUA/forecast_5.lua:172: attempt to index local 'file' (a nil value)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  82963      0 --:--:-- --:--:-- --:--:--  101k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0    97k      0 --:--:-- --:--:-- --:--:--  135k
Conky: llua_do_call: function conky_weatherdata execution failed: /home/sector11/Conky/LUA/forecast_5.lua:172: attempt to index local 'file' (a nil value)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  66690      0  0:00:01  0:00:01 --:--:-- 99525
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67478  100 67478    0     0  80729      0 --:--:-- --:--:-- --:--:--   98k
Conky: llua_do_call: function conky_weatherdata execution failed: /home/sector11/Conky/LUA/forecast_5.lua:172: attempt to index local 'file' (a nil value)

Last edited by Sector11 (2011-11-17 17:17:34)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#24 2011-11-17 18:26:27

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

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

Sector11 wrote:

Just downloaded forecast.lua v5 and applied it to my 10 day forecast conky.  I notice a huge jump in CPU usage. Sitting idle is does not drop below 7% (from 1/2%) and have seen it climb to 25+ just doing simple things - right now - typing in IceWeasel I see 17-19%

Oh oh ... after typing that I did nothing - just watched --- 11/13% - will leave it run for a bit and see what happens.

WOW!!!  Jumped to 72% just saving the message.  sad

Terminal:

After it parses all the scripting, it settles some. The memory leak is still there though.


Congratulations, you've figured out the sound of one hand clapping...

Offline

Be excellent to each other!

#25 2011-11-17 20:04:22

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, everything seems to be working smile

Screenshot.jpg

this is everything for current and 2 forecast days and i get an idle cpu of 7% on my eeePC
weather images and font are based off of the icon that intellicast uses not their description (which is just too varied)

here is the conkyrc that gave the above

lua_load ~/lua/forecast_testing.lua
lua_draw_hook_pre weatherdata#starts the lua weather data gathering function, call once at top of conkyrc

TEXT
${font Mono:size=10}Current Conditions (cpu: ${cpu cpu0}%)

${goto 70}${voffset -16}${lua weather now.con}${lua weather now.cd2}
${goto 70}${font Mono:size=14}${lua weather now.tmp}°F${goto 100}${voffset -3}${font ConkyWeather:size=22}   ${lua_parse weather font.now}${font}
${goto 70}${voffset -6}Feels Like: ${lua weather now.flk}°F
${voffset 5}
Wind Chill: ${lua weather now.wch}°F  ${goto 120}Ceiling:    ${lua weather now.cel}
Heat Index: ${lua weather now.hid}°F  ${goto 120}Visibility: ${lua weather now.vis} miles
Dew Point:  ${lua weather now.dpt}°F  ${goto 120}Wind:       ${lua weather now.wsp} mph
Humidity:   ${lua weather now.hum}%   ${goto 120}Direction:  ${lua weather now.wdg}° (${lua weather now.wdi})
Pressure:   ${lua weather now.prs}"   ${goto 120}Gusts:      ${lua weather now.wgs}${lua_parse weather image.now 5 18 50 50}

${font Mono:size=10}${lua weather day1.day} ${lua weather day1.dat}
${goto 70}${lua weather day1.con}${lua weather day1.cd2}
${goto 70}${font Mono:size=10}HI ${lua weather day1.hih}°F${goto 150}${font ConkyWeather:size=30}${lua_parse weather font.day1}${font}
${goto 70}${voffset -24}${font Mono:size=10}LO ${lua weather day1.low}°F${font}

Sun Rise:   ${lua weather day1.sri}   ${goto 140}Sun Set:    ${lua weather day1.sst}
Moon Rise:  ${lua weather day1.mri}   ${goto 140}Moon Set:   ${lua weather day1.mst}
Rain?:      ${lua weather day1.ppt}%  ${goto 140}UV Index:   ${lua weather day1.uvn} (${lua weather day1.uvt})
Snow?:      ${lua weather day1.snw}%  ${goto 140}Humidity:   ${lua weather day1.hum}%
Clouds:     ${lua weather day1.cld}%  ${goto 140}Wind:       ${lua weather day1.wmh} mph, ${lua weather day1.wdg} (${lua weather day1.wdi})
${lua_parse weather image.day1 5 190 50 50}
${font Mono:size=10}${lua weather day2.day} ${lua weather day2.dat}
${goto 70}${lua weather day2.con}${lua weather day2.cd2}
${goto 70}${font Mono:size=10}HI ${lua weather day2.hih}°F${goto 150}${font ConkyWeather:size=30}${lua_parse weather font.day1}${font}
${goto 70}${voffset -24}${font Mono:size=10}LO ${lua weather day2.low}°F${font}

Sun Rise:   ${lua weather day2.sri}   ${goto 140}Sun Set:    ${lua weather day2.sst}
Moon Rise:  ${lua weather day2.mri}   ${goto 140}Moon Set:   ${lua weather day2.mst}
Rain?:      ${lua weather day2.ppt}%  ${goto 140}UV Index:   ${lua weather day2.uvn} (${lua weather day2.uvt})
Snow?:      ${lua weather day2.snw}%  ${goto 140}Humidity:   ${lua weather day2.hum}%
Clouds:     ${lua weather day2.cld}%  ${goto 140}Wind:       ${lua weather day2.wmh} mph, ${lua weather day2.wdg} (${lua weather day2.wdi})
${lua_parse weather image.day2 5 347 50 50}

and here is the lua
http://crunchbanglinux.org/pastebin/1309

i havnt seen what the usage foes to when the data gathering function is gathering, it will undoubtedly be higher but will only occur as frequently as you set the update interval in the lua

im going to see f i can get the placement of the weather font  to be easier (do it through the script) which would eliminate the need to use negative voffsets in the conkyrc after using the weather font

it should also be relatively simple to implement the wind direction font and the moon phase font as the info is available in the script

Last edited by mrpeachy (2011-11-17 20:06:14)

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.
Server: zapp

Debian Logo