SEARCH

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

You are not logged in.

#1 Re: Tips, Tricks & Scripts » HOW TO : using lua scripts in conky » 2014-12-15 14:15:22

Running my script in a terminal I get the correct amount of data from the website now. I am planning to add the ')' onto the last line as text to tidy it up.

$ conky -c /home/hecate/ToolBox/conky/Other_Scripts/rss2
Conky: desktop window (e00003) is subwindow of root window (1e4)
Conky: window type - normal
Conky: drawing to created window (0x4000001)
Conky: drawing to double buffer
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20075    0 20075    0     0  53398      0 --:--:-- --:--:-- --:--:-- 53390

<table id="tide_summary">
<tr>
 <td class="high-tide">Low Tide</td>
 <td class="low-tide"><span>06:14</span> (0.90m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">High Tide</td>
 <td class="low-tide"><span>11:54</span> (4.70m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">Low Tide</td>
 <td class="low-tide"><span>18:42</span> (0.90

Problem is I don't know the code that needs to be added to the lua script in order for the data to be displayed in the conky window, just commenting out the 'print (tides)' line simply draws an empty conky window on the desktop. I have read through this thread but can't seem to work out what to do.

Conky script

######################
# - Conky settings - #
######################

background no
update_interval 4
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
 
double_buffer yes
#no_buffers yes
 
text_buffer_size 1024
#imlib_cache_size 0

minimum_size 300 300
maximum_width 320

gap_x 10
gap_y 50
#####################
# - Text settings - #
#####################
use_xft yes
xftfont monofur:size=12
#xftalpha .8
uppercase no
default_color ffffff
alignment bottom_left
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent no
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky-semi
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
#default_shade_color 292421
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no

#lua_load /home/jed/Conky/LUA/draw_bg.lua
#lua_draw_hook_post draw_bg 10 0 0 0 0 0x5C3434 0.4
lua_load /home/hecate/ToolBox/conky/Other_Scripts/tidesrss2.lua
lua_draw_hook_post conky_main

TEXT

tidesrss2.lua

--this is a lua script for use in conky
require 'cairo'

function conky_main()
updates=tonumber(conky_parse("${updates}"))
interval=100
timer=(updates % interval)
if timer==0 or conky_start==1 then
used_table={}
local web="https://www.tidetimes.org.uk/ferryside-tide-times"
local file = io.popen("curl "..web)
output=file:read("*a")
file:close()
local s,f,tides=string.find(output,"20px%p%p>([%d%a%p%s]*)m%)</td></tr></table>")
conky_start=nil
--print (tides)
end
end

Thanks in advance to anyone who can help!

#2 Re: Tips, Tricks & Scripts » HOW TO : using lua scripts in conky » 2014-12-15 01:16:32

@arclance Many thanks for your help. I now have the right amount of data coming into the terminal smile

Sadly, I can't get it to draw on the desktop. Still, tomorrow is another conky day ...

Thanks also for the link re Lua pattern matching - that is bookmarked!

#4 Re: Tips, Tricks & Scripts » HOW TO : using lua scripts in conky » 2014-12-14 18:30:48

I am trying to fetch data from a web page into a conky. I have read the first post on this thread and got the 'Hello World' printing out in a terminal and then followed this post but am having trouble ending the section I want to pull in  sad

The lua script - tidesrss.lua

--this is a lua script for use in conky
require 'cairo'

function conky_main()
updates=tonumber(conky_parse("${updates}"))
interval=100
timer=(updates % interval)
if timer==0 or conky_start==1 then
used_table={}
local web="https://www.tidetimes.org.uk/ferryside-tide-times"
local file = io.popen("curl "..web)
output=file:read("*a")
file:close()
local s,f,tides=string.find(output,"20px%p%p>([%d%a%p%s]*)</div>")
conky_start=nil
print (tides)
end
end

The generated source of the webpage section I want to pull is

<div style="float:left; margin:10px 0px 0px 20px;">
<table id="tide_summary">
<tbody><tr>
 <td class="high-tide">Low Tide</td>
 <td class="low-tide"><span>05:36</span> (0.80m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">High Tide</td>
 <td class="low-tide"><span>10:53</span> (5.00m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">Low Tide</td>
 <td class="low-tide"><span>18:00</span> (0.80m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">High Tide</td>
 <td class="low-tide"><span>23:28</span> (4.60m)</td></tr></tbody></table>
</div>

The "20px;">" at the end of the first line only occurs once in the generated code, so that's great to start it off but I can't work out how to stop it in the right place - my tidesrss.lua brings in the whole of the rest of the page into the terminal (probably because there are lots of </div>'s):

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20130    0 20130    0     0  54177      0 --:--:-- --:--:-- --:--:-- 54112

<table id="tide_summary">
<tr>
 <td class="high-tide">Low Tide</td>
 <td class="low-tide"><span>05:36</span> (0.80m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">High Tide</td>
 <td class="low-tide"><span>10:53</span> (5.00m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">Low Tide</td>
 <td class="low-tide"><span>18:00</span> (0.80m)</td></tr><tr>
 <td class="high-tide" style="padding-top:35px;">High Tide</td>
 <td class="low-tide"><span>23:28</span> (4.60m)</td></tr></table>
</div>

<div style="float:left; margin:10px 0px 0px 30px;">
<table id="tide-calendar">
<tr><td id="cal-head" colspan="7">December 2014</td></tr>
<tr id="cal-days">
 <td>Sun</td>
 <td>Mon</td>
 <td>Tue</td>
 <td>Wed</td>
 <td>Thu</td>
 <td>Fri</td>
 <td>Sat</td>
</tr>
<tr>
<td colspan="1" class="cal-grey">&nbsp;</td> <td class="cal-day"><a href="/ferryside-tide-times-20141201" style="color:#3183AF" title="Ferryside Tide Times for 1 December 2014">1</a></td>

... AND ON TO THE END OF THE PAGE (which is very long!!)

Is there an lua magic character for an end bracket ')' - like the %s used for a space? If so I might be able to try

local s,f,tides=string.find(output,"20px%p%p>([%d%a%p%s]*)m)</td></tr></table>")

by replacing the ) after the m with the right character??? If I use the code above I just get

Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

Any help would be most appreciated!

#5 Re: Tips, Tricks & Scripts » weather in conky (LUA scripts) updated 12/26/13! » 2014-12-14 14:30:00

Sector11 wrote:

No need to comment anything out at all.  Just delete the word undecorated from: own_window_hints.  Done!

If you "kill" the conky and restart it it will play the width, height game properly.  big_smile

Great, thanks for that - my (extensive) Conky note is now updated!

Sector11 wrote:

I do believe you are hooked on conky.

It would appear so - getting the v9000 working again was all the inspiration I needed  big_smile  My problem is that once I start, I can spend the whole day fiddling with conkies and, since I work from home, the temptation can be far too great. I am going to have to limit myself on weekdays or I won't have much of an income wink

Today's 'wish list' is to bring in data from a Tide Times website and try and get an interactive rss feed working. I will plough through the interactive conky forum to try and find what I need to know for the rss. I want to bring in the links from one rss and for them to be active in the conky, rather than the usual trigger that opens a browser page containing the feed links.

I have followed, to the best of my ability, this post for my Tide Times but it isn't working so will be asking for help over there. I did install XTide but it doesn't have a location close enough to be useful to me  sad

#6 Re: Tips, Tricks & Scripts » weather in conky (LUA scripts) updated 12/26/13! » 2014-12-13 18:27:30

@Sector11  I was wondering how you got the 'conky-in-a-box' then discovered it when searching as to why a system monitoring conky I was working on wasn't playing the width and height game. Solution was to comment out 'own_window_type' and 'own_window_hints' then use the window manager to resize - and, of course, there it was, in a box! Once done, and you uncomment those lines you need to restart conky entirely (I kept getting 'permission denied' when trying to run the script so rebooted my machine). I might try to run this one in a window for keeps.

I have incorporated the sun/moon data into my v9000 and got rid of the moon phase 'forecast' I had running in 5_Moon, the scripts you posted saved me a lot of time figuring it out.

@destripato  Whilst meandering up this page I found the list of variables that you posted relating to the extended hourly forecasts now available. Thank you so much, the possibilities seem endless now ... I may end up having a complete rethink  wink

Anyhow, for anyone interested, here is what my current set up looks like:
efec34372221141.jpg
The new weather lua script:

--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--#######################################################################
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="arial"--font must be in quotes
default_font_size=13
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
starty=15
gap=15
ypos=0
ypos=starty+ypos
out({c=0xFFF2CB,a=1,fs=13,x=15,y=ypos,txt="WEATHER + MOON  "})
out({c=0xFFF2CB,a=1,fs=13,x=150,y=ypos,txt=weather_location})
image({x=20,y=35,h=70,w=70,file=now["weather_icon"]})
image({x=35,y=87,h=45,w=45,file=now["wind_icon"]})
--data titles
ypos=gap+ypos
out({c=0xFFF2CB,a=1,x=15,y=ypos,txt="NOW:"})
ypos=gap+7+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Temperature:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Feels Like:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Wind:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Gusting:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Humidity:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Dew Point:"})
--output of data options
ypos=0
ypos=starty+gap+gap+7+ypos
out({c=0xffffff,a=1,x=60,y=30,txt=now["conditions"]})
ypos=ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["temp"].."°"})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["feels_like"].."°"})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["wind_mph"]})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["wind_gusts"] })
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["humidity"].."%"})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["dew_point"].."°"})

