SEARCH

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

You are not logged in.

#76 2011-12-31 03:52:41

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

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

mrpeachy wrote:

i have some ideas, but im wondering how to implement it

I just has a thought.... would that be something like wlourf's "rotate" script?

Rotating Conky, if not, it might be a place to start.


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

Offline

Help fund CrunchBang, donate to the project!

#77 2011-12-31 03:55:38

handy
Member
Registered: 2011-12-31
Posts: 34

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

mrpeachy wrote:

....

can you post your conky rc
and the setup portion of the lua script and ill see if i can track down the problem

I've got the weathericons working.

Do you still want to see the script?

Offline

#78 2011-12-31 04:14:20

handy
Member
Registered: 2011-12-31
Posts: 34

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

[edit:] Wiped.

I thought not.

Last edited by handy (2011-12-31 04:37:25)

Offline

#79 2011-12-31 04:17: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!

@ Sector11 ,yes, something like that script... to get the rotation i would need everything to be displayed generated inside the lua script rather than via the conkyrc with lua_parse (as it currently is)

@handy, if its fixed than no need to post your files

Offline

#80 2011-12-31 04:43:15

handy
Member
Registered: 2011-12-31
Posts: 34

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

I've just started to move things to change how conky displays the text & the images. The basic ("Now" at the top); the left column & the images are easy enough. I'm just about to embark on the right hand column, which will be an education.

[edit:] Spaces will get me there, if I stay in 2 columns, moving to 3 columns looks like it would get pretty ugly in the text editor.

It just occurred to me that perhaps I could make another conky script that shows the last four days & then I could position it beside the first window? I haven't looked into it at all as far as the Lua side of it is concerned, but I will.

Last edited by handy (2011-12-31 05:03:41)

Offline

#81 2011-12-31 06:41:54

handy
Member
Registered: 2011-12-31
Posts: 34

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

I moved the 10 days & their weathericons around & then loaded up my standard conky.

A (not too sharp) screenshot is here: http://www.users.on.net/~thehands/windowshot.html

I'll change the colours of the fonts & who knows what else will come to mind later.

As the forecast sits now I get the overview of days 7 & 8, which is certainly worthwhile.

I'll give that lot a break for a while now so I can stop counting spaces!

Offline

#82 2011-12-31 10:03:20

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

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

looking good handy

actually i had an idea about the weather script and did some research into lua functions and came across something that has led to an almost entire re-write of the script (in progress)

the available output will be the same, but its significantly simplified compared to the original script and so far is running a lot lighter on the cpu

still thinking about how the scroll function can be implemented, but hang on for some new code in the next day or so big_smile

Last edited by mrpeachy (2011-12-31 10:04:11)

Offline

#83 2011-12-31 11:15:01

handy
Member
Registered: 2011-12-31
Posts: 34

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

I didn't take much of a break. I went through & changed the colours & put forecast.7 & my "normal" conkyrc on the desktops of both of my machines. They both run 24" monitors but different resolutions.

Please bear in mind that my desktops aren't built to be works of art, they are to be easy on my eyes.

To that end I may end up making the weather-icons smaller after some more use/experience, though really I don't normally spend much time looking at the blank desktop anyway. Though it is now far from its normal blank.

Here is a link to a couple of blurry pictures that show the current state of play:

http://www.users.on.net/~thehands/windowshot.html

Last edited by handy (2011-12-31 11:15:56)

Offline

#84 2011-12-31 11:36:46

handy
Member
Registered: 2011-12-31
Posts: 34

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

mrpeachy, you do keep yourself busy. smile

It sounds like you have made a kind of a break through by what you wrote. It will be very interesting to see what you come up with.

I look forward to the next release. big_smile

Offline

#85 2011-12-31 13:40:32

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

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

handy wrote:

mrpeachy, you do keep yourself busy. smile

It sounds like you have made a kind of a break through by what you wrote. It will be very interesting to see what you come up with.

I look forward to the next release. big_smile

Oh - you and I both.  big_smile


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

Offline

#86 2011-12-31 18:35: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!

here is the first working incarnation of the new script in action
screenshote66e76cd861ce3a11eb17dffa5bd953d.png
you can see the cpu usage way down from the previous version
the lua script is activated on a timer
a template is written in the lua script inside a table

