SEARCH

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

You are not logged in.

#1326 2014-02-23 18:14:22

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

that could be right and the freedom of choice with Linux means you have a freedom to choose the OS that is right for you.

+1



Sector11 wrote:

I'm in the middle of "The Teo Conky Wunderground Weather Station"
http://s20.postimg.org/ftzdyb5op/2014_02_23_13_13_02_1920x1080_Sector11.jpg
What's that big empty space you say .. why that would be for: 5) Moon phases' script.

It needs a home. cool

BTW, CPU usage at the bottom - 10 conkys, medit, iceweasel and claws-mail are running as well.

Coming soon to a post near you!

Looks awesome mate, I'm waiting for the final version!

Last edited by TeoBigusGeekus (2014-02-23 18:14:34)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

Be excellent to each other!

#1327 2014-02-23 19:48:19

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

Looks awesome mate, I'm waiting for the final version!

Of course it does, the engineer built a great framework for the architect to work with! lol lol lol

I've run into a speed bump though.  For example in "today" (line numbers mine):

01|Lunar phase
02|today is
03|Waning Crescent

works as "Lunar phase today is" can be hard coded using and then using "3p"

${alignc}${color1}Lunar phase today is ${execpi 600 sed -n '3p' /media/5/Conky/Teo_wun/5_Moon/today}${color}

But for us architects that know little to nothing of kung-fu magic of the engineering tool: sed ... lines like:

09|The moon is in 
10|zodiac sign Sagittarius

make it difficult to get: Sagittarius  smile

09|The moon is in zodiac sign
10|Sagittarius

would be much easier.   wink  hint, hint  ...  I'm such a little  devil
... kind of like the "week" layout.

Oh and since I'm hinting:

45|The moon is growing smaller (old moon)
46|Fraction of the moon: 0.77815367256252
47|Illumination of the moon disk: 41 %

would probably be easier to use (in small pieces) as:

45|The moon is growing
46|smaller
47|(old moon)
48|Fraction of the moon:
49|0.77815367256252
50|Illumination of the moon disk:
51|41 %

2014_02_23_16_14_07_312x966_Sector11.jpg


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

Offline

#1328 2014-02-23 20:23:54

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

To get only the zodiac sign without the "zodiac sign" part, use this line in your conkyrc:

sed -n 10p $HOME/5_Moon/today | sed 's/^.*sign //'

To grab the illumination, use

sed -n '/Illumination/p' $HOME/5_Moon/today | sed 's/^.*: //'

Simirarly, for the moon's fraction

sed -n '/Fraction/p' $HOME/5_Moon/today | sed 's/^.*: //'

To print whether the moon is growing smaller or bigger

sed -n '/The moon is growing/p' $HOME/5_Moon/today | sed 's/^.*growing //' | sed 's/ .*$//'

and whether it's a young or old one

sed -n '/The moon is growing/p' $HOME/5_Moon/today | sed 's/^.*growing //' | sed 's/^.*(//' | sed 's/ .*$//'

Too much piping, I know tongue

Last edited by TeoBigusGeekus (2014-02-23 20:24:06)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1329 2014-02-23 20:36:46

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

To get only the zodiac sign without the "zodiac sign" part, use this line in your conkyrc:

Too much piping, I know tongue

Nooooo ... not too much ...  I'll try those, thank you!

... but let's leave the plumbers out of this OK.  lol lol lol lol lol

Last edited by Sector11 (2014-02-23 20:38:10)


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

Offline

#1330 2014-02-24 10:22:02

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Those weather scripts are very neat and on one laptop, they work fine, but on another, this is what happens:
http://s7.postimg.org/grd94e1zv/conk.png

How could I fix it?

Offline

#1331 2014-02-24 12:33:15

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lockheed wrote:

Those weather scripts are very neat and on one laptop, they work fine, but on another, this is what happens:
http://s7.postimg.org/grd94e1zv/conk.png

How could I fix it?

What script are you using:

  • 1a)Accuweather_ConkyWeather_Font - 1a_12-2-14

  • 1b1)Accuweather - Images - 1b1_12-2-14

  • 1b2)Accuweather - ConkyWeather font - 1b2_12-2-14

  • 1c)Accuweather Hourly Forecast - 1c_12-2-14

  • 1d)Accuweather RSS - 1d_12-2-14

  • 2a)WUnderground ICAL - International users - 2a_12-2-14

  • 2b)WUnderground API - All users - 2b_15-2-14

  • 3)NWS XML - USA users - 3_12-2-14

  • 4) Weather.com conky script - all users - 4_12-2-14

  • 5) Moon phases' script - 5_12-2-14

From the looks of it, my guess is: 1b1)Accuweather - Images - 1b1_12-2-14

  1. Is it the latest version: 1b1_12-2-14 or a previous version?

  2. The OS on both laptops - are they the same?

    1. If different which one works and which one doesn't?

  3. Are you using a composite manager?

    1. If yes, what or which one?

One suggestion off the top of my head:

Change:

own_window_type override

to:

own_window_type normal

That should get rid of the black background.

If you modified the conky in anyway please include the code - in the menu above the reply box - between Img and U-List.


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

Offline

#1332 2014-02-24 14:22:57

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hey Sector11, thanks for the reply.

1. I am using the newest 1b1)Accuweather - Images - 1b1_12-2-14 (downloaded yesterday), but the exact same things happens with 1b2)Accuweather - ConkyWeather font - 1b2_12-2-14.

2. Both laptops run up to date Arch linux.
Laptop where it works runs Openbox+compton, and 10.2 mesa-git radeon drivers
Laptop where it doesn't work runs Gnome 3.8, with the same above drivers

The problem is not the black background (which I had to enable, because on transparent background entire conky was totally scrambled. Pity, but I saw no other choice.
The problem is, that the text is not aligned with the graphics. Take a look at the picture.

Conky was not modified in another way, except for those:

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft yes

# Update interval in seconds
update_interval 3

# Minimum size of text area
minimum_size 355 500
maximum_width 357

override_utf8_locale yes

# Draw shades?
draw_shades yes

As for the own_window_type suggestion, I had to change it to desktop to even see conky, so that's is not override anyway.

Offline

#1333 2014-02-24 14:49:13

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lockheed wrote:

Those weather scripts are very neat and on one laptop, they work fine, but on another, this is what happens:
http://s7.postimg.org/grd94e1zv/conk.png

How could I fix it?

Your problem is the position of the images.

This is easily fixed by changing the $image lines in your conkyrc file.
For example:

${image $HOME/1b1_accuweather_images/16.png -p 230,330 -s 90x54}

This command tells conky to put 16.png in position X=230 (pixels), Y=330 (pixels). The image will have a size of 90x54 pixels.
In order to tell conky to put the image in a lower position, change the Y value, ie. increase it.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1334 2014-02-24 15:19:32

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

@TeoBigusGeekus,

Excellent. Then that's fixed! Thanks.
But there is a whole line of problems. Here's two more:

1. The conky script remains immune to changes of http location in 1b1 file. Whatever I put in there, it always shows the same values and the same weather icons. I of course restarted it, killed all conky instances - nothing helps.

2. http://s30.postimg.org/xlcgmf001/conk2.png

Last edited by lockheed (2014-02-24 15:26:03)

Offline

#1335 2014-02-24 16:06:24

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lockheed wrote:

Hey Sector11, thanks for the reply.

You're welcome ... I see Teo replied and got it fixed for you ...

You're new problem is a puzzle for me as well.

Now as to the transparent vs black background if you can run lua scripts, give draw-bg.lua a run for it's money --- example...

lua_load /media/5/Conky/Teo_wun/LUA/draw-bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}\
${color5}↑: ${color9}${execi 600 sed -n '39p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}${alignr 5}\
${color5}T: ${color7}${execi 600 sed -n '67p' /media/5/Conky/Teo_wun/Conditions}°
${color5}↓: ${color7}${execi 600 sed -n '44p' /media/5/Conky/Teo_wun/Simple_Forecast}°${alignr 5}\
${color5}±: ${execi 600 sed -n '113p' /media/5/Conky/Teo_wun/Conditions}°
--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

Above and After TEXT  (requires a composite manager or it blinks!)

 lua_load ~/wea_conky/draw_bg.lua
 TEXT
 ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}