--moon/sun rise/set
out({c=0xC1CFB3,a=1,x=255,y=53,txt="Precipitation:"})
out({c=0xffffff,a=1,x=342,y=53,txt= precipitation[1].."%"})
out({c=0xC1CFB3,a=1,x=255,y=68,txt="Sun Rise:"})
out({x=335,y=68,w=50,h=50,txt=sun_rise_24[1]})
out({c=0xC1CFB3,a=1,x=255,y=83,txt="Sun Set:"})
out({x=335,y=83,w=50,h=50,txt=sun_set_24[1]})
out({c=0xC1CFB3,x=255,y=98,txt=moon_phase[1] })
out({c=0xC1CFB3,a=1,x=255,y=113,txt="Moon Rise:"})
out({x=335,y=113,w=50,h=50,txt=moon_rise_24[1]})
out({c=0xC1CFB3,a=1,x=255,y=128,txt="Moon Set:"})
out({x=335,y=128,w=50,h=50,txt=moon_set_24[1]})

out({c=0xFFF2CB,x=400,y=20,fs=13,txt="NEXT 6 HOURS"})
image({w=30,h=30,x=400,y=30,file=hour_weather_icon[1]})--good
out({c=0xFFF2CB,x=440,y=45,txt=forecast_hour[1].." Temp: "..hour_temp[1].."°"})
out({c=0xC1CFB3,x=440,y=60,txt=hour_conditions_short[1].." "..hour_wind_nsew[1].." "..hour_wind_mph[1].."mph"})

