SEARCH

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

You are not logged in.

#151 2012-01-07 23:32:51

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... hmmmmm

@ackernan
can you post your settings section from the lua script so i can test... perhaps there are some... perhaps there are some differences between the code and the code i get (which is what the script is based on)

@falldown
when you say it last 5-10 minutes.. do you get errors in terminal when it goes wrong?
did you change the update interval in the settings?

@dodge ram
can you post your lua script and conkyrc, and ill test it out

all the problems i get with the script (the same errors others are getting) are due to misfires of the curl commands
seems i have some work to do! big_smile

Last edited by mrpeachy (2012-01-07 23:43:38)

Offline

Be excellent to each other!

#152 2012-01-08 00:04:04

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

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

mrpeachy wrote:

ok... hmmmmm

@ackernan
can you post your settings section from the lua script so i can test... perhaps there are some... perhaps there are some differences between the code and the code i get (which is what the script is based on)

I started to post a reply then I checked again and now everything is working. hmm

Thanks for the help MrPeachy.  It looks good, now that it's working.

What's the letters, numbers, & punctuation after the temps?

Screenshot_at_2012_01_07_19_18_09.jpg

Here's the setup for the lua script..

 --#########################################################################################################
    --SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
    secs=1800--set update interval
    web="http://www.intellicast.com/Local/Forecast.aspx?location=USKY1079"--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
    --set location of weather images
    weathericons="/home/tony/.conky/weathericons/"
    --set defaults
    default_font="mono"--font must be in quotes
    default_font_size=10
    default_color=0xffffff--white
    default_alpha=1--fully opaque
    default_image_width=50
    default_image_height=50
    --SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
    --###############################################################

Last edited by ackernan (2012-01-08 00:22:55)

Offline

#153 2012-01-08 00:27:57

Dodge ram
#! CrunchBanger
Registered: 2011-04-26
Posts: 140

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

This is the tar file that sector11 sent me http://dl.dropbox.com/u/30953293/wea_conky.tar.gz

This is what I have adjusted  http://dl.dropbox.com/u/30953293/wea_conky%20als.tar.gz

Offline

#154 2012-01-08 01:00:29

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

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

ackernan wrote:

What's the letters, numbers, & punctuation after the temps?

those are the symbols to get the moon font and wind direction font

here are the fonts to install

http://ompldr.org/vYzRtNw

Offline

#155 2012-01-08 01:42: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!

re lua only weather aka v9000
i was getting an error associated with this line too

 
now["conditions_caps"]=string.upper(t)

i think the problem was that my search and match expressions were not accurate enough and so sometimes did not work, so i have rewritten the expressions which should solve that problem
them i found that when wind speed is 0mph, intellicast changes its output for direction to "NA NA" which i hadnt anticipated when writing that match expression
i have solved that one too

i have written some code to take into account curl misfires
if the curl command times out (1 minute) then the script will keep trying curl until it returns data

here is updated code for anyone willing to try smile
--removed--

a minute after posting the above i realised i needed some more fixes
take into account negative numbers in the forecast data
and in my setup i had the low temp for day 1 showing for all days
fixed here big_smile
--removed--

as always i appreciate the time taken by testing
each bug fixed makes the script better!

Last edited by mrpeachy (2012-01-08 02:04:26)

Offline

#156 2012-01-08 01:43:21

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:

- Error Will Smith
- Huston - we have a problem
- re-calculando!

4a755f168588196.jpg
Been one strange day ... maybe tomorrow will be better!

EDIT:  Grabbed the new scripts above - 38°C here does that count???

Last edited by Sector11 (2012-01-08 01:47:44)


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

Offline

#157 2012-01-08 01:55: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!

Sector11 wrote:
mrpeachy wrote:

- Error Will Smith
- Huston - we have a problem
- re-calculando!

4a755f168588196.jpg
Been one strange day ... maybe tomorrow will be better!

EDIT:  Grabbed the new scripts above - 38°C here does that count???

et tu Sector11?
did you change the setting in the web address from F to C?

Offline

#158 2012-01-08 02:12:17

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

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

fixed a couple of dumb mistakes i made fixing the previous bugs!
here is the testing regular edition
http://crunchbanglinux.org/pastebin/1431

here is the circle display using the updated processing code
http://crunchbanglinux.org/pastebin/1429

hope i dont break pastebin!

Last edited by mrpeachy (2012-01-08 02:52:14)

Offline

#159 2012-01-08 02:21:06

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:

et tu Sector11?
did you change the setting in the web address from F to C?

You misunderstood ... it really is (was) 38°C here today ... I think I fried my brain!

Anyway to continue ... I grabbed the new script ... if it wasn't for bad luck with LUA I'd have NO luck at all:

  23:16:55 ~
         $ conky -c ~/LUA_v9001/9000.conky &
[1] 29908

  23:17:20 ~
         $ Conky: desktop window (1ff) is root window
Conky: window type - override
Conky: drawing to created window (0x2800002)
Conky: drawing to double buffer
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67925  100 67925    0     0  47252      0  0:00:01  0:00:01 --:--:-- 97874
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67925  100 67925    0     0  80114      0 --:--:-- --:--:-- --:--:--   99k
Conky: llua_do_call: function conky_weather execution failed: /home/sector11/LUA_v9001/v9001.lua:421: bad argument #1 to '?' (string expected, got nil)
Conky: llua_do_call: function conky_weather execution failed: /home/sector11/LUA_v9001/v9001.lua:421: bad argument #1 to '?' (string expected, got nil)
Conky: llua_do_call: function conky_weather execution failed: /home/sector11/LUA_v9001/v9001.lua:421: bad argument #1 to '?' (string expected, got nil)
Conky: llua_do_call: function conky_weather execution failed: /home/sector11/LUA_v9001/v9001.lua:421: bad argument #1 to '?' (string expected, got nil)
Conky: llua_do_call: function conky_weather execution failed: /home/sec....

~/LUA_v9001/9000.conky

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

###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints below,sticky,skip_taskbar,skip_pager
# own_window_colour brown
own_window_class Conky 9000
own_window_title Conky 9000

