SEARCH

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

You are not logged in.

#76 2014-01-08 21:26:32

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

How do you change icon folders?
I changed all 4 lines of wun_config.lua

--as a change from v9000 where icons were all together in one folder
--in wun the icons are seperated by type.  Use the following lines to point to the folders of your choice
--you can have them all pointing at the same folder also
basic_weather_icons		="/home/joe/wun/additional_files/weathericons/extended/",
extended_weather_icons		="/home/joe/wun/additional_files/weathericons/extended/",
wind_icons			="/home/joe/wun/additional_files/weathericons/wind/",
moon_icons			="/home/joe/wun/additional_files/weathericons/moon/",

to point to the weathericons_falldown and mono folders and both came up with no icons.
Keep in mind at the moment I can only run wun_template.lua


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

Offline

Be excellent to each other!

#77 2014-01-08 21:30:18

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

any template mods, changing data to metric for example will not be affected
you can save your modded templates in another location then if you try a new archive, copy them back and overwrite what is there

Thanks mrpeachy that helps a lot with new updates


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

Offline

#78 2014-01-08 21:38:33

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

Re: Wun Weather Script for Conky (Lua)

jst_joe wrote:

How do you change icon folders?
I changed all 4 lines of wun_config.lua

--as a change from v9000 where icons were all together in one folder
--in wun the icons are seperated by type.  Use the following lines to point to the folders of your choice
--you can have them all pointing at the same folder also
basic_weather_icons		="/home/joe/wun/additional_files/weathericons/extended/",
extended_weather_icons		="/home/joe/wun/additional_files/weathericons/extended/",
wind_icons			="/home/joe/wun/additional_files/weathericons/wind/",
moon_icons			="/home/joe/wun/additional_files/weathericons/moon/",

to point to the weathericons_falldown and mono folders and both came up with no icons.
Keep in mind at the moment I can only run wun_template.lua

you might have to wait a bit for this ability
unless we can call on the services of mr falldown

because wunderground uses a different way or calling icons (textstrings rather than numbers)
i had to create a folder with renamed icons in wicon, the link to that folder is here
https://dl.dropboxusercontent.com/u/190 … ons.tar.gz

if falldown could adapt his weather icons to make a matching set with the same names, then it would be easy to substitute them

the other folder, extended, as seen here:
/home/mcdowall/Dropbox/Public/wun/extended.tar.gz

contains the original 47 conkyforecast icons with some additional ones i put together to cover the various weather types on offer

Offline

#79 2014-01-08 21:46:26

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:
falldown wrote:

OH yea Peachy I get 7 days, but with the 10 day it works out with 2 rows of 5.
7 just doesn't look right  big_smile

yes, you are right!

@sector11 , i completely understand!
i was just thinking that i had everything going pretty smoothly last night, then started it up today and BREAKAGE!!

to save you some headaches it is only the main wun.lua that is changing recently

any template mods, changing data to metric for example will not be affected
you can save your modded templates in another location then if you try a new archive, copy them back and overwrite what is there

I had no idea what changed ... so every re-start has been at mile "0".

I'm not as LUA literate as you and falldown.  big_smile

I broke my template with the moon column fix that didn't - I have 9 /wun directories, 4 in /home and 5 in /media/5 - I'm going nuts trying to keep up - not even sure anymore where my latest working "templates" are.

Well, they won't be working as they are 10 day not 7 day and I have no idea how to edit them ... I am actively working on them here though ... just don't count on much - yet.


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

Offline

#80 2014-01-08 21:59:51

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

you might have to wait a bit for this ability

no problem thanks for the heads up

Sector11 wrote:

I had no idea what changed ... so every re-start has been at mile "0".

I'm not as LUA literate as you and falldown.  big_smile

I broke my template with the moon column fix that didn't - I have 9 /wun directories, 4 in /home and 5 in /media/5 - I'm going nuts trying to keep up - not even sure anymore where my latest working "templates" are.

lol lol lol no kidding
I woke up at 4:30 this morning and started messing with stuff off and on since then


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

Offline

#81 2014-01-08 22:20:18

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

Re: Wun Weather Script for Conky (Lua)

the 7 day seems to be sticking, and since that change things seem to be stable once again

Screenshot_from_2014_01_08_16_06_49.jpg

credit sector11 for the sun/moon layout smile

i have some thoughts for the future, but those are for later  ]:D

Offline

#82 2014-01-08 23:44:07

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

Re: Wun Weather Script for Conky (Lua)

seems like the 7 day thing was a glitch as it is back to 10 now
i have fixed wun.lua to compensate for this glitch
ill post an update soon smile

here is proof of 10 days in the astronomy section 8o
Screenshot_from_2014_01_08_17_33_04.jpg

i have to say that was very naughty of wunderground
there are people paying hundreds of dollars for that api data!

Last edited by mrpeachy (2014-01-08 23:53:23)

Offline

#83 2014-01-08 23:54:45

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

out of interest, what do you have to do to get the updated archives up and running?  anything i could change to make it easier?

i dont plan on changing the config unless i think it is really important, so you can copy your config to somewhere else, then paste it into the new wun folder and overwrite what is there