image({w=30,h=30,x=400,y=65,file=hour_weather_icon[2]})--good
out({c=0xFFF2CB,x=440,y=80,txt=forecast_hour[2].." Temp: "..hour_temp[2].."°"})
out({c=0xC1CFB3,x=440,y=95,txt=hour_conditions_short[2].." "..hour_wind_nsew[2].." "..hour_wind_mph[2].."mph"})

image({w=30,h=30,x=400,y=100,file=hour_weather_icon[3]})--good
out({c=0xFFF2CB,x=440,y=115,txt=forecast_hour[3].." Temp: "..hour_temp[3].."°"})
out({c=0xC1CFB3,x=440,y=129,txt=hour_conditions_short[3].." "..hour_wind_nsew[3].." "..hour_wind_mph[3].."mph"})

image({w=30,h=30,x=595,y=30,file=hour_weather_icon[4]})--good
out({c=0xFFF2CB,x=635,y=45,txt=forecast_hour[4].." Temp: "..hour_temp[4].."°"})
out({c=0xC1CFB3,x=635,y=60,txt=hour_conditions_short[4].." "..hour_wind_nsew[4].." "..hour_wind_mph[4].."mph"})

image({w=30,h=30,x=595,y=65,file=hour_weather_icon[5]})--good
out({c=0xFFF2CB,x=635,y=80,txt=forecast_hour[5].." Temp: "..hour_temp[5].."°"})
out({c=0xC1CFB3,x=635,y=95,txt=hour_conditions_short[5].." "..hour_wind_nsew[5].." "..hour_wind_mph[5].."mph"})