template={
"${font mono:size=20}Weather Forecast",
"${font mono:size=16}"..forecast_day[1].."${font}",
"Conditions: "..conditions[1],
"High: "..high_temp[1].."°F,  Low: "..low_temp[1].."°F",
"Sun Rise: "..sun_rise[1]..", Sun Set: "..sun_set[1],
"Moon Rise: "..moon_rise[1]..", Moon Set: "..moon_set[1],
"UV Index: "..uv_index[1],
"Relative Humidity: "..humidity[1],
"Precipitation: "..precipitation[1],
"Snow Probability: "..snow[1],
"Cloud Coverage: "..cloud_cover[1],
"Moon Phase: "..moon_phase[1],
"Wind Speed: "..wind_speed[1],
"Wind Direction: "..wind_direction[1],


"${font mono:size=16}"..forecast_day[2].."${font}",
"Conditions: "..conditions[2],
"High: "..high_temp[2].."°F,  Low: "..low_temp[2].."°F",
"Sun Rise: "..sun_rise[2]..", Sun Set: "..sun_set[2],
"Moon Rise: "..moon_rise[2]..", Moon Set: "..moon_set[2],
"UV Index: "..uv_index[2],
"Relative Humidity: "..humidity[2],
"Precipitation: "..precipitation[2],
"Snow Probability: "..snow[2],
"Cloud Coverage: "..cloud_cover[2],
"Moon Phase: "..moon_phase[2],
"Wind Speed: "..wind_speed[2],
"Wind Direction: "..wind_direction[2],
}
template=table.concat(template,"\n")
local file = io.open(location, "w")
file:write(template)
file:close()

then the table is written to a text file so in the conkyrc you only using the cat command to print the output

lua_load ~/lua/weatheragain.lua
lua_draw_hook_pre draw_fig

template1 /home/benjamin/Desktop/weather.txt
TEXT
cpu: ${cpu}
${execpi 60 cat ${template1}}

Last edited by mrpeachy (2011-12-31 18:36:23)

Offline

#87 2011-12-31 20:40:59

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

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

mrpeachy wrote:

here is the first working incarnation of the new script in action

Now that looks promising.

Can the "template" can use any conky formatting commands?
- ${goto} ${voffset} ${color6}
What about images?

yea yea I know:

here is the first working incarnation of the new script in action

I'm just curious.  big_smile

Did you see this! <<-- your weather.

Last edited by Sector11 (2011-12-31 20:42:11)


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

Offline

#88 2011-12-31 22:18:10

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

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

ive just been working on putting the images and weather fonts in
screenshot-1298.png

from this template in the lua script

template={
"${font mono:size=20}Weather Forecast",
"${font mono:size=16}"..forecast_day[1]..", "..forecast_date[1].."${font}",
"Conditions: "..conditions[1],
"High: "..high_temp[1].."°F,  Low: "..low_temp[1].."°F",
"Sun Rise: "..sun_rise[1]..", Sun Set: "..sun_set[1],
"Moon Rise: "..moon_rise[1]..", Moon Set: "..moon_set[1],
"UV Index: "..uv_index[1],
"Relative Humidity: "..humidity[1],
"Precipitation: "..precipitation[1],
"Snow Probability: "..snow[1],
"Cloud Coverage: "..cloud_cover[1],
"Moon Phase: "..moon_phase[1],
"Wind Speed: "..wind_speed[1],
"Wind Direction: "..wind_direction[1],
"${image "..weather_icon[1].." -p 0,220 -s 50x50}${goto 80}${font ConkyWeather:size=22}"..weather_font[1].."${goto 140}${font ConkyWindNESW:size=22}"..wind_font[1].."${goto 200}${font Moon Phases:size=22}"..moon_font[1],

"${font mono:size=16}"..forecast_day[2].." "..forecast_day_short[2].." ${font}",
"Conditions: "..conditions[2],
"High: "..high_temp[2].."°F,  Low: "..low_temp[2].."°F",
"Sun Rise: "..sun_rise[2]..", Sun Set: "..sun_set[2],
"Moon Rise: "..moon_rise[2]..", Moon Set: "..moon_set[2],
"UV Index: "..uv_index[2],
"Relative Humidity: "..humidity[2],
"Precipitation: "..precipitation[2],
"Snow Probability: "..snow[2],
"Cloud Coverage: "..cloud_cover[2],
"Moon Phase: "..moon_phase[2],
"Wind Speed: "..wind_speed[2],
"Wind Direction: "..wind_direction[2],
"${image "..weather_icon[2].." -p 0,445 -s 50x50}${goto 80}${font ConkyWeather:size=22}"..weather_font[2].."${goto 140}${font ConkyWindNESW:size=22}"..wind_font[2].."${goto 200}${font Moon Phases:size=22}"..moon_font[2],
}