OR Both above TEXT (no composite manager required - no blinking!)

 lua_load ~/wea_conky/draw_bg.lua
 lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
 TEXT

Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
  See below:        1  2 3 4 5 6        7

${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20             corner_radius
2 = 0             x_position
3 = 0             y_position
4 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

######### calendar function ##################################################

then to use it, you activate the calendar function BELOW TEXT like this

${lua luacal {settings}}

#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
#    x=x position top left
#    y=y position top left
#    tf=title font, eg "mono" must be in quotes
#    tfs=title font size
#    tc=title color
#    ta=title alpha
#    bf=body font, eg "mono" must be in quotes
#    bfs=body font size
#    bc=body color
#    ba=body alpha
#    hf=highlight font, eg "mono" must be in quotes
#    hfs=highlight font size
#    hc=highlight color
#    ha=highlight alpha
#    sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts

#    gt=gap from title to body
#    gh=gap horizontal between columns
#    gv=gap vertical between rows
#    sd=start day, 0=Sun, 1=Mon

#    hstyle = heading style, 0=just days, 1=date insert
#    tdf=title date font, eg "mono" must be in quotes
#    tdfs=title date font size
#    tdc=title date color
#    tda=title date alpha

# test line
-- ${lua luacal {x=40,y=40,tf="Monofur",tfs=24,tc=0xFFDEAD,ta=1,bf="Monofur",bfs=24,bc=0xFFDEAD,ba=1,hf="Monofur",hfs=24,hc=0x00BFFF,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="Monofur",tdfs=24,tdc=0x00BFFF,tda=1}}


]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
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)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf		or "mono"
local tfontsize=caltab.tfs	or 12
local tc=caltab.tc			or 0xffffff
local ta=caltab.ta			or 1
local bfont=caltab.bf		or "mono"
local bfontsize=caltab.bfs	or 12
local bc=caltab.bc			or 0xffffff
local ba=caltab.ba			or 1
local hfont=caltab.hf		or "mono"
local hfontsize=caltab.hfs	or 12
local hc=caltab.hc			or 0xff0000
local ha=caltab.ha			or 1
local spacer=caltab.sp		or " "
local gaph=caltab.gh		or 20
local gapt=caltab.gt		or 15
local gapl=caltab.gv		or 15
local sday=caltab.sd		or 0
local hstyle=caltab.hstyle	or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
    if i<=start_day then
    dnum[i]="  "
    else
    dn=i-start_day
        if dn=="nil" then dn=0 end
        if dn<=9 then dn=(spacer .. dn) end
        if i>x then dn="" end
        dnum[i]=dn
        dnumh[i]=dn
        if dn==(spacer .. today) or dn==today then
        dnum[i]=""
        end
        if dn==(spacer .. today) or dn==today then
        dnumh[i]=dn
        place=i
        else dnumh[i]="  "
        end
    end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
    if tonumber(sday)==0 then
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    else
    dys={"MO","TU","WE","TH","FR","SA","SU"}
    end
    --draw calendar titles
elseif hstyle==1 then
    if tonumber(sday)==0 then
    dys={"SU","MO"," ","  ","  ","FR","SA"}
    cairo_text_extents(cr,"MO",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    else
    dys={"MO","TU"," ","  ","  ","SA","SU"}
    cairo_text_extents(cr,"TU",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end
-- end main function #########################################################

One thing to watch...
At the top of the LUA file it explains that you can put both lines needed above TEXT or one above and one below TEXT.

With the ${image} commands in a conky use one above and one below or the images get messed up.

At lease with OB and compton (#! & Debian SID).  If you find different results with GNOME I'd like to know.


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

Offline

#1336 2014-02-24 17:52:51

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

The Teo Conky Wunderground Weather Station
  • 2b)WUnderground API - All users - 2b_15-2-14

  • 5) Moon phases' script - 5_12-2-14

2014_02_24_14_26_04_1920x1080_Sector11.jpg«- mono|colour -» 2014_02_24_15_03_47_1920x1080_Sector11.jpg

Required for this layout:
conky font: monofur
Teo_Weather_Clock.lua
Teo_Weather_Clock.lua fonts: monofur, Liquid Crystal

Nice to have:
draw.-bg.lua - one post above this post

WARNING:  Check the "paths" these are in:

  • /media/5/Conky/Teo_wun/

  • /media/5/Conky/Teo_wun//5_moon

Teo_Weather_Clock.lua
lang="Greek", -- English French Greek Spanish
hour=24, -- 12 | 24 - there is an oops! for Feb -57 days? in 12 hour mode - I need to check it.
- - - that will take a while .. I know very little about LUA
2014_02_24_14_45_01_1920x1080_Sector11.jpg

T-wunClock.conky

# pkill -xf "conky -c /media/5/Conky/Teo_wun/T-wunClock.conky" &
# conky -c /media/5/Conky/Teo_wun/T-wunClock.conky &
# Thank you:
# TeoBigusGeekus - for his wonderful weather scripts
# - - This one is: 2b_Wunderground_API - dated 24 Feb 2014
# Chronograph LUA - Sector11 - tweaked with the help of mrpeachy
##### - See LUA for more (originally 4 clocks by  mrpeachy)
# mounted.lua - londonali1010, mrpeachy, dk75

###  Begin Window Settings  ##################################################
# 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,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Teo Wun Clock

# 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 normal
# own_window_argb_visual yes

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

#minimum_size 420 420  ## width, height
#maximum_width 420     ## width

### For use with The-Clock.lua
minimum_size 300 0  ## width, height
maximum_width 300     ## width

gap_x 10 #15        ### left &right
gap_y 10        ### up & down

### alignment values or top_left, bottom_right, etc
# tl, tm, tr
# ml, mm, mr
# bl, bm, br
alignment tr

####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=11
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
###  Color Settings  #########################################################
draw_shades no  ## <<<--- yes --- To see it easier on light screens.
default_shade_color 000000
draw_outline no #### <<<--- yes --- Amplifies text if yes OJO with changing fonts
default_outline_color 000000

default_color DCDCDC #220 220 220	Gainsboro
#default_color C0C0C0 #192 192 192 Silver
#default_color B0E0E6 #176 224 230 PowderBlue
#default_color D8BFD8 #216 191 216 Thistle
color0 8FBC8F #DarkSeaGreen
#color1 C0C0C0 # Silver
#color1 D3D3D3 #LightGrey
color1 778899 #LightSlateGray
color2 F5F5DC #Beige
color3 87CEFA #LightSkyBlue
#color3 87CEFA #E0FFFF #LightCyan
color4 48D1CC #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 B0E0E6 #PowderBlue
#color7 5F9EA0 #CadetBlue
#color8 FFFFE0 #LightYellow
color8 FFD700 #Gold
#color8 F0E68C #Khaki
color9 FFA07A #LightSalmon
#color9 CD5C5C #IndianRed
#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 yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

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

# 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

# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes

# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes


imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

## default bar size
default_bar_size 200 20

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## draw-bg.lua - Above and After TEXT - requires a composite manager.
##
lua_load /media/5/Conky/Teo_wun/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.2}
#
# ----------------------------------------------------------------------------
## OR Both above TEXT - No composite manager required.
#
#lua_load /media/5/Conky/TeoWeatherClock/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.2
#
# TEXT
### Teo Weather Clock ########################################################
lua_load /media/5/Conky/Teo_wun/LUA/Teo_Weather_Clock.lua
lua_draw_hook_post main
##############################  End LUA Settings  ###