# 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 1024 5     ## width, height
maximum_width 1024       ## width, usually a good idea to equal minimum width

gap_x 7        ### left &right
gap_y 7        ### up & down

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

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 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  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
## lua_load ~/Conky/LUA/draw_bg.lua
## TEXT
## ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
##
## OR Both above TEXT (No composite manager required - no blinking!)
lua_load ~/Conky/LUA/draw_bg.lua
##lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
##
#######################################################  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 /home/sector11/LUA_v9001/v9001.lua
lua_draw_hook_pre weather

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

v9001.lua

--even more weather by mrpeachy 01/07/12
require 'cairo'
require 'imlib2'
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
--#########################################################################################################
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
secs=1800--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
--set location of weather images
weathericons="/home/sector11/LUA_v9001/weathericons/"
--set defaults
default_font="mono"--font must be in quotes
default_font_size=10
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
--#########################################################################################################
--############start of timed section#######################################################################
--#########################################################################################################
local updates=tonumber(conky_parse('${updates}'))
local timer=(updates %secs)+1
--#######################################
if timer==secs or updates==6 then--######
--#######################################
--memory recording function
local f=io.popen("top -b -n1 | grep 'conky' | awk '{print$10}'")
memory_used=f:read("*a")
f:close()
local file = io.open("/home/sector11/LUA_v9001/memory.txt", "a")
file:write(os.date("%H:%M")..memory_used)
file:close()
-----------------------------------
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/sector11/LUA_v9001/weather.txt")
allweather=f:read("*a")
f:close()
if allweather~=nil then
allweather=string.gsub(allweather,"[\n\r]","")
end
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- >/home/sector11/LUA_v9001/weather.txt")
nowweather=f:read("*a")
f:close()
if nowweather~=nil then
nowweather=string.gsub(nowweather,"[\n\r]","")
end
processall=1
processnow=1
end--of timed data gathering section
--#####################################################
--in case curl craps up it should retry until it works
testall=string.find(allweather,"%a")
testnow=string.find(nowweather,"%a")
if testall==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A565 '10 Day Forecast' | sed 's/%//g'")-- > /home/sector11/LUA_v9001/weather.txt")
allweather=f:read("*a")
f:close()
allweather=string.gsub(allweather,"[\n\r]","")
processall=1
end
-----------------------------------------
if testnow==nil then
local f=io.popen("curl --max-time 60 '"..web.."' | grep -A120 '>Current Conditions&nbsp' | sed 's/%//g'")-- > /home/sector11/LUA_v9001/weather.txt")
nowweather=f:read("*a")
f:close()
nowweather=string.gsub(nowweather,"[\n\r]","")
processnow=1
end
--end or curl reruns
testall=string.find(allweather,"%a")
testnow=string.find(nowweather,"%a")
if testall~=nil and testnow~=nil and processall==1 and processnow==1 then
--process data
--intellicast to conky weather icon conversion
wimage={
wx_65="32",
wx_66="30",
wx_67="26",
wx_68="32",
wx_69="28",
wx_70="20",
wx_71="32",
wx_72="21",
wx_73="36",
wx_74="14",
wx_75="28",
wx_76="18",
wx_77="14",
wx_78="23",
wx_79="05",
wx_80="15",
wx_81="15",
wx_82="11",
wx_83="16",
wx_84="00",
wx_85="32",
wx_86="25",
wx_87="09",
wx_88="05",
wx_89="18",
wx_90="18",
wx_91="39",
wx_92="39",
wx_93="39",
wx_94="39",
wx_95="37",
wx_96="37",
wx_97="31",
wx_98="29",
wx_99="27",
wx_100="47",
wx_101="47",
wx_102="33",
wx_103="26",
wx_104="20",
wx_105="45",
wx_106="45",
wx_107="11",
wx_108="46",
wx_109="46",
wx_110="06",
wx_111="18",
wx_112="06",
wx_113="46",
wx_114="46",
wx_115="31",
wx_116="47",
}--end w image table
--convert intellicast icons to weather font
wfont={
wx_65="a",
wx_66="c",
wx_67="f",
wx_68="a",
wx_69="d",
wx_70="0",
wx_71="a",
wx_72="9",
wx_73="5",
wx_74="p",
wx_75="d",
wx_76="w",
wx_77="p",
wx_78="6",
wx_79="x",
wx_80="8",
wx_81="8",
wx_82="h",
wx_83="q",
wx_84="m",
wx_85="a",
wx_86="-",
wx_87="h",
wx_88="x",
wx_89="w",
wx_90="w",
wx_91="g",
wx_92="g",
wx_93="g",
wx_94="g",
wx_95="k",
wx_96="k",
wx_97="A",
wx_98="C",
wx_99="D",
wx_100="K",
wx_101="K",
wx_102="B",
wx_103="f",
wx_104="0",
wx_105="G",
wx_106="G",
wx_107="h",
wx_108="O",
wx_109="O",
wx_110="x",
wx_111="w",
wx_112="x",
wx_113="O",
wx_114="O",
wx_115="A",
wx_116="K",
}--end w font table
--conversion day and month tables
dayshort={Monday="Mon",Tuesday="Tue",Wednesday="Wed",Thursday="Thu",Friday="Fri",Saturday="Sat",Sunday="Sun",x=""}
monthshort={January="Jan",February="Feb",March="Mar",April="Apr",May="May",June="Jun",July="Jul",August="Aug",September="Sep",October="Oct",November="Nov",December="Dec",x=""}
moonfontt={New="=",Full="@",FirstQuarter="G",LastQuarter="T",WaningGibbous="R",WaningCrescent="V",WaxingCrescent="E",WaxingGibbous="I"}
windfontt={S="9",SSW=":",SW=";",WSW="<",W="=",WNW=">",NW="?",NNW="@",N="1",NNE="2",NE="3",ENE="4",E="5",ESE="6",SE="7",SSE="8"}
--setup tables for forecast weather
forecast_day={}
forecast_day_caps={}
forecast_day_lc={}
forecast_day_short={}
forecast_day_short_caps={}
forecast_day_short_lc={}
forecast_month={}
forecast_month_caps={}
forecast_month_lc={}
forecast_month_short={}
forecast_month_short_caps={}
forecast_month_short_lc={}
forecast_date={}
weather_icon={}
weather_font={}
high_temp={}
low_temp={}
conditions={}
conditions_caps={}
conditions_lc={}
sun_rise={}
sun_rise_lc={}
moon_rise={}
moon_rise_lc={}
sun_set={}
sun_set_lc={}
moon_set={}
moon_set_lc={}
humidity={}
precipitation={}
snow={}
cloud_cover={}
moon_phase={}
moon_phase_caps={}
moon_phase_lc={}
moon_font={}
wind_mph={}
wind_km={}
wind_kts={}
wind_direction={}
wind_font={}
wind_deg={}
wind_nesw={}
uv_index_num={}
uv_index_txt={}
uv_index_txt_caps={}
uv_index_txt_lc={}
-----------------
--extract information into tables
local start=0
local f=1
while f~=nil do
--match forecast day name and date
s,f,t=string.find(allweather,"<td colspan=\"2\"><strong>([%a,%s%d]*)</strong></td>",start)
    if t~=nil then
    --split name from month and date
    a,b,day=string.find(t,"(%a*),%s")
    a,b,month=string.find(t,",%s(%a*)%s")
    a,b,date=string.find(t,"(%d*)$")
    --ser day names, regular, caps, lowercase and short
    table.insert(forecast_day,day)
    table.insert(forecast_day_caps,string.upper(day))
    table.insert(forecast_day_lc,string.lower(day))
    table.insert(forecast_day_short,dayshort[day])
    table.insert(forecast_day_short_caps,string.upper(dayshort[day]))
    table.insert(forecast_day_short_lc,string.lower(dayshort[day]))
    --set month types
    table.insert(forecast_month,month)
    table.insert(forecast_month_caps,string.upper(month))
    table.insert(forecast_month_lc,string.lower(month))
    table.insert(forecast_month_short,monthshort[month])
    table.insert(forecast_month_short_caps,string.upper(monthshort[month]))
    table.insert(forecast_month_short_lc,string.lower(monthshort[month]))
    --set date
    table.insert(forecast_date,date)
    end