image({w=30,h=30,x=595,y=100,file=hour_weather_icon[6]})--good
out({c=0xFFF2CB,x=635,y=115,txt=forecast_hour[6].." Temp: "..hour_temp[6].."°"})
out({c=0xC1CFB3,x=635,y=129,txt=hour_conditions_short[6].." "..hour_wind_nsew[6].." "..hour_wind_mph[6].."mph"})


--########################################################################################
--start or weather forecast repeat section
--set start forecast day
start_day=2
--set total forecast days you want to display
number_of_days=6
--out({c=0xFFF2CB,x=605,y=20,fs=13,txt="FORECAST"})
topy=260
ygap=110
--set coordinates for top left corners for each repeat 1st column
ady=topy+ygap
top_left_x_coordinate[1],top_left_y_coordinate[1]=605,20

top_left_x_coordinate[2],top_left_y_coordinate[2]=798,20

top_left_x_coordinate[3],top_left_y_coordinate[3]=991,20

top_left_x_coordinate[4],top_left_y_coordinate[4]=1184,20

top_left_x_coordinate[5],top_left_y_coordinate[5]=1377,20

top_left_x_coordinate[6],top_left_y_coordinate[6]=1500,20

--########################################################################################
for i=start_day,number_of_days-(start_day-1) do--start of day repeat, do not edit ########
local tlx=top_left_x_coordinate[i]--sets top left x position for each repeat ###################
local tly=top_left_y_coordinate[i]--sets top left y position for each repeat ###################
--########################################################################################
out({c=0xFFF2CB,a=1,fs=13,x=tlx,y=tly,txt=forecast_day[i].." "..forecast_date[i]})
image({x=tlx,y=tly+7,h=50,w=50,file=weather_icon[i]})
out({c=0xffffff,a=1,fs=12,x=tlx+55,y=tly+25,txt=high_temp[i].."°/"..low_temp[i].."°"})
image({x=tlx+110,y=tly+3,file=wind_icon[i]})
out({x=tlx+112,y=tly+64,txt= wind_mph[i].." mph" })
out({c=0xffffff,a=1,fs=12,x=tlx,y=tly+67,txt=conditions_short[i]})
out({c=0xffffff,a=1,fs=12,x=tlx,y=tly+81,txt= precipitation[i].."% Chance of Precipitation"})
-- Sunrise & Sunset
out({c=0xEEE8AA,a=1,fs=12,x=tlx,y=tly+95,txt="S:"..sun_rise_24[i]})
  out({c=0x5F9EA0,a=1,fs=12,x=tlx+45,y=tly+95,txt=sun_set_24[i]})