${bashing head against wall} ${bashing head against wall}

Well, I must be junxed - my old template wun_template.lua had ...

out({x=tlx+70,y=tly,txt=day[i].weekday})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt="  CT B/E:"})
out({a=1,fs=12,x=tlx+70,y=tly,	txt=astronomy[i].begin_civil_twilight.."/"..astronomy[i].end_civil_twilight})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" Sun R/S:"})
out({a=1,fs=12,x=tlx+70,y=tly,	txt=astronomy[i].sunrise.."/"..astronomy[i].sunset})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt="SS Trans:"})
out({a=1,fs=12,x=tlx+70,y=tly,	txt=astronomy[i].suntransit})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt="  M Rise:"})
out({a=1,fs=12,x=tlx+70,y=tly,	txt=astronomy[i].moonrise[1].."/"..astronomy[i].moonrise[2]})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" M Trans:"})
out({a=1,fs=12,x=tlx+70,y=tly,	txt=astronomy[i].moontransit[1]})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" MoonSet:"})
out({a=1,fs=12,x=tlx+70,y=tly,	txt=astronomy[i].moonset[1].."/"..astronomy[i].moonset[2]})

six lines of data .. the latest has 8 lines:

out({x=tlx+20,y=tly,txt=day[i].weekday_short.." "..day[i].day_pad.." "..day[i].monthname_short.." "..day[i].year})
tly=tly+18
out({a=1,fs=12,x=tlx,y=tly,	txt="  CT B/E:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].begin_civil_twilight.."/"..astronomy[i].end_civil_twilight})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" Sun R/S:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].sunrise.."/"..astronomy[i].sunset})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt="SS Trans:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].sun_transit})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt="  M Rise:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].moonrise[1].." / "..astronomy[i].moonrise[2]})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" M Trans:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].moon_transit[1]})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" MoonSet:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].moonset[1].." / "..astronomy[i].moonset[2]})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" M Phase:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].moon_phase})
tly=tly+15
out({a=1,fs=12,x=tlx,y=tly,	txt=" Visible:"})
out({a=1,fs=12,x=tlx+80,y=tly,	txt=astronomy[i].moon_visible.."%"})

OK, I started editing ... things were going GREAT!

...I thought: Hey, I can get more than two days of moon info....
- - I added row2. column 1 and row 2, column 2
- - increased local end_number=2 to local end_number=4

AWESOME! - - next:

- - I added row3. column 1 and row 3, column 2
- - increased local end_number=4 to local end_number=6

BLINK - no conky and an error
- - commented out the lines ...
- - killed the conky
- - restared it ... Nothing ... same error.

2014_01_08_20_14_52_1401x919_Sector11.jpg

ypos=ypos+100
--astronomy repeat section
--set colum width
local column_width=220
--set row height
local row_height=110
--set coordinates first row at y=370
--row 1, column 1
top_left_x_coordinate[1]=+5(0*column_width)
top_left_y_coordinate[1]=ypos
--row 1, column 2
top_left_x_coordinate[2]=5+(1*column_width)
top_left_y_coordinate[2]=ypos
--[[
--row 2, column 1
top_left_x_coordinate[3]=5+(0*column_width)
top_left_y_coordinate[3]=ypos+150
--row 2, column 2
top_left_x_coordinate[4]=5+(1*column_width)
top_left_y_coordinate[4]=ypos+150

--row 3, column 1
top_left_x_coordinate[5]=5+(0*column_width)
top_left_y_coordinate[5]=ypos+300
--row 3, column 2
top_left_x_coordinate[6]=5+(1*column_width)
top_left_y_coordinate[6]=ypos+300
--]]

local start_number=1
local end_number=2

${bashing head against wall} ${bashing head against wall}

What is it they say: If it wasn't for bad luck ....


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

Offline

#84 2014-01-08 23:57:34

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

the 7 day seems to be sticking, and since that change things seem to be stable once again

http://s11.postimg.org/71362aarz/Screenshot_from_2014_01_08_16_06_49.jpg

credit sector11 for the sun/moon layout smile

i have some thoughts for the future, but those are for later  ]:D

Well, I'm glad it works for someone .. I haven't been this frustrated in a LONG time!!!!!!!!!!

That Sun Moon layout look vaguely familiar ...  lol  lol  I like it!


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

Offline

#85 2014-01-09 00:10:19

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

Re: Wun Weather Script for Conky (Lua)

I need to add the sun and moon section.
Hopefully they stick with a ten day set up..

Offline

#86 2014-01-09 00:35:33

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

Re: Wun Weather Script for Conky (Lua)

Sector11 wrote:

${bashing head against wall} ${bashing head against wall}
--snip--
BLINK - no conky and an error
- - commented out the lines ...
- - killed the conky
- - restared it ... Nothing ... same error.

http://s20.postimg.org/4h7je3p1l/2014_01_08_20_14_52_1401x919_Sector11.jpg
--snip--
${bashing head against wall} ${bashing head against wall}

What is it they say: If it wasn't for bad luck ....

ive had that error too...
whenever the error is with wun_lua and points to 1038
(or whichever line has the _G.weather_script(update,time,now,text_forecast,day,hour,astronomy) )