you can use any regular conky object as you will be using execpi to parse the text file in the conkyrc which will recognise the objects

one thing is that i might get into trouble with the number of concatenation (ie the number of times .. is used to insert variables)

Offline

#89 2011-12-31 23:53: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!

here is 5 days of weather, every output available and no problems yet, and cpu holding at around 6%

screenshot33f3d77ba8d5267979cacc3776234d7d.png

i think the concat problem is when everything is in the same line
but in setting up the template, each line of the table gets put together seperately, then put together to output
so i dont think ill run into the problem

Offline

#90 2012-01-01 00:43:33

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

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

ok so here is the script if you want to give it a try

http://crunchbanglinux.org/pastebin/1409

in conkyrc you need this in addition to your regular settings

template1 /home/benjamin/Desktop/weather.txt
TEXT
${execpi 10 cat ${template1}}

template1 needs to be the same as "location" set at the top of the lua

to do
add current conditions section
currently you can get 10 forecast days including todays forecast

Offline

#91 2012-01-01 00:49:09

handy
Member
Registered: 2011-12-31
Posts: 34

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

Hi mrpeachy, what you are doing really looks great!

Something that occurred to me, (I'm no programmer, though I did teach myself a language around 20 years ago & intently work on my own small project for 6 months before it drove me mad! lol I've done next to nothing since then.)

can in your template, you use just one day that is then used for as many iterations of days afterward?

It would make the Lua so much easier to manipulate;- the number of days & the way it is displayed.

What I've just said is just as likely what you are doing & its gone over my head anyway. lol

Either way & anyway, great stuff.

[edit:] I haven't looked at your just posted script yet. We were cross posting again. smile

Last edited by handy (2012-01-01 00:50:53)

Offline

#92 2012-01-01 00:57:16

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

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

handy wrote:

Hi mrpeachy, what you are doing really looks great!

Something that occurred to me, (I'm no programmer, though I did teach myself a language around 20 years ago & intently work on my own small project for 6 months before it drove me mad! lol I've done next to nothing since then.)

can in your template, you use just one day that is then used for as many iterations of days afterward?

It would make the Lua so much easier to manipulate;- the number of days & the way it is displayed.

What I've just said is just as likely what you are doing & its gone over my head anyway. lol

Either way & anyway, great stuff.

[edit:] I haven't looked at your just posted script yet. We were cross posting again. smile

yes, his is certainly possible
the difficulty is that text manipulation and display is far more cumbersome using the lua method than the conky method.  There are no "in line" operations in lua to set colors and fonts and font sizes and text needs to be positioned and written with show-text command

ive been thinking about a way to put settings in line which are later interpreted by other functions to display the text

but now that i think of it would be possible to use a for loop to change the day number and append the text file with each iteration of the loop...

Offline

#93 2012-01-01 02:16:45

handy
Member
Registered: 2011-12-31
Posts: 34

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

mrpeachy I'm running your new script. I haven't edited "--the end of timed section" as yet.

I get the following line of characters across the top of the forecast.8.conky on screen (as in not windowed) display:

Clear|25|25|25|Unl|25|6|11|8|80|E|41|30|<>Sunday|January 

Apart from that I haven't noticed any problems in the few minutes that it has been running. wink

[edit:] I just did the --end of timed section edits.

Your note at the bottom of the .lua script says that the previous line number that needs to be commented out is 362, it is actually 357.

That's about the limit of my ability to find bugs in your code mr.P. smile

Last edited by handy (2012-01-01 02:35:39)

Offline

#94 2012-01-01 02:34:42

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

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

handy wrote:

mrpeachy I'm running your new script. I haven't edited "--the end of timed section" as yet.