--intellicast weather icon match
s,f,t=string.find(allweather,"40_white/(wx_..).png\"",start)
--convert to conkyweather icon
    if t~=nil then
    table.insert(weather_icon,weathericons..wimage[t]..".png")
    --convert to weather font
    table.insert(weather_font,wfont[t])
    end
--match conditions
s,f,t=string.find(allweather," /><br />([%a%s/]*)</td>",start)
    if t~=nil then
    table.insert(conditions,t)
    table.insert(conditions_caps,string.upper(t))
    table.insert(conditions_lc,string.lower(t))
    end
--match high temp
s,f,t=string.find(allweather,"\"Hi\">(%d*)&deg",start)
table.insert(high_temp,t)
--match low temp
s,f,t=string.find(allweather,"\"Lo\">(%d*)&deg",start)
table.insert(low_temp,t)
--match sunrise and set-- alt="Sunrise" style="vertical-align:bottom;" /><strong>Rise:</strong> 7:19 AM</td>            <td><strong>Set:</strong> 4:54 PM</td>
--match sun rise times
s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",start)
    if t~=nil then
    table.insert(sun_rise,t)
    table.insert(sun_rise_lc,string.lower(t))
    end
--match sun set times
s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
    if t~=nil then    
    table.insert(sun_set,t)
    table.insert(sun_set_lc,string.lower(t))
    end
--moon rise
s,f,t=string.find(allweather,"Rise:</strong> (%d*:%d*%s%u%u)</td>",f)
    if t~=nil then
    table.insert(moon_rise,t)
    table.insert(moon_rise_lc,string.lower(t))
    end
--moon set
s,f,t=string.find(allweather,"Set:</strong> (%d*:%d*%s%u%u)</td>",f)
    if t~=nil then
    table.insert(moon_set,t)
    table.insert(moon_set_lc,string.lower(t))
    end
--match uv index
s,f,tuv=string.find(allweather,"UV Index:</strong> (%d%s*%(%a*%)) <br />",start)
    if tuv~=nil then
    a,b,t=string.find(tuv,"(%d*)%s*%(%a*%)")
    table.insert(uv_index_num,t)
    a,b,t=string.find(tuv,"%d*%s*%((%a*)%)")
    table.insert(uv_index_txt,t)
    table.insert(uv_index_txt_caps,string.upper(t))
    table.insert(uv_index_txt_lc,string.lower(t))
    end
--match humidity
s,f,t=string.find(allweather,"Humidity:</strong> (%d*)<br />",start)
table.insert(humidity,t)
--match ppt
s,f,t=string.find(allweather,"Precipitation:</strong> (%d*)<br />",start)
table.insert(precipitation,t)
--match snow %
s,f,t=string.find(allweather,"Snow Probability:</strong>             (%d*)<br />",start)
table.insert(snow,t)
--match cloud coveage
s,f,t=string.find(allweather,"Cloud Coverage:</strong> (%d*)<br />",start)
table.insert(cloud_cover,t)
--match moon phase
s,f,t=string.find(allweather,"Moon Phase:</strong> ([%a%s]*) <br />",start)
--set moon phase text
    if t~= nil then
    table.insert(moon_phase,t)
    table.insert(moon_phase_caps,string.upper(t))
    table.insert(moon_phase_lc,string.lower(t))
    --set moon phase font
    mp=string.gsub(t," ","")
    table.insert(moon_font,moonfontt[mp])
    end