that means that there is an error in the weather template and wun.lua cant load it
unfortunately this is the kind of error that you cant fix "on the fly"
even opening the template file, finding the error, fixing it and resaving the template will not clear the error

conky has to be killed, the template has to be fixed and then the conky restarted.

this can be a problem if you are not sure where the error is in the template!

but there is a way you can get around this
when the error points to _G.weather_script in wun.lua, kill all conky

then in the template comment out any lines you think may be the problem, for example you can comment out the entire section you were working on like this:

--[[
everything is now commented out until
--]]

then restart the conky

once wun.lua has activated the template you can go back to the template file and uncomment everything, and then the terminal will point you to the source of the error!

Offline

#87 2014-01-09 00:44:17

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

Re: Wun Weather Script for Conky (Lua)

falldown wrote:

I need to add the sun and moon section.
Hopefully they stick with a ten day set up..

me too! LOL

the latest update should compensate for any future glitches
10 day templates will work and show no errors, but will show "0" when data is not available

Offline

#88 2014-01-09 00:55:18

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

Re: Wun Weather Script for Conky (Lua)

anywhere here is my idea, from earlier

Sector11 had me thinking about people switching between imperial and metric
currently there are many options that would need to be switched
seeing as wun is in the early stages, i could take all the data options which output imperial and name them _imperial

for example

day[1].high_f               =>  day[1].high_imperial
day[1].rain_day_in       =>  day[1].rain_day_imperial

and then rename all the options that output as metric to _metric

day[1].high_c               =>  day[1].high_metric
day[1].rain_day_mm       =>  day[1].rain_day_metric

then whatever template i wrote with imperial measuremets a simple

replace _imperial with _metric will instantly switch it to metric

i could automate the units also

day[1].rain_day_imperial_units     =>"in"
day[1].rain_day_metric_units     =>"mm"

then there would be no editing other than the find and replace to switch between the 2 systems

Last edited by mrpeachy (2014-01-09 00:55:58)

Offline

#89 2014-01-09 01:04:30

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

ive had that error too...
whenever the error is with wun_lua and points to 1038
(or whichever line has the _G.weather_script(update,time,now,text_forecast,day,hour,astronomy) )

OK, I'll archive that info, Thank you very much!

However the BULL in me (Taurus) broke the wall and I started over once again ... this time renaming the template and grabbing the original from the archives ... and going very S·L·O·W and C·A·R·E·F·U·L like!

2014_01_08_21_35_23_1920x1080_Sector11.jpg
not my sun/moon layout - I tried that once and it crapped out ... I'll wait until it's a built in feature.

And "Interactive" still isn't  sad  I have not bothered to 'customize' it yet. it's right OOTB!

an error that only showed up today:

Conky: llua_do_call: function conky_get_mouse execution failed: /home/sector11/wun/button_script.lua:93: attempt to perform arithmetic on field '?' (a nil value)

But at least it displays.

I do have one question.  On the left - in the "text" section for Wednesday and Wednesday Night.

How do I set that section to °C and kph, etc, etc?

EDIT: - - -  DUH! interactive conky NOW interactive:
conky_name="interactiveconkyrc"
click_data_file ="/tmp/xdo"

I knew that ... I knew that ... I knew that ... I knew that ... I knew that !!!
{dumb guy - banging head against another wall - dumb guy}

I need a drink!  Waitress, coffee, black, forget the cup bring the pot please!

Last edited by Sector11 (2014-01-09 01:13:30)


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

Offline

#90 2014-01-09 01:18:22

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

anywhere here is my idea, from earlier

then there would be no editing other than the find and replace to switch between the 2 systems

{)  {)  {)  {)  {)

on the cheek - which is a normal way to greet someone here!  cool

Such a neat idea!


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

Offline

#91 2014-01-09 01:31:18

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

Re: Wun Weather Script for Conky (Lua)

Well this is the iwun text that I am working on..
It only gives info regarding the 10 day outlook in text form.    smile
Screenshot_from_2014_01_08_17_14_29.jpg
each date on right side is a button.
Still working on it.   smile

No gimp-fu yet   8o

Last edited by falldown (2014-01-09 01:33:10)

Offline

#92 2014-01-09 01:34:35

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

Re: Wun Weather Script for Conky (Lua)

falldown wrote:

Well this is the iwun text that I am working on..
No gimp-fu yet   8o

Eeeeek! pant pant pant <-- that's good BTW!  big_smile


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

Offline

#93 2014-01-09 02:46:25

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

Re: Wun Weather Script for Conky (Lua)

that is great falldown!

here are all the applicable data in metric
Screenshot_from_2014_01_08_20_22_17.jpg
then find metric, replace with imperial and here is the same data in imperial
Screenshot_from_2014_01_08_20_22_49.jpg

no other editing required smile

ill polish up this wun and post it in a bit
when the update is posted the following things will occur

any data options that ended in:

_f
_mph
_in
_mi

now ends in:

_imperial

any data options that ended in:

_c
_kph
_cm
_mm
_km
_mb

now ends in:

_metric

, should be easy to find and replace in an existing template


_imperial and _metric data options have a corresponding data option for unit

imperial data options and units