I get the following line of characters across the top of the forecast.8.conky on screen (as in not windowed) display:

Clear|25|25|25|Unl|25|6|11|8|80|E|41|30|<>Sunday|January 

Apart from that I haven't noticed any problems in the few minutes that it has been running. wink

that looks like the original weather text from the previous script
just edit the file directly and delete that line

Offline

#95 2012-01-01 03:06:37

handy
Member
Registered: 2011-12-31
Posts: 34

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

I deleted that line but it just gave me a different one on restarting.

I searched for "weather.txt" in both the conky & the .lua & made sure that my path was right, which is:

/home/handy/conky/intelli-weather.txt

As intelli-weather.txt is the name that the file creates for itself here.

I have deleted the intelli-weather.txt file (more than once) & restarted but I still get the first string in the file printed across the top of the screen?

Last edited by handy (2012-01-01 03:08:04)

Offline

#96 2012-01-01 03:12:39

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

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

@handy

strange
have you killed and restarted conky?
what lua setup lines do you have in your conkyrc?
do you just have the one conkyrc running? and only running the latest weather script?

Offline

#97 2012-01-01 03:40:49

handy
Member
Registered: 2011-12-31
Posts: 34

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

Yes I have killed & restarted multiple times.

I just noticed this one, which I don't think I need:

lua_load ~/Conky/LUA/draw_bg.lua

##############################################  End Miscellaneous Section  ###
###  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
top_name_width 7

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

## following line needed for forecast.8.lua <<<<<<<--------------
template1 /home/handy/conky/intelli-weather.txt

TEXT

I have a conkyrc which is just system stuff, no weather. I hadn't stopped that one to test, I'll do it now.

I'm only running the weather script that you most recently linked to in this thread.
__________

I just stopped them both & restarted only the weather.lua conky & I still have the problem.

It is always possible that I have done something dumb, but of course I don't know what it may be.

Offline

#98 2012-01-01 03:46:01

handy
Member
Registered: 2011-12-31
Posts: 34

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

I just spotted it when reviewing what I wrote to you after it was posted.

In the lua section of the conkyrc I was calling the previous version of the lua . <doh!>

I'll start cleaning up the mess.

Last edited by handy (2012-01-01 03:46:47)

Offline

#99 2012-01-01 04:22:33

handy
Member
Registered: 2011-12-31
Posts: 34

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

Things aren't going so smoothly now:

I rebooted my machine with just the forecast.8.conky set to autostart in openbox. I couldn't connect to the internet?

I tried two boots same result.

So I removed forecast.8.conky from the autostart & it started fine with internet functioning fine.

Then I started it via the terminal & got a never ending flow of errors. It couldn't use the internet to get the intelli-weather.txt info'.

& it was impossible to kill via htop. To the point that it would crash htop in trying.

In the terminal these errors:

handy ~  $  
Conky: desktop window (131) is root window
Conky: drawing to desktop window
Conky: drawing to double buffer
Conky: llua_do_call: function conky_weatherdata execution failed: attempt to call a nil value
cat: /home/handy/conky/intelli-weather.txt: No such file or directory
Conky: llua_getstring: function conky_weather didn't return a string, result discarded
Conky: llua_getstring: function conky_weather didn't return a string, result discarded

--------- <snip> lots of these  then the following  -------

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67936  100 67936    0     0  10817      0  0:00:06  0:00:06 --:--:-- 15381
Conky: llua_do_call: function conky_weather execution failed: /home/handy/conky/lua/forecast.8.lua:393: attempt to concatenate field '?' (a nil value)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67936  100 67936    0     0  26295      0  0:00:02  0:00:02 --:--:-- 32258
Conky: llua_do_call: function conky_weather execution failed: /home/handy/conky/lua/forecast.8.lua:393: attempt to concatenate field '?' (a nil value)

-------<snip>----- these went on until I killed it with a command 

Offline

Help fund CrunchBang, donate to the project!

#100 2012-01-01 04:54:01

handy
Member
Registered: 2011-12-31
Posts: 34

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

I'm having the internet problem now with any version of conky weather or not!

So perhaps if you hadn't already you should take my above post with a grain of salt.

I'm too tired to start checking logs & things to try to work out what the hell is going on on this machine.  I'll get to it later.

Sorry for wasting your time.

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