-- Moonrise & Moonset
out({a=1,fs=12,x=tlx+80,y=tly+95,txt="|  M:"..moon_rise_24[i]})
   out({c=0x5F9EA0,a=1,fs=12,x=tlx+135,y=tly+95,txt=moon_set_24[i]})
 out({c=0xFAFAEC,a=1,fs=12,x=tlx,y=tly+109,txt=moon_phase[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--############################################################
--########################################################################################

--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################

And the conky:

##############################################
#  Settings
##############################################
max_specials 10000
max_user_text 1500000
background no
use_xft yes
#xftfont Sans:size=12
#xftalpha 1
font Mono:size=8
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1675 130
maximum_width 1675
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_left
gap_x 0
gap_y 8
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color1 86acad #darker blue
color2 b1c9c9 #lighter blue
text_buffer_size 100000
top_name_width 10
update_interval 240


lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load ~/v9000/weather_scriptmine.lua



TEXT

#7 Re: Tips, Tricks & Scripts » weather in conky (LUA scripts) updated 12/26/13! » 2014-12-08 21:00:40

Thanks for the Border section Sector11, made it very apparent where my troubles lay and I have now got it nice and tidy with no overlaps smile Really pleased you posted that because when the Moon one updated it blanked out the bottom 15 pixels or so of the Weather one!

Have also signed up for an image hosting account so at least a thumbnail of my displays will show for anyone who is interested.

953e00370614285.jpg

Here are the scripts:

Weather lua: weather_scriptmine.lua

--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--#######################################################################
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="arial"--font must be in quotes
default_font_size=13
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
starty=15
gap=15
ypos=0
ypos=starty+ypos
out({c=0xFFF2CB,a=1,fs=13,x=15,y=ypos,txt="WEATHER + MOON  "})
out({c=0xFFF2CB,a=1,fs=13,x=150,y=ypos,txt=weather_location})
image({x=20,y=35,h=70,w=70,file=now["weather_icon"]})
image({x=35,y=87,h=45,w=45,file=now["wind_icon"]})
--data titles
ypos=gap+ypos
out({c=0xFFF2CB,a=1,x=15,y=ypos,txt="NOW:"})
ypos=gap+7+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Temperature:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Feels Like:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Wind:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Gusting:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Humidity:"})
ypos=gap+ypos
out({c=0xC1CFB3,a=1,x=120,y=ypos,txt="Dew Point:"})
--output of data options
ypos=0
ypos=starty+gap+gap+7+ypos
out({c=0xffffff,a=1,x=60,y=30,txt=now["conditions"]})
ypos=ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["temp"].."°"})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["feels_like"].."°"})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["wind_mph"]})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["wind_gusts"] })
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["humidity"].."%"})
ypos=gap+ypos
out({c=0xffffff,a=1,x=200,y=ypos,txt=now["dew_point"].."°"})

--moon/sun rise/set
out({c=0xC1CFB3,a=1,x=285,y=53,txt="Precipitation:"})
out({c=0xffffff,a=1,x=372,y=53,txt= precipitation[1].."%"})
out({c=0xC1CFB3,a=1,x=285,y=68,txt="Sun Rise:"})
out({x=365,y=68,w=50,h=50,txt=sun_rise_24[1]})
out({c=0xC1CFB3,a=1,x=285,y=83,txt="Sun Set:"})
out({x=365,y=83,w=50,h=50,txt=sun_set_24[1]})
out({c=0xC1CFB3,x=285,y=98,txt=moon_phase[1] })
out({c=0xC1CFB3,a=1,x=285,y=113,txt="Moon Rise:"})
out({x=365,y=113,w=50,h=50,txt=moon_rise_24[1]})
out({c=0xC1CFB3,a=1,x=285,y=128,txt="Moon Set:"})
out({x=365,y=128,w=50,h=50,txt=moon_set_24[1]})

out({c=0xFFF2CB,x=430,y=20,fs=13,txt="NEXT 3 HOURS"})
image({w=30,h=30,x=430,y=30,file=now["fc_hour1_wicon"]})--good
out({x=470,y=45,txt=now["fc_hour1_time"].." "..now["fc_hour1_ampm_lc"].." Temp: "..now["fc_hour1_temp"].."°"})
out({x=470,y=60,txt=now["fc_hour1_cond_short"]})

image({w=30,h=30,x=430,y=65,file=now["fc_hour2_wicon"]})--good
out({x=470,y=80,txt=now["fc_hour2_time"].." "..now["fc_hour2_ampm_lc"].." Temp: "..now["fc_hour2_temp"].."°"})
out({x=470,y=95,txt=now["fc_hour2_cond_short"]})