now.temp_imperial		now.temp_imperial_unit
now.wind_imperial		now.wind_imperial_unit
now.wind_gust_imperial		now.wind_gust_imperial_unit
now.pressure_imperial		now.pressure_imperial_unit
now.dewpoint_imperial		now.dewpoint_imperial_unit
now.heatindex_imperial		now.heatindex_imperial_unit
now.windchill_imperial		now.windchill_imperial_unit
now.feelslike_imperial		now.feelslike_imperial_unit
now.visibility_imperial		now.visibility_imperial_unit
now.precip_1hr_imperial		now.precip_1hr_imperial_unit
now.precip_today_imperial		now.precip_today_imperial_unit

day[i].high_imperial		day[i].high_imperial_unit
day[i].low_imperial		day[i].low_imperial_unit
day[i].rain_allday_imperial	day[i].rain_allday_imperial_unit
day[i].rain_day_imperial	day[i].rain_day_imperial_unit
day[i].rain_night_imperial	day[i].rain_night_imperial_unit
day[i].snow_allday_imperial	day[i].snow_allday_imperial_unit
day[i].snow_day_imperial	day[i].snow_day_imperial_unit
day[i].snow_night_imperial	day[i].snow_night_imperial_unit
day[i].maxwind_imperial		day[i].maxwind_imperial_unit
day[i].avewind_imperial		day[i].avewind_imperial_unit

hour[i].temp_imperial		hour[i].temp_imperial_unit
hour[i].dewpoint_imperial	hour[i].dewpoint_imperial_unit
hour[i].windchill_imperial	hour[i].windchill_imperial_unit
hour[i].heatindex_imperial	hour[i].heatindex_imperial_unit
hour[i].feelslike_imperial	hour[i].feelslike_imperial_unit
hour[i].rain_imperial		hour[i].rain_imperial_unit
hour[i].snow_imperial		hour[i].snow_imperial_unit
hour[i].pressure_imperial	hour[i].pressure_imperial_unit
hour[i].wind_imperial		hour[i].wind_imperial_unit

metric data options and units

now.temp_metric			now.temp_metric_unit
now.wind_metric			now.wind_metric_unit
now.wind_gust_metric		now.wind_gust_metric_unit
now.pressure_metric		now.pressure_metric_unit
now.dewpoint_metric		now.dewpoint_metric_unit
now.heatindex_metric		now.heatindex_metric_unit
now.windchill_metric		now.windchill_metric_unit
now.feelslike_metric		now.feelslike_metric_unit
now.visibility_metric		now.visibility_metric_unit
now.precip_1hr_metric		now.precip_1hr_metric_unit
now.precip_today_metric		now.precip_today_metric_unit

day[i].high_metric		day[i].high_metric_unit
day[i].low_metric		day[i].low_metric_unit
day[i].rain_allday_metric	day[i].rain_allday_metric_unit
day[i].rain_day_metric		day[i].rain_day_metric_unit
day[i].rain_night_metric	day[i].rain_night_metric_unit
day[i].snow_allday_metric	day[i].snow_allday_metric_unit
day[i].snow_day_metric		day[i].snow_day_metric_unit
day[i].snow_night_metric	day[i].snow_night_metric_unit
day[i].maxwind_metric		day[i].maxwind_metric_unit
day[i].avewind_metric		day[i].avewind_metric_unit

hour[i].temp_metric		hour[i].temp_metric_unit
hour[i].dewpoint_metric		hour[i].dewpoint_metric_unit
hour[i].windchill_metric	hour[i].windchill_metric_unit
hour[i].heatindex_metric	hour[i].heatindex_metric_unit
hour[i].feelslike_metric	hour[i].feelslike_metric_unit
hour[i].rain_metric		hour[i].rain_metric_unit
hour[i].snow_metric		hour[i].snow_metric_unit
hour[i].pressure_metric		hour[i].pressure_metric_unit
hour[i].wind_metric		hour[i].wind_metric_unit

just spotted a couple of ooopsies... off to fix

Offline

#94 2014-01-09 05:07:09

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

Re: Wun Weather Script for Conky (Lua)

i think i am done tinkering for today

things seem to be all settled down again, we shall see what tomorrow brings!

here is some big weather for you (900x900)
this template is metric/imperial switchable... just find and replace one with the other
Screenshot_from_2014_01_08_22_52_51.jpg
works with the latest update of wun