update_interval 1
## USE THIS TEST Image:
##		${image /media/5/Conky/images/red+x.png -p
##TEXT
##${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}\
##${texeci 600 bash /media/5/Conky/Teo_wun/wunder}\
##${texeci 600 bash /media/5/Conky/Teo_wun/5_Moon/moon}\

TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}\
${texeci 600 bash /media/5/Conky/Teo_wun/wunder}\
${texeci 600 bash /media/5/Conky/Teo_wun/5_Moon/moon}\
${color5}↑: ${color9}${execi 600 sed -n '39p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}${alignr 5}\
${color5}T: ${color7}${execi 600 sed -n '67p' /media/5/Conky/Teo_wun/Conditions}°
${color5}↓: ${color7}${execi 600 sed -n '44p' /media/5/Conky/Teo_wun/Simple_Forecast}°${alignr 5}\
${color5}±: ${execi 600 sed -n '113p' /media/5/Conky/Teo_wun/Conditions}°






${image /media/5/Conky/Teo_wun/5_Moon/current.png -p 60,60 -s 175x175}\
${image /media/5/Conky/Teo_wun/Now.png -p 93,113 -s 108x65}







${color5}Hum${alignr 5}D.P.${color}
${color7}${execi 600 sed -n '69p' /media/5/Conky/Teo_wun/Conditions}${alignr 5}${execi 600 sed -n '95p' /media/5/Conky/Teo_wun/Conditions}°${color}
${color5}Pressure${alignr 5}UV Index${color}
${color7}${execi 600 sed -n '85p' /media/5/Conky/Teo_wun/Conditions} | ${execi 600 sed -n '89p' /media/5/Conky/Teo_wun/Conditions}${alignr 15}${execi 600 sed -n '121p' /media/5/Conky/Teo_wun/Conditions}${color}
${font monofur:bold:size=14}${alignc}${execi 600 sed -n '63p' /media/5/Conky/Teo_wun/Conditions}${font}
${color5}Wind ${color7}${execi 600 sed -n '81p' /media/5/Conky/Teo_wun/Conditions} kph${goto 130}${color5}Gusts ${color7}${execi 600 sed -n '83p' /media/5/Conky/Teo_wun/Conditions} kph${alignr 5}${color5}←→ ${color7}${execi 600 sed -n '73p' /media/5/Conky/Teo_wun/Conditions}${color}
${alignc}${color1}The current moon phase is from
${alignc}${execpi 600 sed -n '5p' /media/5/Conky/Teo_wun/5_Moon/today} ${execpi 600 sed -n '6p' /media/5/Conky/Teo_wun/5_Moon/today}${execpi 600 sed -n '7p' /media/5/Conky/Teo_wun/5_Moon/today} ${execpi 600 sed -n '8p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
${font monofur:bold:size=10}${goto 12}${membar 0,15} ${execi 600 echo `date --date="0 day" | awk '{print $1" "$3" "$2}'`} ${membar 0,15}${color}\
		${goto 135}${color7}→  ${execpi 600 sed -n '10p' /media/5/Conky/Teo_wun/5_Moon/today | sed 's/^.*sign //'}
${image /media/5/Conky/Teo_wun/d1.png -p 0,379 -s 60x36}\
${image /media/5/Conky/Teo_wun/n1.png -p 60,379 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/current.png -p 125,375 -s 40x40}\
${color9}${execi 600 sed -n '39p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '102p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '3p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}Growing ${execpi 600 sed -n '/The moon is growing/p' /media/5/Conky/Teo_wun/5_Moon/today | sed 's/^.*growing //' | sed 's/ .*$//'}${color}
	${goto 52}${execi 600 sed -n '57p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '44p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
		${goto 180}${color7}${execpi 600 sed -n '/The moon is growing/p' /media/5/Conky/Teo_wun/5_Moon/today | sed 's/^.*growing //' | sed 's/^.*(//g' | sed 's/ .*$//'} moon${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="1 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 135}${color7}→  ${execpi 600 sed -n '6p' /media/5/Conky/Teo_wun/5_Moon/week}
${image /media/5/Conky/Teo_wun/d2.png -p 0,435 -s 60x36}\
${image /media/5/Conky/Teo_wun/n2.png -p 60,435 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/3.png -p 125,431 -s 40x40}\
${color9}${execi 600 sed -n '145p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '208p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '4p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}${execpi 600 sed -n '5p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${execi 600 sed -n '163p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '150p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="2 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 135}${color7}→  ${execpi 600 sed -n '12p' /media/5/Conky/Teo_wun/5_Moon/week}
${image /media/5/Conky/Teo_wun/d3.png -p 0,491 -s 60x36}\
${image /media/5/Conky/Teo_wun/n3.png -p 60,491 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/9.png -p 125,487 -s 40x40}\
${color9}${execi 600 sed -n '251p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '314p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '10p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}${execpi 600 sed -n '11p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${execi 600 sed -n '269p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '256p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="3 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 135}${color7}→  ${execpi 600 sed -n '18p' /media/5/Conky/Teo_wun/5_Moon/week}
${image /media/5/Conky/Teo_wun/d4.png -p 0,547 -s 60x36}\
${image /media/5/Conky/Teo_wun/n4.png -p 60,547 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/15.png -p 125,543 -s 40x40}\
${color9}${execi 600 sed -n '357p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '420p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '16p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}${execpi 600 sed -n '17p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${execi 600 sed -n '375p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '362p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="4 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 135}${color7}→  ${execpi 600 sed -n '24p' /media/5/Conky/Teo_wun/5_Moon/week}
${image /media/5/Conky/Teo_wun/d5.png -p 0,603 -s 60x36}\
${image /media/5/Conky/Teo_wun/n5.png -p 60,603 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/21.png -p 125,599 -s 40x40}\
${color9}${execi 600 sed -n '463p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '526p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '22p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}${execpi 600 sed -n '23p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${execi 600 sed -n '481p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '468p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="5 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 135}${color7}→  ${execpi 600 sed -n '30p' /media/5/Conky/Teo_wun/5_Moon/week}
${image /media/5/Conky/Teo_wun/d6.png -p 0,659 -s 60x36}\
${image /media/5/Conky/Teo_wun/n6.png -p 60,659 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/27.png -p 125,655 -s 40x40}\
${color9}${execi 600 sed -n '569p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '632p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '28p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}${execpi 600 sed -n '29p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${execi 600 sed -n '587p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '574p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="6 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 135}${color7}→  ${execpi 600 sed -n '36p' /media/5/Conky/Teo_wun/5_Moon/week}
${image /media/5/Conky/Teo_wun/d7.png -p 0,715 -s 60x36}\
${image /media/5/Conky/Teo_wun/n7.png -p 60,715 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/33.png -p 125,711 -s 40x40}\
${color9}${execi 600 sed -n '675p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '738p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '34p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}${execpi 600 sed -n '35p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${execi 600 sed -n '693p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '680p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="7 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 135}${color7}→  ${execpi 600 sed -n '42p' /media/5/Conky/Teo_wun/5_Moon/week}
${image /media/5/Conky/Teo_wun/d8.png -p 0,771 -s 60x36}\
${image /media/5/Conky/Teo_wun/n8.png -p 60,771 -s 60x36}\
${image /media/5/Conky/Teo_wun/5_Moon/39.png -p 125,767 -s 40x40}\
${color9}${execi 600 sed -n '781p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '844p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 180}${color7}${execpi 600 sed -n '40p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 180}${color7}${execpi 600 sed -n '41p' /media/5/Conky/Teo_wun/5_Moon/week}${color}
	${goto 52}${execi 600 sed -n '799p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '786p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="8 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 130}${color}↓ Current Moon Cycle ↓
${image /media/5/Conky/Teo_wun/d9.png -p 0,827 -s 60x36}\
${image /media/5/Conky/Teo_wun/n9.png -p 60,827 -s 60x36}\
${color9}${execi 600 sed -n '887p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
	${goto 52}${execi 600 sed -n '950p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 130}${color}New ${color7}→ ${execi 600 sed -n '18p' /media/5/Conky/Teo_wun/5_Moon/today} \
${execi 600 sed -n '19p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 130}${color7}~ ${execi 600 sed -n '20p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
	${goto 52}${execi 600 sed -n '905p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '892p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
		${goto 130}${color}1st ${color7}→ ${execi 600 sed -n '24p' /media/5/Conky/Teo_wun/5_Moon/today} \
${execi 600 sed -n '25p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
${goto 12}${membar 0,15} ${color4}${execi 600 echo `date --date="9 day" | awk '{print $1" "$3" "$2}'`}${color} ${membar 0,15}\
		${goto 130}${color7}~ ${execi 600 sed -n '26p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
${image /media/5/Conky/Teo_wun/d10.png -p 0,883 -s 60x36}\
${image /media/5/Conky/Teo_wun/n10.png -p 60,883 -s 60x36}\
${color9}${execi 600 sed -n '993p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
		${goto 130}${color}Full ${color7}→ ${execi 600 sed -n '30p' /media/5/Conky/Teo_wun/5_Moon/today} \
${execi 600 sed -n '31p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
	${goto 52}${execi 600 sed -n '1056p' /media/5/Conky/Teo_wun/Simple_Forecast}%\
		${goto 130}${color7}~ ${execi 600 sed -n '32p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
	${goto 52}${color3}↓↓↓↓${color}\
		${goto 130}${color}Last ${color7}→ ${execi 600 sed -n '36p' /media/5/Conky/Teo_wun/5_Moon/today} \
${execi 600 sed -n '37p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
	${goto 52}${execi 600 sed -n '1011p' /media/5/Conky/Teo_wun/Simple_Forecast}\
		${goto 98}${color7}${execi 600 sed -n '998p' /media/5/Conky/Teo_wun/Simple_Forecast}°${color}\
		${goto 130}${color7}~ ${execi 600 sed -n '38p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
${goto 12}${membar 0,110}		${goto 130}${color}NEW ${color7}→ ${execi 600 sed -n '42p' /media/5/Conky/Teo_wun/5_Moon/today} \
${execi 600 sed -n '43p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
${goto 40}${membar 0,55}\
		${goto 130}${color7}~ ${execi 600 sed -n '44p' /media/5/Conky/Teo_wun/5_Moon/today}${color}
Angular diameter${goto 170}Distance from us
   ${color8} sun  ${execi 600 sed -n '51p' /media/5/Conky/Teo_wun/5_Moon/today}\
${goto 170}${execi 600 sed -n '55p' /media/5/Conky/Teo_wun/5_Moon/today}
   ${color1}moon  ${execi 600 sed -n '49p' /media/5/Conky/Teo_wun/5_Moon/today}\
${goto 170}${execi 600 sed -n '53p' /media/5/Conky/Teo_wun/5_Moon/today}
${color}${hr}

Teo_Weather_Clock.lua

--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
 21 Jun 2012 - Chronograph modifications by Sector11
 22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
 12 Nov 2012 - memory leak plugged - mrpeachy
 26 Nov 2012 - The Clock - Sector11 (small version)

use in conkyrc

lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT

 -- INDEX use search|find with: -- ### sonething ###

 -- ### CLOCK POSITION - AND DEFAULTS ###
 -- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
 --     See lines 39 to 41 for overall size changes
 -- ### START DIAL B ### Day Names Dial ###
 --     See Lines 77 - 79 and 145 for changes
 -- ### START DIAL C ### Month Names Dial ###
 --     See Lines 143 -145 and 192 for changes
 -- ### START DIAL D ### Day Numbers Dial ###
 --     See Lines 226 & 257 for  changes
 -- ### START CLOCK A ###
 --     See Lines  &  and 456 & 483 changes
 -- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
 -- CLOCK A HOUR HAND
 -- CLOCK A MINUTE HAND SETUP
 -- CLOCK A SECOND HAND SETUP
 -- PART SECOND HAND Lines: 503 519, 531

NOTE:  Putting ### CLOCK A ### last insures that it's functions are written
       over the other dials.
]]

require 'cairo'
 -- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=153, --from 135 = +40
center_y=153, --from 135
radius=140,
lang="Greek", -- English French Greek Spanish
hour=24, -- 12 | 24
second=true, --true | false - Seconds: dots and numbers IF 12HR
line=true, -- true | false - Part Second Hand
handday=false, -- DAY NAME hand - true or false
--handdaynum=false, -- DAY NUMBER hand - true or false
handmonth=false, -- MONTH NAME hand - true or false
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}

 -- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
  return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)

function conky_main()
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 extents=cairo_text_extents_t:create()
tolua.takeownership(extents)

 -- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
 -- ############################ CLOCK 12|24 HR SELECTOR ###

 -- ### SET BORDER OPTIONS FOR "CLOCKS" ####################
--local clock_border_width=0
 -- set color and alpha for clock border
--local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
 -- gap from clock border to minute marks
local b_to_m=0
 -- #################### SET BORDER OPTIONS FOR "CLOCKS" ###

 -- ### START DIAL B ### Day Names Dial ####################
 -- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=42
 -- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
 -- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end

local day_number=tonumber(os.date("%w"))
if init.handday == true then
  for i=1,7 do
 -- work out points
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
else
  for i=1,7 do -- working out points
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,1) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active day names
    end
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=27
  for i=1,7 do
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,1) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active
    end
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
end
 -- ######################################### END DIAL B ###

 -- ### START DIAL C ### Month Names Dial ##################
 -- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=73
 -- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
 -- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end

local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
  for i=1,12 do
 -- OUTER POINTS POSTION FOR -- ### START DIAL C ## TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
else
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,1) -- active month colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active month names
    end
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=58
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,1) -- active colour
	 else
      cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active month names
    end
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
end
 -- ######################################### END DIAL C ###

 -- ### START DIAL D ### Day Numbers Dial ##################
 -- GET NUMBER OF DAYS IN CURRENT MONTH
 -- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
  febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
  febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
 -- MONTH TABLE to get number of days
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
 -- TEXT positioning DAY #'s
local center_x=init.center_x
local center_y=init.center_y
local radius=105
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
  for i=1,number_days do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/number_days)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    --only print even numbers
    if math.mod(i, 2) == 0 and math.mod(this_day, 2)==0 then
    text=string.format("%02d",i) --formats numbers to double digits
    elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
    text=string.format("%02d",i) --formats numbers to double digits
    else
    text=""
    end --odd even matching
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
	if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,1) -- active colour
	else
	cairo_set_source_rgba (cr,1,1,1,0.35) -- dim inactive numbers
	end
     cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
     cairo_show_text (cr, text)
     cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=90
  for i=1,number_days do
    local point=(math.pi/180)*((360/number_days)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
	if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,1) -- active colour
	else
	cairo_set_source_rgba (cr,1,1,1,0.35) -- dim the points
	end
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
 -- ######################################### END DIAL D ###

 -- ### START CLOCK A ######################################
 -- SET MARKS ###
 -- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
 -- set mark length
local m_length_A=0 -- doesn't work but can't delete
 -- set mark width
local m_width_A=0 -- doesn't work but can't delete
 -- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
 -- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,0 -- opaque white -- doesn't work but can't delete

 -- SETUP HOUR HANDS ###
 -- CLOCK A HOUR HAND
hh_length_A=90
 -- set hour hand width
hh_width_A=4
 -- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
 -- set hour hand color
 -- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work

 -- SETUP MINUTE HANDS ###
 -- CLOCK A MINUTE HAND SETUP
 -- set length of minute hand
mh_length_A=123
 -- set minute hand width
mh_width_A=2
 -- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
 -- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work

 -- SETUP SECOND HAND ###
 -- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
 -- set length of seconds hand -- yes I know it is commented out!
--sh_length_A=150
 -- set hour hand width
--sh_width_A=2
 -- set hour hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
 -- set seconds hand color
--shr,shg,shb,sha=1,0,0,1 -- fully opaque red

 -- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
  local arc=(math.pi/180)*((360/60)*seconds)
  --calculate point 1
  local radius1=120
  local x1=0+radius1*math.sin(arc)
  local y1=0-radius1*math.cos(arc)
  --calculate point 2
  local radius2=130
  local x2=0+radius2*math.sin(arc)
  local y2=0-radius2*math.cos(arc)
  --draw line connecting points
  cairo_move_to (cr, center_x+x1,center_y+y1)
  cairo_line_to (cr, center_x+x2, center_y+y2)
  cairo_set_source_rgba (cr,255/255,0/255,0/255,1) -- PART SECOND HAND
  cairo_stroke (cr)
end

 -- CLOCK A ### 12 HR TIME ###
 -- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
 -- DRAWING CODE
 -- DRAW MARKS
 -- stuff that can be moved outside of the loop, needs only be set once
 -- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A -- WHAT IS THIS??
 -- set line cap type
cairo_set_line_cap  (cr, m_cap)
 -- set line width
cairo_set_line_width (cr,m_width_A)
 -- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
 -- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
 -- drawing code using the value of i to calculate degrees
 -- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
 -- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- draw the line
cairo_stroke (cr)
end -- of for loop
 -- HOUR MARKS -- ???????????????????????????????????????????????????????????????
 -- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
 -- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
 -- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
 -- convert minutes to seconds
m_to_s=minutes*60
 -- get current seconds
seconds=tonumber(os.date("%S"))
 -- DRAW HOUR HAND ###
 -- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
 -- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A)) -- use equation ~ eliminate decimals
 -- set radius to calculate hand points
radius=hh_length_A
 -- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
 -- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,0.4,0.6,0.6,1.0) -- active colour Hour Hand ================
cairo_set_line_cap  (cr, hh_cap)
cairo_stroke (cr)
 -- DRAW MINUTE HAND
 -- get minutes and seconds just as seconds
msecs=m_to_s+seconds
 -- calculate degrees for each second
msec_degs=msecs*0.1
 -- set radius to calculate hand points
radius=mh_length_A
 -- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
 -- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,0.4,0.6,0.6,1.0) -- active colour Minute Hand ==============
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
 -- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "DS-Digital", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 22)
cairo_set_source_rgba (cr,1,1,1,1.0) -- HR Clock numbers
 -- TABLE OF TEXT -- in order
if init.hour == 12 then
  text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
  for i=1,12 do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_set_source_rgba (cr,1,1,1,1.0) -- colour of HR Numbers
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=124 -- 12 HR Clock
  for i=1,12 do
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_set_source_rgba (cr,1,1,1,0.50)
    cairo_stroke (cr)
  end
end
if init.hour == 24 then
  text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
  for i=1,24 do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/24)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=124 -- 24 HR Clock
  for i=1,24 do
    local point=(math.pi/180)*((360/24)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_set_source_rgba (cr,1,1,1,0.4)
    cairo_stroke (cr)
  end
end

 -- ############################################################################
 -- POSITION FOR TEXT HOUR NUMBERS
  if init.hour == 12 and init.second == true then
    text_days={"","01","02","03","04","","06","07","08","09","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
 -- INNER POINTS POSITION, radius smaller than text circle
    cairo_set_source_rgba (cr,1,1,1,0.07) -- does not work -- settings moved
    cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    for i=1,60 do
      local radius=124 -- dots for seconds Clock A (12 dial)
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
      if seconds == i-1 then
        cairo_set_source_rgba (cr,255/255,0/255,0/255,0.07) -- does not work - settings moved
      else
        if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
          cairo_set_source_rgba (cr,0.4,0.6,0.6,1.0) -- active colour
        else
          cairo_set_source_rgba (cr,0,1,1,0.0) -- dots for seconds A Clock
        end
      end
      cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
      cairo_stroke (cr)
    end
    radius=radius-3
    cairo_set_font_size (cr, 10)
    for i=1,60 do
 -- OUTTER POINTS POSTION FOR TEXT
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
      local text=text_days[i]--gets text from table
      if seconds == tonumber(text) then
      cairo_set_source_rgba (cr,0.4,0.6,0.6,1.0) -- active colour
      else
        cairo_set_source_rgba (cr,1,1,1,0.15) -- seconds numbers
      end
      cairo_text_extents(cr,text,extents)
      local width=extents.width
      local height=extents.height
      cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
      cairo_show_text (cr, text)
      cairo_stroke (cr)
    end
  end
 -- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function
--[[ mrpeachy wrote:

    the numbers are drawn using a for loop somewhere, like this

    for i=1,12 do
    calculate position of number
    move_to(x,y)
    show_text(i)
    end

    change it to something like this

    for i=1,12 do
    calculate position of number
      if i==month_number then
      move_to(x,y)
      show_text(month_number)
      else
      move_to(x,y)
      show_text(i)
      end
    end ]]

Last edited by Sector11 (2014-02-24 18:10:04)


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

Offline

#1337 2014-02-24 20:06:28

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

@S11
Another awesome layout mate - I have the feeling that this one will last for a long time, as it is based on 2b and 5.

@Lockheed
Can you please post your whole version of the script and your conkyrc as well?

Last edited by TeoBigusGeekus (2014-02-24 20:07:03)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1338 2014-02-25 09:08:01

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

1b1

#!/bin/bash

#put your Accuweather address here
#address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
#address="http://www.accuweather.com/pl/pl/tarnow/274457/weather-forecast/274457"
address="http://www.accuweather.com/en/ca/scarborough/m1h/weather-forecast/55049"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
addr2="$addr1"?day=6

kill -STOP $(pidof conky)
killall wget

wget --save-cookies $HOME/1b1_accuweather_images/cookie -O $HOME/1b1_accuweather_images/curr_cond_raw $curr_addr
wget --load-cookies $HOME/1b1_accuweather_images/cookie -O $HOME/1b1_accuweather_images/first_days_raw $addr1
wget --load-cookies $HOME/1b1_accuweather_images/cookie -O $HOME/1b1_accuweather_images/last_days_raw $addr2

#Current Conditions - curr_cond file
if [[ -s $HOME/1b1_accuweather_images/curr_cond_raw ]]; then

    egrep -i '"detail-tab-panel |>Today<\/a>|>Tonight<\/a>|>Early AM<\/a>|>Overnight<\/a>|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|var d = '\''|var s = '\''|Humidity: |Pressure: |Cloud Cover: |UV Index: |Dew Point: |Precipitation(1 hr): |Visibility: |"start">|"finish">' $HOME/1b1_accuweather_images/curr_cond_raw > $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' -e 's/RealFeel/\n/g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^.*"#">//g' -e 's/^.*<strong class="temp"//g' -e 's/^>//g' -e 's/<span>&deg.*$//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/<\/a>.*$//g' -e 's/\/span> //g' -e 's/var d = //g' -e 's/var s = //g' -e 's/"temp">/\n/g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^.*"start">//g' -e 's/^.*"finish">//g' -e 's/<li>//g' -e 's/<strong>//g' -e 's/<<span.*$//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/<\/span>//g' -e 's/<\/strong><\/li>//g' -e 's/ "><\/div>//g' -e 's/'\''//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/"><\/div>//g' -e 's/^.*; //g' -e 's/&#.*$//g' -e 's/ i-alarm.*$//g' -e 's/;//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e 's/Dew Point: //g' -e 's/Visibility: //g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/">//g' -e 's/\r//g' -e 's/ *$//g' -e 's/mb.*$/mb/g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/-s\|-xl.*$//g' -e 's/in &.*$/in/g' $HOME/1b1_accuweather_images/curr_cond
    time=$(sed -n 1p $HOME/1b1_accuweather_images/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 3a- $HOME/1b1_accuweather_images/curr_cond
	fi
    line35=$(sed -n 35p $HOME/1b1_accuweather_images/curr_cond)
    sed -i '35d' $HOME/1b1_accuweather_images/curr_cond
    sed -i 35a$line35 $HOME/1b1_accuweather_images/curr_cond
	cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n 27p $HOME/1b1_accuweather_images/curr_cond).png $HOME/1b1_accuweather_images/cc.png
fi


#First 5days - first_days file 
if [[ -s $HOME/1b1_accuweather_images/first_days_raw ]]; then

    sed -i '/<div class="column-1 clearfix">/,/<div id=\"feature-history\">/!d' $HOME/1b1_accuweather_images/first_days_raw
    egrep -i '>Today<|<p>[a-z]|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/1b1_accuweather_images/first_days_raw > $HOME/1b1_accuweather_images/first_days

    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/1b1_accuweather_images/first_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/1b1_accuweather_images/first_days
    sed -i -e 's/<p>//g' -e 's/<\/p>//g' -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e '/realfeel/s/^.*; //g' $HOME/1b1_accuweather_images/first_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/1b1_accuweather_images/first_days
	sed -i -e 's/Today/TODAY/' -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' $HOME/1b1_accuweather_images/first_days
    sed -i 's/-s\|-l\|-xl.*$//g' $HOME/1b1_accuweather_images/first_days
    time=$(sed -n 1p $HOME/1b1_accuweather_images/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 2a- $HOME/1b1_accuweather_images/first_days
	fi
	L1=$(sed -n 1p $HOME/1b1_accuweather_images/first_days)
    if [[ $L1 == TODAY ]]; then
        sed -i 1d $HOME/1b1_accuweather_images/first_days
	fi
    for (( i=6; i<=21; i+=5 ))
	  do
	      cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n ${i}p $HOME/1b1_accuweather_images/first_days).png $HOME/1b1_accuweather_images/$i.png
	  done
	cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n 25p $HOME/1b1_accuweather_images/first_days).png $HOME/1b1_accuweather_images/tod.png
	cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n 30p $HOME/1b1_accuweather_images/first_days).png $HOME/1b1_accuweather_images/ton.png

fi


#Last 5days - last_days file 
if [[ -s $HOME/1b1_accuweather_images/last_days_raw ]]; then

    sed -i '/<div class="column-1 clearfix">/,/<div id=\"feature-history\">/!d' $HOME/1b1_accuweather_images/last_days_raw
    egrep -i '>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/1b1_accuweather_images/last_days_raw > $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/1b1_accuweather_images/last_days
	sed -i -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' $HOME/1b1_accuweather_images/last_days
    sed -i 's/-s\|-l\|-xl.*$//g' $HOME/1b1_accuweather_images/last_days
    for (( i=2; i<=22; i+=5 ))
	  do
	      cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n ${i}p $HOME/1b1_accuweather_images/last_days).png $HOME/1b1_accuweather_images/last_$i.png
	  done

fi

#messages file
sed -n 28p $HOME/1b1_accuweather_images/curr_cond | cut -c -20 > $HOME/1b1_accuweather_images/messages
sed -n 29p $HOME/1b1_accuweather_images/first_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
sed -n 34p $HOME/1b1_accuweather_images/first_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
for (( i=7; i<=22; i+=5 ))
  do
      sed -n ${i}p $HOME/1b1_accuweather_images/first_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
  done
for (( i=3; i<=23; i+=5 ))
  do
      sed -n ${i}p $HOME/1b1_accuweather_images/last_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
  done

kill -CONT $(pidof conky)

.conkyrc_1b1_int

# 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,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft yes

# Update interval in seconds
update_interval 3

# Minimum size of text area
minimum_size 355 500
maximum_width 357

override_utf8_locale yes

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

# Stippled borders?
stippled_borders 3

# border margins
#border_margin 9

# border width
border_width 10

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

own_window_colour brown
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 30

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

TEXT
${font Arial:size=12}${color ffe595}WEATHER ${font}${hr 2}$color${texecpi 500 bash $HOME/1b1_accuweather_images/1b1}
${image $HOME/1b1_accuweather_images/cc.png -p 0,60 -s 180x108}
${font Arial:size=10}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/messages}${font}${goto 200}${color ffe595}TEMP: $color${alignr}${execpi 600 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond}°C (${execpi 600 sed -n '30p' $HOME/1b1_accuweather_images/curr_cond}°C)
${goto 200}${color ffe595}WIND: $color${alignr}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}
${goto 200}${color ffe595}HUM: $color${alignr}${execpi 600 sed -n '33p' $HOME/1b1_accuweather_images/curr_cond}
${goto 200}${color ffe595}DEW POINT: $color${alignr}${execpi 600 sed -n '37p' $HOME/1b1_accuweather_images/curr_cond}°C
${goto 200}${color ffe595}PR: $color${alignr}${execpi 600 sed -n '34p' $HOME/1b1_accuweather_images/curr_cond}
${goto 200}${color ffe595}VISIB: $color${alignr}${execpi 600 sed -n '38p' $HOME/1b1_accuweather_images/curr_cond}
${goto 200}${color ffe595}CLOUD COVER: $color${alignr}${execpi 600 sed -n '35p' $HOME/1b1_accuweather_images/curr_cond}
${goto 200}${color ffe595}UV INDEX: $color${alignr}${execpi 600 sed -n '36p' $HOME/1b1_accuweather_images/curr_cond} 
${goto 200}${color ffe595}S/M RISE: $color${alignr}${execpi 600 sed -n '39p' $HOME/1b1_accuweather_images/curr_cond}/${execpi 600 sed -n '41p' $HOME/1b1_accuweather_images/curr_cond}
${goto 200}${color ffe595}S/M SET: $color${alignr}${execpi 600 sed -n '40p' $HOME/1b1_accuweather_images/curr_cond}/${execpi 600 sed -n '42p' $HOME/1b1_accuweather_images/curr_cond}
${hr 1}
${goto 50}${font Arial:size=10}${color ffe595}TODAY$color$font${goto 230}${font Arial:size=10}${color ffe595}TONIGHT$color$font${image $HOME/1b1_accuweather_images/tod.png -p 0,235 -s 120x72}${image $HOME/1b1_accuweather_images/ton.png -p 190,235 -s 120x72}

${goto 145}${execpi 600 sed -n '26p' $HOME/1b1_accuweather_images/first_days}°C${goto 340}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/first_days}°C
${goto 140}(${execpi 600 sed -n '27p' $HOME/1b1_accuweather_images/first_days}°C)${goto 335}(${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/first_days}°C)


${font Arial:size=8}${execpi 600 sed -n '2p' $HOME/1b1_accuweather_images/messages}${goto 195}${execpi 600 sed -n '3p' $HOME/1b1_accuweather_images/messages}$font
Chance of Precip: ${execpi 600 sed -n '28p' $HOME/1b1_accuweather_images/first_days}${goto 195}Chance of Precip: $color${execpi 600 sed -n '33p' $HOME/1b1_accuweather_images/first_days}
${hr 1}
${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/first_days}${goto 145}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/first_days}${goto 270}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/first_days}$color${font}${image $HOME/1b1_accuweather_images/6.png -p 0,384 -s 90x54}

${font Arial:size=8}${goto 100}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°C${goto 330}${execpi 600 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°C
${goto 100}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '14p' $HOME/1b1_accuweather_images/first_days}°C${goto 330}${execpi 600 sed -n '19p' $HOME/1b1_accuweather_images/first_days}°C${image $HOME/1b1_accuweather_images/11.png -p 110,384 -s 90x54}${image $HOME/1b1_accuweather_images/16.png -p 230,384 -s 90x54}

${execpi 600 sed -n '4p' $HOME/1b1_accuweather_images/messages}${goto 135}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/messages}${goto 255}${execpi 600 sed -n '6p' $HOME/1b1_accuweather_images/messages}

${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/first_days}${goto 145}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/last_days}${goto 270}${execpi 600 sed -n '6p' $HOME/1b1_accuweather_images/last_days}$color${font}${image $HOME/1b1_accuweather_images/21.png -p 0,490 -s 90x54}

${font Arial:size=8}${goto 100}${execpi 600 sed -n '23p' $HOME/1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '4p' $HOME/1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/last_days}°C
${font Arial:size=8}${goto 100}${execpi 600 sed -n '24p' $HOME/1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/last_days}°C${image $HOME/1b1_accuweather_images/last_2.png -p 110,490 -s 90x54}${image $HOME/1b1_accuweather_images/last_7.png -p 230,490 -s 90x54}

${execpi 600 sed -n '7p' $HOME/1b1_accuweather_images/messages}${goto 135}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/messages}${goto 255}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/messages}

${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '11p' $HOME/1b1_accuweather_images/last_days}${goto 145}${execpi 600 sed -n '16p' $HOME/1b1_accuweather_images/last_days}${goto 270}${execpi 600 sed -n '21p' $HOME/1b1_accuweather_images/last_days}$color${font}${image $HOME/1b1_accuweather_images/last_12.png -p 0,595 -s 90x54}

${font Arial:size=8}${goto 100}${execpi 600 sed -n '14p' $HOME/1b1_accuweather_images/last_days}°C${goto 210}${execpi 600 sed -n '19p' $HOME/1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '24p' $HOME/1b1_accuweather_images/last_days}°C
${font Arial:size=8}${goto 100}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/last_days}°C${goto 210}${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '25p' $HOME/1b1_accuweather_images/last_days}°C${image $HOME/1b1_accuweather_images/last_17.png -p 110,595 -s 90x54}${image $HOME/1b1_accuweather_images/last_22.png -p 230,595 -s 90x54}

${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/messages}${goto 135}${execpi 600 sed -n '11p' $HOME/1b1_accuweather_images/messages}${goto 255}${execpi 600 sed -n '12p' $HOME/1b1_accuweather_images/messages}

I think that maybe the data file that is created by pulling the data from accuweather, is never being updated, even if the conky is restarted.

Last edited by lockheed (2014-02-25 09:10:05)

Offline

#1339 2014-02-25 13:00:17

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hmmm..., I can't see anything wrong with it...
Can you run in from a terminal

conky -c $HOME/1b1_accuweather_images/.conkyrc_1b1_int

and post any error messages you get?


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1340 2014-02-25 13:04:09

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

Hmmm..., I can't see anything wrong with it...
Can you run in from a terminal

conky -c $HOME/1b1_accuweather_images/.conkyrc_1b1_int

and post any error messages you get?

$ conky -c $HOME/1b1_accuweather_images/.conkyrc_1b1_int
Conky: use_spacer should have an argument of left, right, or none.  'yes' seems to be some form of 'true', so defaulting to right.
Conky: unknown variable texecpi
Conky: desktop window (c0001d) is subwindow of root window (2f2)
Conky: window type - normal
Conky: drawing to created window (0x2600001)
Conky: drawing to double buffer

The main thing is - why there's no change in weather data when I change the url.

Offline

#1341 2014-02-25 13:04:36

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lockheed wrote:

1b1

I think that maybe the data file that is created by pulling the data from accuweather, is never being updated, even if the conky is restarted.

Interesting ... I (almost) can't reproduce the problem.
I started with:

#put your Accuweather address here
#address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
#address="http://www.accuweather.com/en/us/los-angeles-ca/90012/weather-forecast/347625"
#address="http://www.accuweather.com/en/ca/scarborough/m1h/weather-forecast/55049"
address="http://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894"

and made one change in the conky:

TEXT
${font Arial:size=12}${color ffe595}WEATHER${font} Buenos Aires ${hr 2}$color${texeci 500 bash /media/5/1b1_accuweather_images/1b1}

The result: 2014_02_25_09_18_15_385x589_Sector11.jpg - everything looks good!
So I change 1b1 to:

#put your Accuweather address here
#address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
#address="http://www.accuweather.com/en/us/los-angeles-ca/90012/weather-forecast/347625"
address="http://www.accuweather.com/en/ca/scarborough/m1h/weather-forecast/55049"
#address="http://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894"

saved that ... and in the conky i changed the city name:

TEXT
${font Arial:size=12}${color ffe595}WEATHER${font} Scarborough ${hr 2}$color${texeci 500 bash /media/5/1b1_accuweather_images/1b1}

when I saved that I got: 2014_02_25_09_19_45_386x589_Sector11.jpg <- Note today's condition text, TEMP and WIND
killed the conky and started again: 2014_02_25_09_20_26_386x589_Sector11.jpg <- much better - killing and restarting is the key
Same process for LA - saved the conky:  2014_02_25_09_22_01_385x589_Sector11.jpg killed and restarted: 2014_02_25_09_18_15_385x589_Sector11.jpg

OK, I know you said you killed all conkys and restarted ... and it didn't work

Try deleting all the images, the cookie and the created files, just leave:

  • /media/5/1b1_accuweather_images/1b1

  • /media/5/1b1_accuweather_images/.conkyrc_1b1_int

  • /media/5/1b1_accuweather_images/.conkyrc_1b1_usa

2014_02_25_09_49_25_1920x1080_Sector11.jpg
In your file manager right click on 1b1 and execute it ...
2014_02_25_09_52_04_1920x1080_Sector11.jpg
Everything should come back online.

NOTE:  I just did another change ...
Process:
1. killed the conky
2. in 1b1: changed the location from LA to BsAs
3. in the conky: I  changed LA to BsAs
4. restarted the conky

TEMP: 58°C - no that's the 58°F from the LA setting - simple "save" in medit and the conky refreshed with the correct info.
Weird!


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

Offline

#1342 2014-02-25 13:08:55

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Ok, I fond the problem. There was a typo: texecpi instead of execpi

However, I still have problem with scrambled screen on 75% of conky runs.

And then there is the next problem:

When I change
address="http://www.accuweather.com/en/ca/scarborough/m1h/weather-forecast/55049"
to
address="http://www.accuweather.com/pl/ca/scarborough/m1h/weather-forecast/55049"

then I no longer get any data, because apparently the data bit names in other languages differ and so the script can't see them.

Last edited by lockheed (2014-02-25 13:09:28)

Offline

#1343 2014-02-25 13:10:05

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Conky: unknown variable texecpi

There's the culprit - it's so subtle, one can read it a 100 times without noticing it.
Change this line

${font Arial:size=12}${color ffe595}WEATHER ${font}${hr 2}$color${texecpi 500 bash $HOME/1b1_accuweather_images/1b1}

to

${font Arial:size=12}${color ffe595}WEATHER ${font}${hr 2}$color${texeci 500 bash $HOME/1b1_accuweather_images/1b1}

Notice the change from texecpi (non existent command) to texeci (valid conky command) - that's why the script was never run in your system.

EDIT: I've just seen your latest post - the script is only meant for English speaking users.
Some years ago I used to give the script in a few other languages, but the whole thing was very difficult to maintain...

Last edited by TeoBigusGeekus (2014-02-25 13:13:33)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1344 2014-02-25 13:11:09

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lockheed wrote:

The main thing is - why there's no change in weather data when I change the url.

BINGO!

Conky: unknown variable texecpi

change that to:

${texeci 500 bash /media/5/1b1_accuweather_images/1b1}

Also: use_spacer you could change that also: use_spacer right - even though conky does correct that one.

EDIT I'm just tooooooooooooo darn slow typing!  cry  cry  cry
That texecpi was something I changed a long time ago so I missed it as my conky has texeci

Last edited by Sector11 (2014-02-25 13:15:03)


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

Offline

#1345 2014-02-25 13:14:55

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

EDIT I'm just tooooooooooooo darn slow typing!  cry  cry  cry

Good things take their time...  wink

@Lockheed
Scrambled screen?

Last edited by TeoBigusGeekus (2014-02-25 13:16:10)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1346 2014-02-25 13:16:03

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

EDIT: I've just seen your latest post - the script is only meant for English speaking users.
Some years ago I used to give the script in a few other languages, but the whole thing was very difficult to maintain...

I see. Do you know how could  I extract the names of the variables myself?

Offline

#1347 2014-02-25 13:20:32

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:
Sector11 wrote:

EDIT I'm just tooooooooooooo darn slow typing!  cry  cry  cry

Good things take their time...  wink

lol  lol  lol  lol yes, the tortoise beat the harebig_smile

main thing we're on the same page. and lockheed should be flyin' high!


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

Offline

#1348 2014-02-25 13:21:10

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lockheed wrote:
TeoBigusGeekus wrote:

EDIT: I've just seen your latest post - the script is only meant for English speaking users.
Some years ago I used to give the script in a few other languages, but the whole thing was very difficult to maintain...

I see. Do you know how could  I extract the names of the variables myself?

You should examine the raw files (first_days_raw, last_days_raw) and change the proper lines in the script.
For example, change this line

    egrep -i '"detail-tab-panel |>Today<\/a>|>Tonight<\/a>|>Early AM<\/a>|>Overnight<\/a>|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|var d = '\''|var s = '\''|Humidity: |Pressure: |Cloud Cover: |UV Index: |Dew Point: |Precipitation(1 hr): |Visibility: |"start">|"finish">' $HOME/1b1_accuweather_images/curr_cond_raw > $HOME/1b1_accuweather_images/curr_cond

to whatever the text strings are in your desired language.
It's not an easy task, I warn you, because Accuweather sometimes does not provide the same info in English and in other languages, so other changes might need to be done in the script.
"Might" is the magic word, so you're welcome to try!!!


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1349 2014-02-25 13:45:14

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

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lockheed wrote:
TeoBigusGeekus wrote:

EDIT: I've just seen your latest post - the script is only meant for English speaking users.
Some years ago I used to give the script in a few other languages, but the whole thing was very difficult to maintain...

I see. Do you know how could  I extract the names of the variables myself?


Maybe "poedit"?  conkyForecast used to use .po files for different languages:

 25 Feb 14 | 10:21:49 ~
    $ sho poedit
Package: poedit                          
State: installed
Automatically installed: no
Version: 1.5.4-1
Priority: optional
Section: text
Maintainer: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Architecture: amd64
Uncompressed Size: 3,508 k
Depends: libc6 (>= 2.2.5), libdb5.1++, libgcc1 (>= 1:4.1.1), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.8.0),
         libgtkspell0 (>= 2.0.10), libstdc++6 (>= 4.1.1), libwxbase2.8-0 (>= 2.8.12.1), libwxgtk2.8-0 (>= 2.8.12.1),
         gettext
Description: gettext catalog editor
 Poedit is an editor for gettext catalogs (.po files). It aims to provide a convenient approach to editing catalogs. It
 features UTF-8 support, fuzzy and untranslated records highlighting, whitespace highlighting, references browser,
 header editing and can be used to create new catalogs or update existing catalogs from source code with a single
 click. It is built with wxWidgets toolkit.
Homepage: http://www.poedit.net/

 
 25 Feb 14 | 10:22:02 ~
    $ 

Example - English to Spanish: 2014_02_25_10_25_42_780x662_Sector11.jpg

These already exist (but for weather.com)

  1. /usr/share/conkyforecast/locale/bg - Bulgarian

  2. /usr/share/conkyforecast/locale/cs - Czech

  3. /usr/share/conkyforecast/locale/de - German

  4. /usr/share/conkyforecast/locale/es - Spanish

  5. /usr/share/conkyforecast/locale/fj - Fijian

  6. /usr/share/conkyforecast/locale/fr - French

  7. /usr/share/conkyforecast/locale/it - Italian

  8. /usr/share/conkyforecast/locale/lt - Lithuanian

  9. /usr/share/conkyforecast/locale/nl - Dutch / Flemish

  10. /usr/share/conkyforecast/locale/pl - Polish

  11. /usr/share/conkyforecast/locale/ro - Romanian

  12. /usr/share/conkyforecast/locale/sk - Slovak

  13. /usr/share/conkyforecast/locale/sv - Swedish

  14. /usr/share/conkyforecast/locale/zh - Chinese

They were submitted by cF users.  Just a thought.

I have no idea how they were implemented in cF or if / how they would work with bash scripts.

Last edited by Sector11 (2014-02-26 15:59:06)


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

Offline

Help fund CrunchBang, donate to the project!

#1350 2014-02-25 16:30:12

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Thanks guys for your help. It is a nice forum.

By the way, I fixed the transparency problem with this:

own_window yes
own_window_type normal
own_window_argb_visual yes
own_window_argb_value 255
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: zapp

Debian Logo