--match wind speeds
s,f,t=string.find(allweather,"Wind Speed:</strong> (%d*)Mph",start)
table.insert(wind_mph,t)
s,f,t=string.find(allweather,"Mph%s*%((%d*)Km,",start)
table.insert(wind_km,t)
s,f,t=string.find(allweather,"Km,%s*(%d*)Kts%)",start)
table.insert(wind_kts,t)
--match wind direction
s,f,twd=string.find(allweather,"Wind Direction:</strong> ([%d&;%s%(%a%)]*)        </div>",start)
    if twd~=nil then
    a,b,t=string.find(twd,"(%d*)&deg;")
    table.insert(wind_deg,t)
    --match wind font and nesw   
    a,b,t=string.find(twd,"%((%a*)%)")
    table.insert(wind_font,windfontt[t])
    table.insert(wind_nesw,t)
    end
if f==nil then break end
start=f
end--while
--#########################################################################################################################################
--end--of timed section
--format now weather
--extract current data
now={}
monthlong={Jan="January",Feb="February",Mar="March",Apr="April",May="May",Jun="June",Jul="July",Aug="August",Sep="September",Oct="October",Nov="November",Dec="December"}
s,f,tnow=string.find(nowweather,"<div style=\"float:right;color:#666;\">  As of ([%d%p%a%s]*) %(Local Time%)")
s,f,t=string.find(tnow,"(%d*%p%d*%s%a*) on")
now["time"]=t
now["time_lc"]=string.lower(t)
s,f,t=string.find(tnow,"on (%a*)%s%d*")
now["day"]=t
now["day_caps"]=string.upper(t)
now["day_lc"]=string.lower(t)
ds=dayshort[t]
now["day_short"]=ds
now["day_short_caps"]=string.upper(ds)
now["day_short_lc"]=string.lower(ds)
s,f,t=string.find(tnow,"%s(%d%d)%s")
now["date"]=t
s,f,t=string.find(tnow,"%d%d%s(%a*)%s%d")
now["month_short"]=t
now["month_short_caps"]=string.upper(t)
now["month_short_lc"]=string.lower(t)
ml=monthlong[t]
now["month"]=ml
now["month_caps"]=string.upper(ml)
now["month_lc"]=string.lower(ml)
s,f,t=string.find(tnow,"%a%a%a%s(%d%d%d%d)")
now["year"]=t
s,f,t=string.find(nowweather,"40_white/(wx_%d%d).png")
now["weather_icon"]=weathericons..wimage[t]..".png"
now["weather_font"]=wfont[t]
--40_white/wx_98.png" title="Broken Clouds" alt="Broken Clouds" class="Icon"
s,f,t=string.find(nowweather,"40_white/wx_%d%d.png%p%stitle=%p(Broken Clouds)%p%salt=%p[%a%s]*%p%sclass=%pIcon%p")
now["conditions"]=t
now["conditions_caps"]=string.upper(t)
now["conditions_lc"]=string.lower(t)
s,f,t=string.find(nowweather,"Temperature\">([%p%d]*)&deg")
now["temp"]=t
s,f,t=string.find(nowweather,">Feels Like: ([%p%d]*)&deg;</a>")
now["feels_like"]=t
s,f,t=string.find(nowweather,">Wind Chill: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["wind_chill"]=t
s,f,t=string.find(nowweather,">Ceiling: </a></td>%s*<td>([%a%d]*)</td>")
if t~="Unl" then
s,f,t=string.find(t,"(%d*)")
t=t.." mi"
end
now["ceiling"]=t
now["ceiling_caps"]=string.upper(t)
now["ceiling_lc"]=string.lower(t)
s,f,t=string.find(nowweather,">Heat Index: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["heat_index"]=t
s,f,t=string.find(nowweather,">Visibility: </a></td>%s*<td>([%a%d]*)</td>")
if t~="Unl" then
s,f,t=string.find(t,"(%d*)")
t=t.." mi"
end
now["visibility"]=t
now["visibility_caps"]=string.upper(t)
s,f,t=string.find(nowweather,">Dew Point: </a></td>%s*<td>([%p%d]*)&deg;</td>")
now["dew_point"]=t
s,f,t=string.find(nowweather,">Wind: </a></td>%s*<td>(%d*)mph</td>")
now["wind_mph"]=t.." mph"
if tonumber(t)==0 then
windtest=0
else
windtest=1
end
s,f,t=string.find(nowweather,">Humidity: </a></td>%s*<td>(%d*)</td>")
now["humidity"]=t
s,f,twd=string.find(nowweather,">Direction: </a></td>%s*<td style=[%p%a]*>([%d&;%s%(%a%)]*)</td>%s*</tr>")
a,b,t=string.find(twd,"(%d*)&deg;")
if windtest==1 then
now["wind_deg"]=t
else
now["wind_deg"]="NA"
end
a,b,t=string.find(twd,"%((%a*)%)")
if windtest==1 then
now["wind_nesw"]=t
now["wind_font"]=windfontt[t]
else
now["wind_nesw"]="NA"
now["wind_font"]=windfontt["N"]
end
s,f,t=string.find(nowweather,">Pressure: </a></td>%s*<td>([%d%p]*)\"</td>")
now["pressure"]=t
s,f,t=string.find(nowweather,">Gusts: </a></td>%s*<td>([%d%a]*)</td>")
if t~="NA" then
s,f,t=string.find(t,"(%d*)")
t=t.." mph"
end
now["wind_gusts"]=t
now["wind_gusts_caps"]=string.upper(t)
--###############end of data processing########################
processall=0
processnow=0
print ("processing complete")
--######################################
end--of data processing section ########
--######################################
--write lines here to show in conky
--these tables hold the top left coordinates for each repeat as set lower, do not edit
top_left_x_coordinate={}
top_left_y_coordinate={}
--write settings, c=color,a=alpha,f=font,fs=font size,x=x position, y=y position, txt=text or data to show
--eg out({c=0xffff00,a=1,f="Sans",fs=14,x=100,y=100,txt="hello world"})
--image settings, x=top left x position, y=top left y position, w=width of image(0=full size), h=height(0=full size),file=file location
--eg image({x=0,y=35,w=60,h=60,file=now[weather_icon]})
--########################################################
--######### write or paste setups below ##################
--########################################################
--write current weather
--show current conditions title
out({fs=16,x=0,y=20,txt="Current Conditions"})
--show day date and month
out({fs=14,x=0,y=35,txt=now["day_lc"]..", "..now["date"].." "..now["month_lc"]})
--show image -- coordinates in lua add gap_x and gap_y to top left edge of conky window
image({x=-20,y=15,w=50,h=50,file=now["weather_icon"]})
--text to right of image
out({x=65,y=55,fs=16,txt=now["conditions_lc"]})
out({x=65,y=72,fs=18,txt=now["temp"].."?F"})
out({x=80,y=88,fs=12,c=0xdcda16,txt="feels like: "})
out({x=160,y=88,fs=12,txt=now["feels_like"].."?F"})
--below image
--first column, titles
out({x=0,y=110,c=0xdcda16,txt="wind chill: "});
out({x=0,y=124,c=0xdcda16,txt="heat index: "});
out({x=0,y=138,c=0xdcda16,txt="dew point: "});
out({x=0,y=152,c=0xdcda16,txt="humidity: "});
out({x=0,y=166,c=0xdcda16,txt="pressure: "});
--second column, data
out({x=70,y=110,txt=now["wind_chill"].."?F"});
out({x=70,y=124,txt=now["heat_index"].."?F"});
out({x=70,y=138,txt=now["dew_point"].."?F"});
out({x=70,y=152,txt=now["humidity"].."%"});
out({x=70,y=166,txt=now["pressure"].."\""});
--third colum, titles
out({x=120,y=110,c=0xdcda16,txt="ceiling: "});
out({x=120,y=124,c=0xdcda16,txt="visibility: "});
out({x=120,y=138,c=0xdcda16,txt="wind: "});
out({x=120,y=152,c=0xdcda16,txt="direction: "});
out({x=120,y=166,c=0xdcda16,txt="gusts: "});
--fourth column, data
out({x=190,y=110,txt=now["ceiling_lc"]})
out({x=190,y=124,txt=now["visibility"]})
out({x=190,y=138,txt=now["wind_mph"]})
out({x=190,y=152,txt=now["wind_deg"].."? ("..now["wind_nesw"]..")"})
out({x=190,y=166,txt=now["wind_gusts"]})
--write forecast days title
out({fs=16,x=270,y=20,txt="Forecast Days"})
--end of current conditions
--#########################################################
--######### forecast weather and repeat ###################
--#########################################################
--these tables hold the top left coordinates for each repeat as set lower, do not edit
top_left_x_coordinate={}
top_left_y_coordinate={}
--enter number of forecast days to show
number_of_days=8
--enter coordinates of top left corner for each day
top_left_x_coordinate[1],top_left_y_coordinate[1]=270,15
top_left_x_coordinate[2],top_left_y_coordinate[2]=540,15
top_left_x_coordinate[3],top_left_y_coordinate[3]=0,190
top_left_x_coordinate[4],top_left_y_coordinate[4]=270,190
top_left_x_coordinate[5],top_left_y_coordinate[5]=540,190
top_left_x_coordinate[6],top_left_y_coordinate[6]=0,370
top_left_x_coordinate[7],top_left_y_coordinate[7]=270,370
top_left_x_coordinate[8],top_left_y_coordinate[8]=540,370
------------------------
for i=1,number_of_days do--start of day repeat, do not edit
tlx=top_left_x_coordinate[i]--sets top left position for each repeat
tly=top_left_y_coordinate[i]--sets top left position for each repeat
--write day format below, write x and y relative to top left coordinates as in the example
--write i to call day as this will be replaced with the day number for each repeat
--forecast day date and month
out({fs=14,x=tlx+0,y=tly+20,txt=forecast_day_lc[i]..", "..forecast_date[i].." "..forecast_month_lc[i]})
--image
image({x=tlx-20,y=tly+5,w=50,h=50,file=weather_icon[i]})
--text to right of image, conditions, high and low temp
out({x=tlx+65,y=tly+40,fs=16,txt=conditions_lc[i]})
out({x=tlx+80,y=tly+58,fs=18,c=0xf49309,txt=high_temp[i].."?F"})
out({x=tlx+80,y=tly+75,fs=18,c=0x3cb342,txt=low_temp[1].."?F"})
--moon and wind font
out({f="Moon Phases",fs=28,x=tlx+155,y=tly+76,txt=moon_font[i]})
out({f="ConkyWindNESW",fs=32,x=tlx+190,y=tly+75,txt=wind_font[i]})
--info below image
--sun and moon times
--first colum
out({x=tlx+0,y=tly+92,c=0x3ed9e7,txt="sun rise: "});
out({x=tlx+0,y=tly+104,c=0x3ed9e7,txt="moon rise: "});
--second column
out({x=tlx+80,y=tly+92,txt=sun_rise_lc[i]});
out({x=tlx+80,y=tly+104,txt=moon_rise_lc[i]});
--third column
out({x=tlx+140,y=tly+92,c=0x3ed9e7,txt="sun set: "});
out({x=tlx+140,y=tly+104,c=0x3ed9e7,txt="moon set: "});
--fourth column
out({x=tlx+200,y=tly+92,txt=sun_set_lc[i]})
out({x=tlx+200,y=tly+104,txt=moon_set_lc[i]})
--moon phase and moon font
out({x=tlx+0,y=tly+116,c=0x3ed9e7,txt="moon phase: "});
out({x=tlx+80,y=tly+116,txt=moon_phase_lc[i]});
--1st column
out({x=tlx+0,y=tly+128,c=0x3ed9e7,txt="uv index: "});
out({x=tlx+0,y=tly+140,c=0x3ed9e7,txt="humidity: "});
out({x=tlx+0,y=tly+152,c=0x3ed9e7,txt="wind speed: "});
--2nd colum
out({x=tlx+80,y=tly+128,txt=uv_index_num[i].." ("..uv_index_txt[i]..")"})
out({x=tlx+80,y=tly+140,txt=humidity[i].." %"})
out({x=tlx+80,y=tly+152,txt=wind_mph[i].." mph"})
--3rd column
out({x=tlx+140,y=tly+128,c=0x3ed9e7,txt="cloud: "});
out({x=tlx+140,y=tly+140,c=0x3ed9e7,txt="rain: "});
out({x=tlx+140,y=tly+152,c=0x3ed9e7,txt="snow: "});
--4th column
out({x=tlx+200,y=tly+128,txt=cloud_cover[i].." %"});
out({x=tlx+200,y=tly+140,txt=precipitation[i].." %"});
out({x=tlx+200,y=tly+152,txt=snow[i].." %"});
--wind direction and direction font
out({x=tlx+0,y=tly+164,c=0x3ed9e7,txt="wind direction: "})
out({x=tlx+104,y=tly+164,txt=wind_deg[i].."? ("..wind_nesw[i]..")"});
end--of day repeat, do not edit
--##############################################################
--############## end of weather display setup ##################
--##############################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function

function out(tx)
color=nil
color=tx.c
if color==nil then color=default_color end
alpha=nil
alpha=tx.a
if alpha==nil then alpha=default_alpha end
font=nil
font=tx.f
if font==nil then font=default_font end
fsize=nil
fsize=tx.fs
if fsize==nil then fsize=default_font_size end
xpos=nil
xpos=tx.x
if xpos==nil then xpos=0 end
ypos=nil
ypos=tx.y
if ypos==nil then ypos=0 end
text=nil
text=tx.txt
if text==nil then text="hello world" end
local function col(c)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,alpha
end--local function
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,col(color))
cairo_move_to (cr,xpos,ypos)
cairo_show_text (cr,text)
cairo_stroke (cr)
end--function out

function image(im)
x=nil
x=im.x
if x==nil then x=0 end
y=nil
y=im.y
if y==nil then y=0 end
w=nil
w=im.w
if w==nil then w=default_image_width end
h=nil
h=im.h
if h==nil then h=default_image_height end
file=nil
file=tostring(im.file)
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(w)
end
if tonumber(h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(h)
end
local iacross=x+(width/2)
local idown=y+(height/2)
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(iacross, idown)
imlib_free_image()
show=nil
end--function image

function cw(t)
--set variables and defualts
if t.text==nil then text="" else text=t.text end
if t.font==nil then font="mono" else font=t.font end
if t.fsize==nil then fsize=12 else fsize=t.fsize end
if t.radius==nil then radius=50 else radius=t.radius end
if t.xpos==nil then xpos=100 else xpos=t.xpos end
if t.ypos==nil then ypos=100 else ypos=t.ypos end
if t.position==nil then position=1 else position=t.position end
if t.start==nil then start=270 else start=t.start end
if t.finish==nil then finish=90 else finish=t.finish end
if t.justify==nil then justify=1 else justify=t.justify end
if t.letterdeg==nil then letterdeg=5 else letterdeg=t.letterdeg end
--end variables
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);
if finish<start then finish=finish+360 end
local inum=string.len(text)
---------------------------
if position==1 then
deg=(finish-start)/(inum-1)
elseif position==2 then
deg=letterdeg
    if justify==1 then
    start=start    
    elseif justify==2 then
    start=start-((letterdeg*inum)/2)
    elseif justify==3 then 
    start=start-(letterdeg*inum)
    end
end
----------------------------
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+radius*(math.sin(interval))
tys=0-radius*(math.cos(interval))
cairo_move_to (cr, txs+xpos, tys+ypos);
cairo_rotate (cr, interval)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval)
end
end--circlewriting
function cwd(t)
--set variables and defualts
if t.text==nil then text="" else text=t.text end
if t.font==nil then font="mono" else font=t.font end
if t.fsize==nil then fsize=12 else fsize=t.fsize end
if t.radius==nil then radius=50 else radius=t.radius end
if t.xpos==nil then xpos=100 else xpos=t.xpos end
if t.ypos==nil then ypos=100 else ypos=t.ypos end
if t.position==nil then position=1 else position=t.position end
if t.start==nil then start=270 else start=t.start end
if t.finish==nil then finish=90 else finish=t.finish end
if t.justify==nil then justify=1 else justify=t.justify end
if t.letterdeg==nil then letterdeg=5 else letterdeg=t.letterdeg end
--end variables
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);
if start<finish then start=start+360 end
local inum=string.len(text)
---------------------------
if position==1 then
deg=(start-finish)/(inum-1)
elseif position==2 then
deg=letterdeg
    if justify==1 then
    start=start    
    elseif justify==2 then
    start=start+((letterdeg*inum)/2)
    elseif justify==3 then 
    start=start+(letterdeg*inum)
    end