--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function(update,time,now,text_forecast,day,hour,astronomy)--#### DO NOT EDIT THIS LINE ##############
--#######################################################################
--these tables hold the coordinates for each repeat do not edit #########
top_left_xcoordinate={}--###############################################
top_left_ycoordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_metricont="URW Gothic L"--font must be in quotes
default_metricont_size=12
defaultmetricolor=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
out({a=1,fs=14,x=15,y=15,txt=now.observation_time})
out({a=1,fs=18,x=15,y=35,txt=now.weather})
gap=16
ypos=40+gap
out({a=1,fs=12,x=15,y=ypos,txt="Temp: "..now.temp_metric..now.temp_metric_unit})
out({a=1,fs=12,x=115,y=ypos,txt="Feels: "..now.feelslike_metric..now.feelslike_metric_unit})
out({a=1,fs=12,x=215,y=ypos,txt="Hum: "..now.humidity.."%"})
ypos=ypos+gap
out({a=1,fs=12,x=15,y=ypos,txt="Chill: "..now.windchill_metric..now.windchill_metric_unit})
out({a=1,fs=12,x=115,y=ypos,txt="Heat: "..now.heatindex_metric..now.heatindex_metric_unit})
out({a=1,fs=12,x=215,y=ypos,txt="Dew: "..now.dewpoint_metric..now.dewpoint_metric_unit})
ypos=ypos+gap
out({a=1,fs=12,x=15,y=ypos,txt="Vis: "..now.visibility_metric..now.visibility_metric_unit})
out({a=1,fs=12,x=115,y=ypos,txt="Pressure: "..now.pressure_metric..now.pressure_metric_unit})
ypos=ypos+gap
out({a=1,fs=12,x=15,y=ypos,txt="Wind: "..now.wind_metric..now.wind_metric_unit})
out({a=1,fs=12,x=115,y=ypos,txt=now.wind_degrees.."°"})
out({a=1,fs=12,x=175,y=ypos,txt=now.wind_dir})
ypos=ypos+gap
out({a=1,fs=12,x=15,y=ypos,txt="Gusts: "..now.wind_gust_metric..now.wind_gust_metric_unit})
image({x=210,y=ypos-30,h=60,w=60,file=now.wind_icon})
image({x=300,y=ypos-70,h=90,w=90,file=now.weather_icon})
ypos=ypos+gap
out({a=1,fs=12,x=15,y=ypos,txt="Rain this hour: "..now.precip_1hr_imperial..now.precip_1hr_metric_unit})
gap=15
ypos=ypos+gap
--text forecast section 
ypos=ypos+gap
out({x=15,y=ypos,txt=text_forecast[1].title})
ypos=ypos+gap
wrapy=out({wrap_len=50,wrap_gap=15,x=15,y=ypos,txt=text_forecast[1].fctext_metric})
ypos=ypos+gap+wrapy
out({x=15,y=ypos,txt=text_forecast[2].title})
ypos=ypos+gap
wrapy=out({wrap_len=50,wrap_gap=15,x=15,y=ypos,txt=text_forecast[2].fctext_metric})
ypos=ypos+gap+wrapy
out({x=15,y=ypos,txt=text_forecast[3].title})
ypos=ypos+gap
wrapy=out({wrap_len=50,wrap_gap=15,x=15,y=ypos,txt=text_forecast[3].fctext_metric})
ypos=ypos+gap+wrapy
out({x=15,y=ypos,txt=text_forecast[4].title})
ypos=ypos+gap
wrapy=out({wrap_len=50,wrap_gap=15,x=15,y=ypos,txt=text_forecast[4].fctext_metric})
ypos=ypos+gap+wrapy
--forecast repeat section
--set colum width
local column_width=340
--set row height
local row_height=150
--set coordinates first row at y=370
--row 1, column 1
top_left_xcoordinate[1]=(0*column_width)
top_left_ycoordinate[1]=ypos
--row 1, column 2
--top_left_xcoordinate[2]=(1*column_width)
--top_left_ycoordinate[2]=ypos
--row 2, column 1
top_left_xcoordinate[2]=(0*column_width)
top_left_ycoordinate[2]=ypos+(row_height*1)
--row 2, column 2
--top_left_xcoordinate[4]=(1*column_width)
--top_left_ycoordinate[4]=ypos+(row_height*1)
--row 3, column 1
top_left_xcoordinate[3]=(0*column_width)
top_left_ycoordinate[3]=ypos+(row_height*2)
--row 3, column 2
--top_left_xcoordinate[6]=(1*column_width)
--top_left_ycoordinate[6]=ypos+(row_height*2)
--start_number, when used to show days, hours or astronomy, this is the first instance that you want shown
--for example start_number=3 would show day 3 or hour 3
local start_number=1
--set total forecast days you want to display
--end number is the last instance you want to see
--eg with end_number=6 day 6 or hour 6 would be the last seen
local end_number=3
--########################################################################################
for i=start_number,end_number do --start of day repeat, do not edit ######################
tlx=top_left_xcoordinate[i-(start_number-1)] --sets top left x position for each repeat #
tly=top_left_ycoordinate[i-(start_number-1)] --sets top left y position for each repeat #
--########################################################################################
--WRITE REPEAT CODE HERE##use i in the square brackets within the loop [i]################
out({a=1,fs=14,x=tlx+15,y=tly,txt=day[i].weekday.." "..day[i].monthname.." "..day[i].day_pad})
out({a=1,fs=18,x=tlx+15,y=tly+18,txt=day[i].conditions})
ypos=32
gap=14
out({a=1,fs=12,x=tlx+15,y=tly+ypos,txt="High: "..day[i].high_metric..day[i].high_metric_unit})
out({a=1,fs=12,x=tlx+100,y=tly+ypos,txt="Low: "..day[i].low_metric..day[i].low_metric_unit})
out({a=1,fs=12,x=tlx+185,y=tly+ypos,txt="Hum: "..day[i].avehumidity.."%"})
ypos=ypos+gap
out({a=1,fs=12,x=tlx+15,y=tly+ypos,txt="Rain: "..day[i].precipitation.."%"})
out({a=1,fs=12,x=tlx+100,y=tly+ypos,txt="QPF: "..day[i].rain_allday_metric..day[i].rain_allday_metric_unit})
ypos=ypos+gap
out({a=1,fs=12,x=tlx+15,y=tly+ypos,txt="Day/Night: "..day[i].rain_day_metric..day[i].rain_day_metric_unit.." / "..day[i].rain_night_metric..day[i].rain_night_metric_unit})
ypos=ypos+gap
--out({a=1,fs=12,x=15,y=ypos,txt="Snow: "..day[i].precipitation.."%"})
out({a=1,fs=12,x=tlx+15,y=tly+ypos,txt="Snow All Day: "..day[i].snow_allday_metric..day[i].snow_allday_metric_unit})
ypos=ypos+gap
out({a=1,fs=12,x=tlx+15,y=tly+ypos,txt="Day/Night: "..day[i].snow_day_metric..day[i].snow_day_metric_unit.." / "..day[i].snow_night_metric..day[i].snow_night_metric_unit})
ypos=ypos+gap
out({a=1,fs=12,x=tlx+15,y=tly+ypos,txt="Ave Wind: "..day[i].avewind_metric..day[i].avewind_metric_unit})
out({a=1,fs=12,x=tlx+130,y=tly+ypos,txt=day[i].avewind_degrees.."°"})
out({a=1,fs=12,x=tlx+165,y=tly+ypos,txt=day[i].avewind_dir})	
ypos=ypos+gap
out({a=1,fs=12,x=tlx+15,y=tly+ypos,txt="Max Wind: "..day[i].maxwind_metric..day[i].maxwind_metric_unit})
out({a=1,fs=12,x=tlx+130,y=tly+ypos,txt=day[i].maxwind_degrees.."°"})
out({a=1,fs=12,x=tlx+165,y=tly+ypos,txt=day[i].maxwind_dir})
image({x=tlx+215,y=tly+ypos-60,h=60,w=60,file=day[i].avewind_icon})
image({x=tlx+300,y=tly,h=80,w=80,file=day[i].weather_icon})
--print (day[i].weather_icon)
--END OF REPEAT CODE######################################################################
end--of loop##############################################################################