image({w=30,h=30,x=430,y=100,file=now["fc_hour3_wicon"]})--good
out({x=470,y=115,txt=now["fc_hour3_time"].." "..now["fc_hour3_ampm_lc"].." Temp: "..now["fc_hour3_temp"].."°"})
out({x=470,y=129,txt=now["fc_hour3_cond_short"]})


--########################################################################################
--start or weather forecast repeat section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=5
out({c=0xFFF2CB,x=605,y=20,fs=13,txt="FORECAST"})
topy=260
ygap=110
--set coordinates for top left corners for each repeat 1st column
ady=topy+ygap
top_left_x_coordinate[1],top_left_y_coordinate[1]=605,45

top_left_x_coordinate[2],top_left_y_coordinate[2]=798,45

top_left_x_coordinate[3],top_left_y_coordinate[3]=991,45

--set coordinates for top left corners for each repeat 2nd column
top_left_x_coordinate[4],top_left_y_coordinate[4]=1184,45

top_left_x_coordinate[5],top_left_y_coordinate[5]=1377,45

top_left_x_coordinate[6],top_left_y_coordinate[6]=1500,45

--########################################################################################
for i=start_day,number_of_days-(start_day-1) do--start of day repeat, do not edit ########
local tlx=top_left_x_coordinate[i]--sets top left x position for each repeat ###################
local tly=top_left_y_coordinate[i]--sets top left y position for each repeat ###################
--########################################################################################
out({c=0xFFF2CB,a=1,fs=13,x=tlx,y=tly,txt=forecast_day[i].." "..forecast_date[i]})
image({x=tlx,y=tly+7,h=50,w=50,file=weather_icon[i]})
out({c=0xffffff,a=1,fs=12,x=tlx+55,y=tly+25,txt=high_temp[i].."°/"..low_temp[i].."°"})
image({x=tlx+110,y=tly-10,file=wind_icon[i]})
out({x=tlx+112,y=tly+51,txt= wind_mph[i].." mph" })
out({c=0xffffff,a=1,fs=12,x=tlx,y=tly+67,txt=conditions_short[i]})
out({c=0xffffff,a=1,fs=12,x=tlx,y=tly+83,txt= precipitation[i].."% Chance of Precipitation"})
--########################################################################################
end--of forecast repeat section ##########################################################
--############################################################
--########################################################################################

--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################


Weather conky:

##############################################
#  Settings
##############################################
max_specials 10000
max_user_text 1500000
background no
use_xft yes
#xftfont Sans:size=12
#xftalpha 1
font Mono:size=8
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1675 130
maximum_width 1675
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_left
gap_x 0
gap_y 8
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color1 86acad #darker blue
color2 b1c9c9 #lighter blue
text_buffer_size 100000
top_name_width 10
update_interval 1


lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load ~/v9000/weather_scriptmine.lua



TEXT

Conky for Teo's 5 Moon script:

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer no
use_xft yes

# Update interval in seconds
update_interval 3

# Minimum size of text area
minimum_size 1600 100
maximum_width 1600

override_utf8_locale yes

# Draw shades?
draw_shades yes

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
#font freesans -12
xftfont Arial:size=10
uppercase no # set to yes if you want all text to be in uppercase

###  Borders Section  ###
draw_borders no ## <<--- YES here
# Stippled borders?
stippled_borders 5 ##<<--- nice affect
# border margins
border_inner_margin 5 <<-- this might explain the extra space too.
border_outer_margin 0
# border width
border_width 2  ##<--- well, you want to see it don't you?
# graph borders
draw_graph_borders no
#default_graph_size 15 40
###  End Borders Secton  ##

# Default colors and also border colors, grey90 == e5e5e5
default_color fff

own_window_colour 5F4A1C
own_window_transparent yes

# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 148

imlib_cache_size 0
# stuff after 'TEXT' will be formatted on screen