end
----------------------------
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+radius*(math.sin(interval))
tys=0-radius*(math.cos(interval))
cairo_move_to (cr, txs+xpos, tys+ypos);
cairo_rotate (cr, interval+(math.pi))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -1*(interval+(math.pi)))
end
end--cwd 

function to_lines(line_text,max_string_len,indent)
---------------------------------------------
--set defaults for function
local default_max_length=50
local default indent=""
---------------------------------------------
if indent==nil then indent=default_indent end
if max_string_len==nil then max_string_len=default_max_length end
local i=1
text_table={line_text}
while text_table[i]~=nil do
if max_string==nil then max_string=max_string_len end
local v=text_table[i]
    if string.len(v)>max_string_len and string.find(v," ")~=nil and string.find(string.sub(v,1,max_string)," ")~=nil then
    long=string.len(v)
    splitcha=string.sub(v,max_string,max_string)    
        if splitcha~=" " then        
            while splitcha~=" " do
                if max_string>1 then
                max_string=max_string-1
                splitcha=string.sub(v,max_string,max_string)
                else
                splitcha=" "
                end
            end
        end
        local insertit=tostring(indent..string.sub(v,max_string+1,long))
        table.insert(text_table,i+1,insertit)
        text_table[i]=tostring(string.sub(v,1,max_string-1))    
    elseif string.len(v)>max_string_len and string.find(v," ")~=nil and string.find(string.sub(v,1,max_string)," ")==nil then
    long=string.len(v)
    splitcha=string.sub(v,max_string,max_string)        
        while splitcha~=" " do
            if max_string<long then
            max_string=max_string+1
            splitcha=string.sub(v,max_string,max_string)
            else
            splitcha=" "
            end
        end
        local insertit=tostring(indent..string.sub(v,max_string+1,long))
        table.insert(text_table,i+1,insertit)
        text_table[i]=tostring(string.sub(v,1,max_string-1))    
    end