--SECOND COLUMN############################################################################
--SECOND COLUMN############################################################################
--SECOND COLUMN############################################################################
--SECOND COLUMN############################################################################
--SECOND COLUMN############################################################################
--SECOND COLUMN############################################################################
--SECOND COLUMN############################################################################
--SECOND COLUMN############################################################################
--output plain text --setup loop--set start number
local start_number=1--renamed to start number as that makes more sense, also now that hours can be repeated, or anything else
--set end number
local end_number=5
--set x position, right justify text to this position
local rjx=550
--set topmost y coordinate
local topy=50
--set vertical distance between repeats
local ygap=150
--set vertical gap between lines
local lgap=15
--set coordinates for repeat
top_left_xcoordinate[1]=rjx
top_left_ycoordinate[1]=topy
top_left_xcoordinate[2]=rjx
top_left_ycoordinate[2]=topy+(ygap*1)
top_left_xcoordinate[3]=rjx
top_left_ycoordinate[3]=topy+(ygap*2)
top_left_xcoordinate[4]=rjx
top_left_ycoordinate[4]=topy+(ygap*3)
top_left_xcoordinate[5]=rjx
top_left_ycoordinate[5]=topy+(ygap*4)
--########################################################################################
for i=start_number,end_number do --start of day repeat, do not edit ######################
tlx=top_left_xcoordinate[i-(start_number-1)]--gets tlx coordinate for each repeat
tly=top_left_ycoordinate[i-(start_number-1)]--gets the coordinate for each repeat
--########################################################################################
out({hj="r",x=tlx,y=tly,txt="C.T. Begin/End:"})
tly=tly+lgap
out({hj="r",x=tlx,y=tly,txt="Sun Rise/Set:"})
tly=tly+lgap
out({hj="r",x=tlx,y=tly,txt="Sun Transit:"})
tly=tly+lgap
out({hj="r",x=tlx,y=tly,txt="Moon Rise:"})
tly=tly+lgap
out({hj="r",x=tlx,y=tly,txt="Moon Transit:"})
tly=tly+lgap
out({hj="r",x=tlx,y=tly,txt="Moon Set:"})
tly=tly+lgap
out({hj="r",x=tlx,y=tly,txt="Moon Phase:"})
tly=tly+lgap
out({hj="r",x=tlx,y=tly,txt="Moon Visible:"})
end--plain text repeat loop--]]