TEXT
${texeci 500 bash $HOME/5_Moon/moon}
${image $HOME/5_Moon/current.png -p 0,-3 -s 90x90}
${voffset -36}${color C1CFB3}${goto 111}${execpi 600 sed -n '1p' $HOME/5_Moon/today} ${execpi 600 sed -n '3p' $HOME/5_Moon/today}
${goto 111}${execpi 600 sed -n '47p' $HOME/5_Moon/today}
${goto 111}${execpi 600 sed -n '52p' $HOME/5_Moon/today}${execpi 600 sed -n '53p' $HOME/5_Moon/today}
${goto 111}${execpi 600 sed -n '54p' $HOME/5_Moon/today}${execpi 600 sed -n '55p' $HOME/5_Moon/today}
${goto 111}${execpi 600 sed -n '9p' $HOME/5_Moon/today} ${execpi 600 sed -n '10p' $HOME/5_Moon/today}${color}


${voffset -112}${image $HOME/5_Moon/3.png -p 773,9 -s 70x70}${image $HOME/5_Moon/9.png -p 966,9 -s 70x70}

${goto 845}${execpi 600 sed -n '4p' $HOME/5_Moon/week}${goto 1040}${execpi 600 sed -n '10p' $HOME/5_Moon/week}
${goto 845}${execpi 600 sed -n '5p' $HOME/5_Moon/week}${goto 1040}${execpi 600 sed -n '11p' $HOME/5_Moon/week}
${goto 845}${execpi 600 sed -n '6p' $HOME/5_Moon/week}${goto 1040}${execpi 600 sed -n '12p' $HOME/5_Moon/week}

${voffset -96}${image $HOME/5_Moon/15.png -p 1159,9 -s 70x70}${image $HOME/5_Moon/21.png -p 1353,9 -s 70x70}

${goto 1233}${execpi 600 sed -n '16p' $HOME/5_Moon/week}${goto 1427}${execpi 600 sed -n '22p' $HOME/5_Moon/week}
${goto 1233}${execpi 600 sed -n '17p' $HOME/5_Moon/week}${goto 1427}${execpi 600 sed -n '23p' $HOME/5_Moon/week}
${goto 1233}${execpi 600 sed -n '18p' $HOME/5_Moon/week}${goto 1427}${execpi 600 sed -n '24p' $HOME/5_Moon/week}


${image $HOME/5_Moon/A.png -p 350,1 -s 40x40}${image $HOME/5_Moon/B.png -p 435,1 -s 40x40}${image $HOME/5_Moon/C.png -p 520,1 -s 40x40}${image $HOME/5_Moon/D.png -p 605,1 -s 40x40}${image $HOME/5_Moon/A.png -p 670,1 -s 40x40}



${voffset -138}${font Arial:size=8}${goto 350}${execpi 600 sed -n '16p' $HOME/5_Moon/today}${goto 435}${execpi 600 sed -n '22p' $HOME/5_Moon/today}${goto 520}${execpi 600 sed -n '28p' $HOME/5_Moon/today}${goto 605}${execpi 600 sed -n '34p' $HOME/5_Moon/today}${goto 680}${execpi 600 sed -n '40p' $HOME/5_Moon/today}
${goto 350}${execpi 600 sed -n '18p' $HOME/5_Moon/today}${goto 435}${execpi 600 sed -n '24p' $HOME/5_Moon/today}${goto 520}${execpi 600 sed -n '30p' $HOME/5_Moon/today}${goto 605}${execpi 600 sed -n '36p' $HOME/5_Moon/today}${goto 680}${execpi 600 sed -n '42p' $HOME/5_Moon/today}
${goto 350}${execpi 600 sed -n '19p' $HOME/5_Moon/today}${goto 435}${execpi 600 sed -n '25p' $HOME/5_Moon/today}${goto 520}${execpi 600 sed -n '31p' $HOME/5_Moon/today}${goto 605}${execpi 600 sed -n '37p' $HOME/5_Moon/today}${goto 680}${execpi 600 sed -n '43p' $HOME/5_Moon/today}${font}