i=i+1
max_string=max_string_len
end
return text_table
end--function

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

Offline

#160 2012-01-08 02:23:42

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:

fixed a couple of dumb mistakes i made fixing the previous bugs!
here is the testing regular edition
http://crunchbanglinux.org/pastebin/1428

here is the circle display using the updated processing code
http://crunchbanglinux.org/pastebin/1429

hope i dont break pastebin!

Wait a sec.... is that a bug fix of the code I just posted or is it a new code?

Why not overwrite existing code on paste-bin?


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

Offline

#161 2012-01-08 02:26:15

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

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

Sector11 wrote:
mrpeachy wrote:

fixed a couple of dumb mistakes i made fixing the previous bugs!
here is the testing regular edition
http://crunchbanglinux.org/pastebin/1428

here is the circle display using the updated processing code
http://crunchbanglinux.org/pastebin/1429

hope i dont break pastebin!

Wait a sec.... is that a bug fix of the code I just posted or is it a new code?

Why not overwrite existing code on paste-bin?

re the 38 degrees... i was just thinking that my response that didnt make any sense
i think ive lost the ability to think straight big_smile

case in point... i forgot [ in a line hmm
new bug fix regular version
http://crunchbanglinux.org/pastebin/1431

so best to stop while im ahead!

the code above is just bug fixes
ive found that when i edit the code existing on pastebin it just spits out a new entry anyway... am i doing it wrong?
i dont want to inundate the !# pastebin with multiple versions of the script

Last edited by mrpeachy (2012-01-08 02:49:53)

Offline

#162 2012-01-08 02:51:29

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:
Sector11 wrote:
mrpeachy wrote:

fixed a couple of dumb mistakes i made fixing the previous bugs!
here is the testing regular edition
http://crunchbanglinux.org/pastebin/1428

here is the circle display using the updated processing code
http://crunchbanglinux.org/pastebin/1429

hope i dont break pastebin!

Wait a sec.... is that a bug fix of the code I just posted or is it a new code?

Why not overwrite existing code on paste-bin?

re the 38 degrees... i was just thinking that my response that didnt make any sense
i think ive lost the ability to think straight big_smile

so best to stop while im ahead!

the code above is just bug fixes
ive found that when i edit the code existing on pastebin it just spits out a new entry anyway... am i doing it wrong?
i dont want to inundate the !# pastebin with multiple versions of the script

Do you have: DropBox just "copy" the "weather.lua" to the dropbox folder on your computer - it will sync with the your dropbox account on the net. You give people the link and volia!  You make a change, copy the updated file to dropbox and it gets updated. The same link for that file will always work.

Oh NO! don't do that; try this


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

Offline

#163 2012-01-08 02:55:44

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:

Do you have: DropBox just "copy" the "weather.lua" to the dropbox folder on your computer - it will sync with the your dropbox account on the net. You give people the link and volia!  You make a change, copy the updated file to dropbox and it gets updated. The same link for that file will always work.

Oh NO! don't do that; try this

now that sounds like a good idea
installing now

Offline

#164 2012-01-08 03:01:09

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

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

mrpeachy wrote:

@falldown
when you say it last 5-10 minutes.. do you get errors in terminal when it goes wrong?
did you change the update interval in the settings?

No only thing I have changed is color, font and location url.
It now loads both curls and then crashes with the previous error messages.

The new circle forecast doesn't load curls at all and here is terminal

falldown@crunchbang:~$ conky_start
Conky: desktop window (15a) is root window
Conky: window type - desktop
Conky: drawing to created window (0x3200001)
Conky: drawing to double buffer
Conky: desktop window (15a) is root window
Conky: window type - desktop
Conky: drawing to created window (0x3400001)
Conky: drawing to double buffer
Conky: desktop window (15a) is root window
Conky: window type - desktop
Conky: drawing to created window (0x3600001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_weather execution failed: /home/falldown/.conky/weathercircle.lua:53: attempt to index local 'file' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/falldown/.conky/weathercircle.lua:73: bad argument #1 to 'find' (string expected, got nil)

Last edited by falldown (2012-01-08 03:09:38)

Offline

#165 2012-01-08 03:06:41

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

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

mrpeachy wrote:

....
new bug fix regular version
http://crunchbanglinux.org/pastebin/1431
...

The new bug fix isn't working, it doesn't even try curl. hmm Here's my ouput....

tony@tony-Inspiron-1564 ~ $ conky -c .conky/.conkyrc-weather9000 
Conky: desktop window (ae) is root window
Conky: window type - normal
Conky: drawing to created window (0x3200001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_weather execution failed: /home/tony/.conky/weatheragain2.lua:52: attempt to index local 'file' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/tony/.conky/weatheragain2.lua:72: bad argument #1 to 'find' (string expected, got nil)

line 52 - file:write(os.date("%H:%M")..memory_used)
line 72 - testall=string.find(allweather,"%a")

Offline

#166 2012-01-08 03:20:28

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

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

ackernan wrote:
mrpeachy wrote:

....
new bug fix regular version
http://crunchbanglinux.org/pastebin/1431
...

The new bug fix isn't working, it doesn't even try curl. hmm Here's my ouput....

tony@tony-Inspiron-1564 ~ $ conky -c .conky/.conkyrc-weather9000 
Conky: desktop window (ae) is root window
Conky: window type - normal
Conky: drawing to created window (0x3200001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_weather execution failed: /home/tony/.conky/weatheragain2.lua:52: attempt to index local 'file' (a nil value)
Conky: llua_do_call: function conky_weather execution failed: /home/tony/.conky/weatheragain2.lua:72: bad argument #1 to 'find' (string expected, got nil)

line 52 - file:write(os.date("%H:%M")..memory_used)
line 72 - testall=string.find(allweather,"%a")

doh... another silly mistake

delete these lines from the top of the script

--memory recording function
local f=io.popen("top -b -n1 | grep 'conky' | awk '{print$10}'")
memory_used=f:read("*a")
f:close()
local file = io.open("/home/benjamin/Desktop/memory.txt", "a")
file:write(os.date("%H:%M")..memory_used)
file:close()
-----------------------------------

you dont need them, its for me to keep an eye on memory
either that or change the file location and track conky memory yourself
im still bug fixing and will post a dropbox link in a minute or so

Offline

#167 2012-01-08 03:22:42

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

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

Disregard above post.  I found something I forgot to change.  It's all working well, except for the moonphases and BO between temps and fahrenheit.  I have characters after the moons.  I installed the fonts that are required.

Screenshot_at_2012_01_07_22_20_15.jpg

Offline

#168 2012-01-08 03:25:43

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, i hadnt taken into account that the weather icons from intellicast can have 3 digits
fixed

this is the link to the most current version of the weather script
http://dl.dropbox.com/u/19008369/weatheragain2.lua

here is the current circle weather
http://dl.dropbox.com/u/19008369/weathercircle2.lua

@ackernan those should be the degree symbol, i suspect your font doesnt have one and so is giving B0 for some reason

Last edited by mrpeachy (2012-01-08 03:48:17)

Offline

#169 2012-01-08 03:33:40

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

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

mrpeachy wrote:

ok, i hadnt taken into account that the weather icons from intellicast can have 3 digits
fixed

this is the link to the most current version of the weather script
http://dl.dropbox.com/u/19008369/weatheragain2.lua

@ackernan those should be the degree symbol, i suspect your font doesnt have one and so is giving B) for some reason

I used the lua script you just posted and removed memory usage section.  I have A after my temps.  I have override_utf8_locale yes in my conky config section.

Screenshot_at_2012_01_07_22_28_44.jpg

Offline

#170 2012-01-08 03:38:17

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

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

mrpeachy wrote:
--memory recording function
local f=io.popen("top -b -n1 | grep 'conky' | awk '{print$10}'")
memory_used=f:read("*a")
f:close()
local file = io.open("/home/benjamin/Desktop/memory.txt", "a")
file:write(os.date("%H:%M")..memory_used)
file:close()
-----------------------------------

you dont need them, its for me to keep an eye on memory
either that or change the file location and track conky memory yourself
im still bug fixing and will post a dropbox link in a minute or so

This fixed my issue.. Thank you MrPeachy big_smile

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 68286  100 68286    0     0  12118      0  0:00:05  0:00:05 --:--:--  173k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 68286  100 68286    0     0  12333      0  0:00:05  0:00:05 --:--:--  179k
processing complete

Offline

#171 2012-01-08 12:30:44

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

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

ackernan wrote:

I used the lua script you just posted and removed memory usage section.  I have A after my temps.  I have override_utf8_locale yes in my conky config section.

Screenshot_at_2012_01_07_22_28_44.jpg

I got the problem of the mysterious A fixed, I don't know if it was a good fix.  It was in the lua code and I removed it.  What was it for?

The other issue I had was characters after the moonphases.  Ends up I didn't have the conkywindnesw font loaded.

Offline

#172 2012-01-08 13:07:19

Dodge ram
#! CrunchBanger
Registered: 2011-04-26
Posts: 140

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

mrpeachy, I am still having problems with the new script.Screenshot.jpg

Offline

#173 2012-01-08 17:41: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!

ackernan wrote:

I got the problem of the mysterious A fixed, I don't know if it was a good fix.  It was in the lua code and I removed it.  What was it for?

what was in the code?
can you post an example

@dodge ram
ill be testing later today and see if i can get the problem
can you post the conkyrc that gives the above screenshot?
it looks like you have things overlapping

Offline

#174 2012-01-08 18:10:29

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

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

mrpeachy wrote:

what was in the code?
can you post an example

About lines 500 - 528 of http://dl.dropbox.com/u/19008369/weatheragain2.lua

out({x=65,y=72,fs=18,txt=now["temp"].."°F"})
out({x=80,y=88,fs=12,c=0xdcda16,txt="feels like: "})
out({x=160,y=88,fs=12,txt=now["feels_like"].."°F"})
--below image
--first column, titles
out({x=0,y=110,c=0xdcda16,txt="wind chill: "});
out({x=0,y=124,c=0xdcda16,txt="heat index: "});
out({x=0,y=138,c=0xdcda16,txt="dew point: "});
out({x=0,y=152,c=0xdcda16,txt="humidity: "});
out({x=0,y=166,c=0xdcda16,txt="pressure: "});
--second column, data
out({x=70,y=110,txt=now["wind_chill"].."°F"});
out({x=70,y=124,txt=now["heat_index"].."°F"});
out({x=70,y=138,txt=now["dew_point"].."°F"});
out({x=70,y=152,txt=now["humidity"].."%"});
out({x=70,y=166,txt=now["pressure"].."\""});
--third colum, titles
out({x=120,y=110,c=0xdcda16,txt="ceiling: "});
out({x=120,y=124,c=0xdcda16,txt="visibility: "});
out({x=120,y=138,c=0xdcda16,txt="wind: "});
out({x=120,y=152,c=0xdcda16,txt="direction: "});
out({x=120,y=166,c=0xdcda16,txt="gusts: "});
--fourth column, data
out({x=190,y=110,txt=now["ceiling_lc"]})
out({x=190,y=124,txt=now["visibility"]})
out({x=190,y=138,txt=now["wind_mph"]})
out({x=190,y=152,txt=now["wind_deg"].."° ("..now["wind_nesw"]..")"})
out({x=190,y=166,txt=now["wind_gusts"]})
--write forecast days title

Offline

Help fund CrunchBang, donate to the project!

#175 2012-01-08 19:46:30

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

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

sheesh... you would think dropbox has the ability to handle the degree symbol!!

those are all ° in the file on my computer

stoopid dropbox

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