--[output values --setup loop--set start number
--need to empty the tables
--top_left_xcoordinate={}
--top_left_ycoordinate={}
local start_number=1--renamed to start number as that makes more sense, also now that hours can be repeated, or anything else
--set end number
local end_number=10
--set x position for first column, left justify text to this position
local ljx1=rjx+10
--set x position for first column, left justify text to this position
local ljx2=ljx1+120
--set topmost y coordinate
local topy=50--keep this coordinate, but apply a negative to get day name and date in the loop
--set vertical distance between repeats
local ygap=ygap--stays the same
--set vertical gap between lines
local lgap=15--stays the same
--set coordinates for repeat
--first column, same y different x
top_left_xcoordinate[1]=ljx1
top_left_ycoordinate[1]=topy
top_left_xcoordinate[2]=ljx2
top_left_ycoordinate[2]=topy
--second column, same y different x
top_left_xcoordinate[3]=ljx1
top_left_ycoordinate[3]=topy+(ygap*1)
top_left_xcoordinate[4]=ljx2
top_left_ycoordinate[4]=topy+(ygap*1)
--third column, same y different x
top_left_xcoordinate[5]=ljx1
top_left_ycoordinate[5]=topy+(ygap*2)
top_left_xcoordinate[6]=ljx2
top_left_ycoordinate[6]=topy+(ygap*2)
--4th column, same y different x
top_left_xcoordinate[7]=ljx1
top_left_ycoordinate[7]=topy+(ygap*3)
top_left_xcoordinate[8]=ljx2
top_left_ycoordinate[8]=topy+(ygap*3)
--5th column, same y different x
top_left_xcoordinate[9]=ljx1
top_left_ycoordinate[9]=topy+(ygap*4)
top_left_xcoordinate[10]=ljx2
top_left_ycoordinate[10]=topy+(ygap*4)
--########################################################################################
for i=start_number,end_number do --start of day repeat, do not edit ######################
tlx=top_left_xcoordinate[i-(start_number-1)]--gets tlx coordinate for each repeat
tly=top_left_ycoordinate[i-(start_number-1)]--gets the coordinate for each repeat
--########################################################################################
tly=tly-15
out({hj="l",x=tlx,y=tly,txt=day[i].weekday_short.." "..day[i].day_pad.."/"..day[i].month_pad})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].begin_civil_twilight.." / "..astronomy[i].end_civil_twilight})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].sunrise.." / "..astronomy[i].sunset})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].sun_transit})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].moonrise[1].." / "..astronomy[i].moonrise[2]})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].moon_transit[1]})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].moonset[1].." / "..astronomy[i].moonset[2]})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].moon_phase})
tly=tly+lgap
out({hj="l",x=tlx,y=tly,txt=astronomy[i].moon_visible.."%"})
end--plain text repeat loop--]]
--########################################################################################

--it would be possible to do this all in one repeat loop, but that would be more co
--print (text_forecast[20].period)
--[[testing section
timestable={
["00:00"]={},
["00:20"]={},
["00:40"]={},
["01:00"]={},
["01:20"]={},
["01:40"]={},
["02:00"]={},
["02:20"]={},
["02:40"]={},
["03:00"]={},
["03:20"]={},
["03:40"]={},
["04:00"]={},
["04:20"]={},
["04:40"]={},
["05:00"]={},
["05:20"]={},
["05:40"]={},
["06:00"]={},
["06:20"]={},
["06:40"]={},
["07:00"]={},
["07:20"]={},
["07:40"]={},
["08:00"]={},
["08:20"]={},
["08:40"]={},
["09:00"]={},
["09:20"]={},
["09:40"]={},
["10:00"]={},
["10:20"]={},
["10:40"]={},
["11:00"]={},
["11:20"]={},
["11:40"]={},
["12:00"]={},
["12:20"]={},
["12:40"]={},
["13:00"]={},
["13:20"]={},
["13:40"]={},
["14:00"]={},
["14:20"]={},
["14:40"]={},
["15:00"]={},
["15:20"]={},
["15:40"]={},
["16:00"]={},
["16:20"]={},
["16:40"]={},
["17:00"]={},
["17:20"]={},
["17:40"]={},
["18:00"]={},
["18:20"]={},
["18:40"]={},
["19:00"]={},
["19:20"]={},
["19:40"]={},
["20:00"]={},
["20:20"]={},
["20:40"]={},
["21:00"]={},
["21:20"]={},
["21:40"]={},
["22:00"]={},
["22:20"]={},
["22:40"]={},
["23:00"]={},
["23:20"]={},
["23:40"]={},
}

s="05:20"
local intable=loadstring("return timestable[\""..s.."\"]")()
	if intable then 
	loadstring("return table.insert(timestable[\""..s.."\"],10)")()
	else
	--print ("not found")
	end
--]]
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--########################################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################

if you have run any of the latest wun.lua you will have seen these lines in the terminal

gathered sun azi/alt 1 of 2
gathered sun azi/alt 2 of 2
gathered moon azi/alt 1 of 2
gathered moon azi/alt 2 of 2

this is the next phase of wun, but i think first i need to attend to crossing the t's and dotting the i's of the current script

then i will only update with bug fixes and wait until the azimuth/altitude section is finished before posting it!

Offline

#95 2014-01-09 07:41:12

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

I think I might have figured out my problem with iweather.lua.
Got an email fro wunderground about exceeding my 500 calls, turns out my (very old) key was associated with the stratus plan so I upgraded to anvil. Now I get this...