I didn't realise that the v9000 script does sun|moon rise|set|phase for each day so really appreciate you pointing that out. I will certainly be looking to incorporate this into my current v9000 and see how I like it compared to running the two.

Many thanks for the related conky files, they will be a great help!

#8 Re: Tips, Tricks & Scripts » weather in conky (LUA scripts) updated 12/26/13! » 2014-12-07 18:06:34

Thanks sector11 - I like the layout and my machine feels my own again big_smile

My husband, Robbie, has been recently searching for a good moon phase widget/screenlet and is at present loading Cairo Dock just for the moon (!!). I told him I'd look for a conky so downloaded Teo's "5 moon phase" script and planned to wait until he had decided how he wanted it laid out ... but the temptation was too great wink

I've spent today adding it to my desktop (It  IS Sunday after all!) - screenshot here

https://www.dropbox.com/s/7f4bs7db3wdvp … n.png?dl=0

I see from the crunchbang thread that you combined this script with Teo's "Weather_com_Metric". I haven't done any script combining but might attempt, over the winter solstice down-time, to combine it with the v9000. It would allow me to put the moonrise/set info into Robbie's conky, together with any weather info he might like, and enable me to just use one conky for my display too.

In the meantime I am going to run a script on boot that loads the "5 moon phase" first and then the v9000, otherwise the moon info overlaps the bottom of my weather stuff. Can't see, to figure out why there is space before the moon text starts - I don't have any borders specified.

I am temporarily using a 4:3 monitor at the moment and, lovely though the display is, I am looking forward to getting back to my 16:9 - at which point I expect I shall be fiddling again!

I would be happy to share my scripts here but fear that they are not as elegant as they should be!!

#9 Re: Tips, Tricks & Scripts » weather in conky (LUA scripts) updated 12/26/13! » 2014-12-06 17:18:02

@destripato, what can I say apart from thank you, thank you, thank you!

I have been away for over two weeks with no internet access and am absolutely blissed upon my return that I now have my weather back. This was the first conky layout that I worked hard at getting how I wanted and had not been able to find the time to start all over again with a different script. I am so pleased it's working again  big_smile

I don't use any image hosting but I've put a screenshot on dropbox:
https://www.dropbox.com/s/51vex8rn0bjv9 … y.png?dl=0

Thanks again, you are a star!

#10 Re: Tips, Tricks & Scripts » weather in conky (LUA scripts) updated 12/26/13! » 2014-11-15 12:48:07

Hi, I downloaded the new version of v9000 but I am still getting the same error as before:

Conky: llua_do_call: function conky_weather execution failed: /home/hecate/v9000/v9000.lua:645: bad argument #1 to '?' (string expected, got nil)

It just doesn't seem to want to work for me  sad

#11 Re: Tips, Tricks & Scripts » weather in conky (LUA scripts) updated 12/26/13! » 2014-11-05 15:04:51

Hi all

I first used the v9000 weather script a few years back and loved it but it conked out a few years ago and I tried using the new one but couldn't get it to work. I spent quite a while getting the layout and data presented just how I wanted and after finding an old screenshot of my desktop yesterday decided to give it another go.

I downloaded the package from page 1 here, extracted as instructed (having made a back up of my old one), edited the .v9000_config.lua and placed it in my home folder then ran the default conky-weather but I am getting this output from the terminal

Conky: llua_do_call: function conky_weather execution failed: /home/hecate/v9000/v9000.lua:645: bad argument #1 to '?' (string expected, got nil)

I searched for the 'v9000.lua:645: bad argument #1 to '?' (string expected, got nil)' error and found it on this thread but it was in reference to the conky chronograph v9000 and the poster was directed to different weather scripts.

I have had a complete reinstall of my OS since this last worked and wondered if I was missing any dependencies but tried one of Teo's scripts and it ran fine.

I would dearly like to get this working as the v9000 script has so much weather info that you can bring in. If anyone can help I'd be really grateful. Thanks in advance.

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