joe@crunchbang:~$ killall conky
joe@crunchbang:~$ conky -c ~/wun/wunrc
Conky: desktop window (155) is root window
Conky: window type - normal
Conky: drawing to created window (0x1a00001)
Conky: drawing to double buffer
data url= http://api.wunderground.com/api/key/conditions/forecast10day/astronomy/hourly/lang:EN/q/38343.json
gathering weather data 1/3
downloaded text data for 20 time periods, padded info for 0 time periods
downloaded data for 10 days, padded info for 0 days
downloaded data for 36 hours, padded info for 0 hours
weather data processed
getting astronomy data
downloaded data for 10 days, padded info for 0 days
astronomy data processed
gathered sun azi/alt 1 of 2
gathered sun azi/alt 2 of 2
gathered moon azi/alt 1 of 2
gathered moon azi/alt 2 of 2
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/iweather.lua:78: attempt to concatenate field 'temp_f' (a nil value)
^CConky: received SIGINT or SIGTERM to terminate. bye!
joe@crunchbang:~$

and this...
iweather_error_tmb.jpg
I've updated to the most recent wun.lua and additional_files folder.
At least it's a change even if it's still not working. smile


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

Offline

#96 2014-01-09 08:46:20

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

Re: Wun Weather Script for Conky (Lua)

@jst_joe ... glad you are making progress! smile

the problem is with the data options
the recent update implemented quite a few option names changing
see a couple of posts up
http://crunchbang.org/forums/viewtopic. … 91#p355391

i apologize for the inconvenience in having to edit templates, but i think the change was worth it
you can do most of the name changes via find/replace just be careful when replacing _f and _c as other things contain that sequence

ill rework the iweather.lua tomorrow to the new format!  then hopefully everything will be up and running

as far as your api calls go, i have my interval set at 1800 (30 mins) and even with all the strarts and restarts i havnt reached 500 smile

Offline

#97 2014-01-09 15:39:27

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

^ Yeah I figure some difference is better than none. smile
I saw the post and will apply the template changes later today.

mrpeachy wrote:

as far as your api calls go, i have my interval set at 1800 (30 mins) and even with all the strarts and restarts i havnt reached 500 smile

I've bumped mine up to 15 mins, I figured all the killalls and restarts I've done over the last few days caused it.


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

Offline

#98 2014-01-09 17:20:13

Habitual
#! Member
From: Youngstown, OH
Registered: 2010-09-10
Posts: 62
Website

Re: Wun Weather Script for Conky (Lua)

anyone else's interactive go all senile today?

Suddenly, it's taking "ages" to acquire the data and draws nothing but the frame on my desktop.

10 day forecast:

via c-line it shows no errors with this output:

Conky: desktop window (1400003) is subwindow of root window (29a)
Conky: window type - normal
Conky: drawing to created window (0x2600001)
Conky: drawing to double buffer
gathering weather data 1/3
http://api.wunderground.com/api/<my_key>/conditions/forecast10day/astronomy/hourly/lang:EN/q/OH/Youngstown.json
gathering weather data 2/3
http://api.wunderground.com/api/<my_key>/conditions/forecast10day/astronomy/hourly/lang:EN/q/OH/Youngstown.json
gathering weather data 3/3
http://api.wunderground.com/api/<my_key>/conditions/forecast10day/astronomy/hourly/lang:EN/q/OH/Youngstown.json
own_window_title=interactiveconkyrc
3375	5	13300880	39845889	/tmp/xdo
Conky: '/home/jj/wun/wunrc' modified, reloading...
Conky: desktop window (1400003) is subwindow of root window (29a)
Conky: window type - normal
Conky: drawing to created window (0x2600001)
Conky: drawing to double buffer
gathering weather data 1/3
http://api.wunderground.com/api/<my_key>/conditions/forecast10day/astronomy/hourly/lang:EN/q/OH/Youngstown.json
gathering weather data 2/3
http://api.wunderground.com/api/<my_key>/conditions/forecast10day/astronomy/hourly/lang:EN/q/OH/Youngstown.json
gathering weather data 3/3
http://api.wunderground.com/api/<my_key>/conditions/forecast10day/astronomy/hourly/lang:EN/q/OH/Youngstown.json
own_window_title=interactiveconkyrc
3375	5	13304855	39845889	/tmp/xdo
x:3748 y:622 screen:0 window:39845889

I restarted it a couple of times today to "redraw" the HOURS + LESS|MORE" button objects successfully without issue. This time, box with nothing.

Thanks!


Success is 1% Inspiration
and 98% Perspiration and
2% atttention to details.

Offline

#99 2014-01-09 17:24:55

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

Re: Wun Weather Script for Conky (Lua)

@ Habitual

Same thing for me .. finished editing some stuff and waited for ever ...  I though I had done an "Oops!"

BTW: Both  interactive and the static have gone all senile on me ...

hmmmm.....

HOWEVER ...

I don't think it is the scripts fault.  Trying wunderground in Iceweasel and it's like there is nothing there....
2014_01_09_14_25_05_1113x376_Sector11.jpg
... five minutes now.

Last edited by Sector11 (2014-01-09 17:38:02)


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

Offline

Be excellent to each other!

#100 2014-01-09 17:27:40

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

Me 3! lol


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

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: acrobat

Debian Logo