SEARCH

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

You are not logged in.

#751 2012-08-18 21:52:55

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

mrpeachy wrote:

^ you can put

conky_parse("${image ~/Conky/images/red_1.png -p 0,0 -s 35x35}")

just that on its own anywhere in the weather template


It shows up for a second then vanishes ... just a sec ....
I'll give it the same parameters of the image I want to test.

BRB

EDIT: same: it's there - poof - gone!

Last edited by Sector11 (2012-08-18 21:55:49)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

Help fund CrunchBang, donate to the project!

#752 2012-08-18 21:56:14

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

Back

same: it's there - poof - gone!


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#753 2012-08-18 21:59:29

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

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

hmmm... i tried it and the image stayed... maybe another one of those wm/compositor/transit of venus type things perhaps?

just put the image command direct into the conkyrc would be your best bet

Screenshot_at_2012_08_18_17_03_45.jpg
im getting those darn washed out images, have to fix that

Last edited by mrpeachy (2012-08-18 22:05:20)

Offline

#754 2012-08-18 22:08:16

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

??????????????????????

Turned composite manager off same deal:

image({x=20,y=380,w=80,h=80,file=now["weather_icon"]})
conky_parse("${image ~/Conky/images/red_1.png -p 20,980 -s 80x80}")

shows for a second . GONE!

I tell ya mrpeachy - I'm jinxed!!!!!!

I'd use it in conky but they ..............  brb

It's out by 5 pixels ... go figure;

border_inner_margin 5

doesn't explain why it doesn't stay though.
Thanks ... it's enough to continue.

Last edited by Sector11 (2012-08-18 22:11:16)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#755 2012-08-18 22:14:33

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 894

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

^ Excellent that confirms my theory,
I guess the image function needs to take those settings into account to make the images align the same.

conky_window     table     

This table contains some information about Conky's window. The following table describes the values contained:

    drawable - Window's drawable (Xlib Drawable), requires Lua extras enabled at compile time.
    visual - Window's visual (Xlib Visual), requires Lua extras enabled at compile time.
    display - Window's display (Xlib Display), requires Lua extras enabled at compile time.
    width - Window width (in pixels).
    height - Window height (in pixels).
    border_inner_margin - Window's inner border margin (in pixels).
    border_outer_margin - Window's outer border margin (in pixels).
    border_width - Window's border width (in pixels).
    text_start_x - The x component of the starting coordinate of text drawing.
    text_start_y - The y component of the starting coordinate of text drawing.
    text_width - The width of the text drawing region.
    text_height - The height of the text drawing region.

NOTE: This table is only defined when X support is enabled.

Don't know why the image would not stay though.

Last edited by arclance (2012-08-18 22:16:53)

Offline

#756 2012-08-18 22:14:37

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

mrpeachy wrote:

hmmm... i tried it and the image stayed... maybe another one of those wm/compositor/transit of venus type things perhaps?

just put the image command direct into the conkyrc would be your best bet

Screenshot_at_2012_08_18_17_03_45.jpg
im getting those darn washed out images, have to fix that


What "window_" settings?

with or without here, images clear (xcompmgr or compton):

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

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

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

alignment tl #ml
####################################################  End Window Settings  ###

To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#757 2012-08-18 22:17:56

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

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

@Sector11
ah... i had

own_window_argb_visual yes

now it's commented out and images are back to normal

Offline

#758 2012-08-18 22:25:03

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

mrpeachy wrote:

@Sector11
ah... i had

own_window_argb_visual yes

now it's commented out and images are back to normal


Funny ... here I can use that or not.  makes no difference.  I choose not to use it.  big_smile
and normally I use compton so I can use lua calls in conky.

Glad it's fixed.  BTW, I like your watch  big_smile


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#759 2012-08-18 22:46:50

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

arclance wrote:

^ Excellent that confirms my theory,

Don't know why the image would not stay though.

Yea, LUA doesn't take into account 'border_inner_margin' and I'll be a chocolate chip cookie 'border_outer_margin' as well.  big_smile

Me neither ... want to finish this project first, then I'll work on that.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#760 2012-08-18 22:51:00

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

arclance wrote:

^ Excellent that confirms my theory,
I guess the image function needs to take those settings into account to make the images align the same.

conky_window     table     

This table contains some information about Conky's window. The following table describes the values contained:

    drawable - Window's drawable (Xlib Drawable), requires Lua extras enabled at compile time.
    visual - Window's visual (Xlib Visual), requires Lua extras enabled at compile time.
    display - Window's display (Xlib Display), requires Lua extras enabled at compile time.
    width - Window width (in pixels).
    height - Window height (in pixels).
    border_inner_margin - Window's inner border margin (in pixels).
    border_outer_margin - Window's outer border margin (in pixels).
    border_width - Window's border width (in pixels).
    text_start_x - The x component of the starting coordinate of text drawing.
    text_start_y - The y component of the starting coordinate of text drawing.
    text_width - The width of the text drawing region.
    text_height - The height of the text drawing region.

NOTE: This table is only defined when X support is enabled.

Don't know why the image would not stay though.

Where did you get that table?  Goooooooood Stuff that!


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#761 2012-08-18 22:52:37

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 894

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

^ I got if from here.
It is part of the conky man page as well.

Offline

#762 2012-08-19 00:30:10

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

arclance wrote:

^ I got if from here.
It is part of the conky man page as well.

hahahahahaha  THAT I should have known.  big_smile


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#763 2012-08-19 00:47:37

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

OK, I'm done ... going up in the main conky thread.  big_smile


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#764 2012-09-04 01:54:12

khaoyai
New Member
Registered: 2012-09-04
Posts: 1

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

OK., i'm newbies, i get it.

Last edited by khaoyai (2012-09-04 02:29:22)

Offline

#765 2012-09-04 15:42:59

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

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

i modified my template a bit: vZmQwNw


--[[
 The latest script is a lua only weather script. aka: v9000
 http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/

 the file:
 http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz

 mrppeachys LUA Tutorial
 http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]

_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="PF Tempesta Seven" --font must be in quotes
default_font_size=8
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

local posx=25
local posy=170
local hell=dnc(0xd1cf3d,0xb3a7a7)
local dunkel=dnc(0xa3a23f,0xb3a7a7)

-- aktuelle Temperatur
xout({x=120,y=45,c=dnc(0xffff00,0xb3a7a7),f='Anonymous Pro:bold',fs=14,txt=now["temp"]})

-- gefühlte Temperatur
xout({x=120,y=70,c=hell,f='Anonymous Pro:bold',fs=14,txt=now["feels_like"]})

-- show time
--local zeit="Uhrzeit: "..conky_parse('${time %k:%M}').." Uhr"
--xout({x=posx,y=105,c=hell,txt=zeit})

-- weather icon
image({x=posx,y=20,h=65,w=65,file=now["weather_icon"]})

-- moon icon
image({x=posx+140,y=32,w=40,h=40,file=moon_icon[1]})

-- actual date
local datum=now["day"].." , "..dropZero(now["date"])..". "..now["month"].." "..now["year"]
xout({x=posx,y=120,c=hell,txt=datum})

-- actual weather condition
--xout({x=posx,y=140,c=hell,txt=laenge()})
--xout({x=posx,y=140,c=hell,txt=now["conditions_short"]..koordinaten()})
xout({x=posx,y=140,c=hell,txt=now["conditions_short"]})

-- Windgeschwindigkeit
local windgeschw=wind_speed_text(now['wind_km'])
xout({x=posx,y=155,c=hell,txt=windgeschw})

posSet=175



-- Sonne
xout({x=posx,y=185,c=hell,txt='Sonne:'})
xout({x=posx+92,y=185,c=hell,txt=dropZero(sun_rise_24[1])..' Uhr',j='r'})
xout({x=posx+172,y=185,c=hell,txt=dropZero(sun_set_24[1])..' Uhr',j='r'})

xout({x=posx+104,y=185,c=dunkel,txt='<'})
xout({x=posx+109,y=185,c=hell,txt='>'})

-- Mond
xout({x=posx,y=200,c=hell,txt='Mond:'})
xout({x=posx+92,y=200,c=hell,txt=dropZero(moon_rise_24[1])..' Uhr',j='r'})
xout({x=posx+172,y=200,c=hell,txt=dropZero(moon_set_24[1])..' Uhr',j='r'})

xout({x=posx+104,y=200,c=dunkel,txt='<'})
xout({x=posx+109,y=200,c=hell,txt='>'})

-- Mondphase
xout({x=posx,y=215,c=hell,txt=mondphase_text()})
xout({x=posx+172,y=215,c=hell,txt=moon_phase[1],j='r'})
--xout({x=posx+172,y=215,c=hell,txt='zunehmende Sichel',j='r'})


--out({f="ConkyWindNESW",c=hell,fs=32,x=170,y=200,txt=now["wind_font"]})

-- uv_index
xout({x=posx,y=posy+70,c=hell,txt='UV:'})
xout({x=posx+35,y=posy+70,c=hell,txt=uv_index_num[1],j='r'})

-- Niederschlagswahrscheinlichkeit
xout({x=posx,y=posy+85,c=hell,txt='N:'})
xout({x=posx+35,y=posy+85,c=hell,txt=precipitation[1]..'%',j='r'})

-- Bewölkungswahrscheinlichkeit
xout({x=posx,y=posy+100,c=hell,txt='B:'})
xout({x=posx+35,y=posy+100,c=hell,txt=cloud_cover[1]..'%',j='r'})

-- Höchsttemperatur
xout({x=posx+44,y=posy+70,c=hell,txt='H:'})
xout({x=posx+77,y=posy+70,c=hell,txt=high_temp[1].."°C",j='r'})

-- Tiefsttemperatur
xout({x=posx+44,y=posy+85,c=hell,txt='T:'})
xout({x=posx+77,y=posy+85,c=hell,txt=low_temp[1].."°C",j='r'})

-- 5.02881 AE
-- xout({x=posx,y=posy+200,c=hell,txt='Entfernung Erde-Mars: 5.02881 AE'})
-- mars-rover sojourner
-- sol 45-47
-- zurückgelegte Zeit / Missionsdauer

-- #################################################################
-- ## Größe der Verzeichnisse ######################################
-- #################################################################

local fs_folder1=conky_parse('${fs_free /home/alexander/downloads}')
local fs_folder2=conky_parse('${fs_free /}')


xout({x=posx+5,y=posy+360,c=dunkel,txt='Root-Verzeichnis:'})
xout({x=posx+170,y=posy+360,c=dunkel,txt=fs_show(fs_folder2).." frei",j='r'})

xout({x=posx+5,y=posy+375,c=dunkel,txt='Home-Verzeichnis:'})
xout({x=posx+170,y=posy+375,c=dunkel,txt=fs_show(fs_folder1).." frei",j='r'})

-- #################################################################
-- ### Ende Größe der Verzeichnisse ################################
-- #################################################################


--start or weather forecast table section
--set start forecast day
start_day=2
--set total forecast days you want to display
number_of_days=5
topy=240
gapy=65 -- topy+(gapy*1)

--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1]=10,topy
   top_left_x_coordinate[2],top_left_y_coordinate[2]=120,topy
top_left_x_coordinate[3],top_left_y_coordinate[3]=15,topy+(gapy*1)
   top_left_x_coordinate[4],top_left_y_coordinate[4]=120,topy+(gapy*1)
top_left_x_coordinate[5],top_left_y_coordinate[5]=15,topy+(gapy*2)
   top_left_x_coordinate[6],top_left_y_coordinate[6]=120,topy+(gapy*2)
top_left_x_coordinate[7],top_left_y_coordinate[7]=15,topy+(gapy*3)
   top_left_x_coordinate[8],top_left_y_coordinate[8]=120,topy+(gapy*3)
top_left_x_coordinate[9],top_left_y_coordinate[9]=15,topy+(gapy*4)
   top_left_x_coordinate[10],top_left_y_coordinate[10]=120,topy+(gapy*4)
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i]+10 --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################

local taglang=forecast_day[i]
local tagkurz=forecast_day_short[i]
--local tagzahl=dropZero(forecast_date[i])
local tagzahl=forecast_date[i]
local monatname=forecast_month[i]
local monatnummer=month_number(monatname)
local jahr=now["year"] -- actual year
local datum=tagzahl.."."..monatnummer.."."..jahr

xout({x=tlx,y=tly,c=dunkel,txt=tagkurz..','})
xout({x=tlx+70,y=tly,c=dunkel,txt=datum,j='r'})

xout({x=tlx,y=tly+40,f='ConkyWeather',fs=32,c=dunkel,txt=weather_font[i]})

xout({x=tlx+70,y=tly+15,c=dunkel,txt=high_temp[i].."°C",j='r'})
xout({x=tlx+70,y=tly+30,c=dunkel,txt=low_temp[i].."°C",j='r'})

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



-- ###################################################################
-- ## Dateisystem ####################################################
-- ###################################################################

function fs_show(wert)

local str_fs_laenge=string.len(wert)
local str_fs=string.sub(wert,0,str_fs_laenge-3)
local str_fs_zero=add0(str_fs)
local convert_str_fs=string.gsub(tostring(str_fs_zero),"%.",",")..' GB'

return convert_str_fs

end -- of function


-- ###################################################################
-- ## Entferne führende Nullen #######################################
-- ###################################################################

function dropZero(wert)

local erstezahl=tonumber(string.sub(wert,1,1))

if erstezahl == 0 then
ausgabe=string.sub(wert,2,5)
else
ausgabe=string.sub(wert,1,5)
end -- of if

return ausgabe

end -- of function


--##################################################################
--###### Tag-/ Nachtmodus (day-/night mode) ########################
--################################################################## 

function dnc(wert1,wert2)

-- time of the sunrise
local Stunden1=string.sub(sun_rise_24[1],1,2)
local UmrechnungStundenMinuten1=tonumber(Stunden1)*60
local Minuten1=string.sub(sun_rise_24[1],4,5)
local Gesamt1=tonumber(Minuten1)+UmrechnungStundenMinuten1

-- time of the sunset
local Stunden2=string.sub(sun_set_24[1],1,2)
local UmrechnungStundenMinuten2=tonumber(Stunden2)*60
local Minuten2=string.sub(sun_set_24[1],4,5)
local Gesamt2=tonumber(Minuten2)+UmrechnungStundenMinuten2

-- actual time
local AktuelleStunde=tonumber(os.date("%H"))*60
local AktuelleMinuten=tonumber(os.date("%M"))
local AktuelleZeit=AktuelleStunde+AktuelleMinuten

if AktuelleZeit>Gesamt1 and AktuelleZeit<Gesamt2 then
-- Funktion für den Tag
farbe=maya(wert1)
else
-- Funktion für die Nacht
farbe=wert2
end -- end of the if-section

return farbe

end -- end of function


-- ##########################################################
-- ### Maya-Uhr #############################################
-- ##########################################################

function maya(wert)

-- actual date (intellicast)
local intTag=now["date"]
local intTagNummer=tonumber(intTag)*365
local intMonat=month_number(now["month"])
local intMonatNummer=tonumber(intMonat)*12
local intJahr=now["year"]
local intJahrNummer=tonumber(intJahr)
local intDatumNummer=intTagNummer+intMonatNummer+intJahrNummer

-- Am Tag des 'Weltunterganges' wird der gesamte Text in roter Farbe
-- dargestellt. An diesem Tag endet der Maya-Kalender und laut
-- Überlieferung soll an diesem Tag die Welt untergehen.

local Tag=21
local Monat=12
local Jahr=2012
local Datum=(Tag*365)+(Monat*12)+Jahr

if intDatumNummer == Datum then
farbe=0xff0000
elseif intDatumNummer ~= Datum then
farbe=wert
end -- if schleife

return farbe

end -- the function


-- #################################################################

function mondphase_text()

local mp = moon_phase[1]

if mp == "Vollmond" or mp == "Neumond" then
mpt = "aktuelle Mondphase:"
elseif mp == "letztes Viertel (Halbmond)" or mp == "erstes Viertel (Halbmond)" then
mpt = "Phase:"
elseif mp == "zunehmender Mond" or mp == "abnehmender Mond" then
mpt = "Mondphase:"
elseif mp == "abnehmende Sichel" or mp == "zunehmende Sichel" then
mpt = "Mondphase:"
end--of if x = section

return mpt

end--of function



-- #################################################################
-- ## Funktion zum Umwandeln der Windwerte (beaufort scala) ########
-- #################################################################

function wind_speed_text(uebergabe)

local a,b,x=string.find(uebergabe,"(%d*).*")
local x=tonumber(x)

local laenge=string.len(uebergabe)-5
local teil=string.sub(uebergabe,0,laenge)
local wert=add0(teil).." km/h"

if x < 1.85  then
wind_text = "windstill"
elseif x >= 1.85 and x < 9.0 then
wind_text = "geringer Wind mit "..wert
elseif x >= 9.0 and x < 19.0 then
wind_text = "leichter Wind mit "..wert
elseif x >= 19.0 and x < 28.0 then
wind_text = "schwacher Wind mit "..wert
elseif x >= 28.0 and x < 37.0 then
wind_text = "mäßiger Wind mit "..wert
elseif x >= 37.0 and x < 46.0 then
wind_text = "frischer Wind mit "..wert
elseif x >= 46.0 and x < 56.0 then
wind_text = "starker Wind mit "..wert
end--of if x = section

mitkomma=string.gsub(tostring(wind_text),"%.",",")


return mitkomma

end--of function wind_speed_text


-- ##################################################################
-- ## Nachkommastelle bei Windstärke hinzufügen #####################
-- ##################################################################

function add0(input)

if string.find(input,"%a")==nil then
        if string.find(input,"%p")==nil then        
        input=input..',0'
        end
end
return input
end

--#####################################################################
--### Name des Monats wird in die entsprechende Zahl umgewandelt ######
--#####################################################################

function month_number(input)

month_to_num={
"Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember", 
}

for i,v in ipairs(month_to_num) do

    if tostring(input)==tostring(v) then

      -- null hinzufügen
      if tonumber(i)<=9 then
      output="0"..tonumber(i)
      elseif tonumber(i)>=10 then
      output=tonumber(i)
      end
      -- ende 'null hinzufügen'

    end
end--for loop

return output -- return number of month

end--function


-- ####################################################################
-- ## Funktion zum Zeichnen des Hintergrunds ##########################
-- ####################################################################

function conky_draw_bg(r,x,y,w,h,color,alpha)
local function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
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)
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


-- #########################################################
-- ## isometric bars by mrpeachy ###########################
-- ## modified by lionhead #################################
-- #########################################################

require 'cairo'

function bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, bar_across, bar_down, title, framelines, font, fontsize, txt_across, txt_down,txtred,txtgreen,txtblue,txtalpha,valuered,valuegreen,valueblue,valuealpha,value_across,value_down,value_pos)

--line 1 settings end  
local a_num1=tonumber(conkyobject)
--local a_num=(height/100)*a_num1
local a_num=(height/100)*a_num1

if framelines == 1 then
cairo_set_source_rgba (cr, linered, linegreen, lineblue, linealpha);
cairo_set_line_width (cr, linethick)
cairo_translate (cr, bar_across, bar_down)
cairo_move_to (cr, width*0.5, -width*0.5)
cairo_rel_line_to (cr, 0, -height)
cairo_stroke (cr)
cairo_translate (cr, -bar_across, -bar_down)
end

--line 1 indicator front face
cairo_translate (cr, bar_across, bar_down)
cairo_move_to (cr, 0, 0);
cairo_rectangle (cr, 0, 0, width, -a_num);
cairo_set_source_rgba (cr, facered, facegreen, faceblue, facealpha);
cairo_fill (cr)
cairo_translate (cr, -bar_across, -bar_down)
--line 1 indicator side face
cairo_translate (cr, bar_across, bar_down)
cairo_move_to (cr, 0, (linethick*0.1));
cairo_rel_line_to (cr, 0, -a_num)
cairo_rel_line_to (cr, -1*(width*0.5), -1*(width*0.5))
cairo_rel_line_to (cr, 0, a_num)
cairo_rel_line_to (cr, (width*0.5), (width*0.5))
cairo_close_path (cr)
cairo_set_source_rgba (cr, facered, facegreen, faceblue, facealpha);
cairo_fill (cr)
cairo_translate (cr, -bar_across, -bar_down)

--line 1 indicator top face
cairo_translate (cr, bar_across, bar_down)
cairo_move_to (cr, 0, -a_num);
cairo_rel_line_to (cr, width, 0)
cairo_rel_line_to (cr, -1*(width*0.5), -1*(width*0.5))
cairo_rel_line_to (cr, -width, 0)
cairo_rel_line_to (cr, (width*0.5), (width*0.5))
cairo_close_path (cr)
cairo_set_source_rgba (cr, facered, facegreen, faceblue, facealpha);
cairo_fill (cr)
cairo_translate (cr, -bar_across, -bar_down)

--line 1 indicator lines
cairo_set_line_width (cr, linethick);
cairo_translate (cr, bar_across, bar_down)
cairo_set_source_rgba (cr, linered, linegreen, lineblue, linealpha);
--vertical, middle
cairo_move_to (cr, 0, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -a_num-(linethick*0.5))
cairo_stroke (cr)
--vertical right
cairo_move_to (cr, width, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -a_num-(linethick*0.5))
cairo_stroke (cr)
--left line
cairo_move_to (cr, -1*(width*0.5), (-1*(width*0.5))+(linethick));
cairo_rel_line_to (cr, 0, -a_num)
cairo_stroke (cr)
--bottom line
cairo_move_to (cr, -1*(linethick*0.5), (linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top of indicator
cairo_move_to (cr, 0, -a_num+(linethick*0.5))
cairo_rel_line_to (cr, width, 0)
cairo_stroke (cr)
--bottom diagonal
cairo_move_to (cr, -1*(linethick*0.15), (linethick*0.65))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--topline
cairo_move_to (cr, (-1*(width*0.5))-(linethick*0.5), ((-1*(width*0.5))-a_num)+(linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top left diagonal
cairo_move_to (cr, 0, -a_num+(linethick*0.5))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--top right diagonal
cairo_move_to (cr, width+(linethick*0.15), -a_num+(linethick*0.35))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
cairo_translate (cr, -bar_across, -bar_down)

-- txt title
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fontsize);
cairo_set_source_rgba (cr,txtred,txtgreen,txtblue,txtalpha);
cairo_translate (cr, txt_across,txt_down)
cairo_move_to (cr, 0,0)
cairo_show_text (cr,title)
-- end txt title

--------------------------------------

--[[ 

-- absolute position below title (no framelines)
cairo_set_source_rgba (cr,valuered,valuegreen,valueblue,valuealpha);
cairo_move_to (cr, value_across,value_down)
cairo_show_text (cr,conkyobject..'%')

]]--

-- relative position above bar (no framelines)
ypos=(-a_num+(linethick*0.5))-40

cairo_set_source_rgba (cr,valuered,valuegreen,valueblue,valuealpha);
cairo_move_to (cr, value_across,ypos)
cairo_show_text (cr,conkyobject..'%')


--------------------------------------
cairo_translate (cr, -txt_across, -txt_down)

if framelines == 1 then
--frame lines
cairo_set_line_width (cr, linethick);
cairo_translate (cr, bar_across, bar_down)
cairo_set_source_rgba (cr, linered, linegreen, lineblue, linealpha);
--vertical, middle
cairo_move_to (cr, 0, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -height-(linethick*0.5))
cairo_stroke (cr)
--vertical right
cairo_move_to (cr, width, 1*(linethick*0.5));
cairo_rel_line_to (cr, 0, -height-(linethick*0.5))
cairo_stroke (cr)
--left line
cairo_move_to (cr, -1*(width*0.5), (-1*(width*0.5))+(linethick));
cairo_rel_line_to (cr, 0, -height)
cairo_stroke (cr)
--bottom line
cairo_move_to (cr, -1*(linethick*0.5), (linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top of indicator
cairo_move_to (cr, 0, -height+(linethick*0.5))
cairo_rel_line_to (cr, width, 0)
cairo_stroke (cr)
--bottom diagonal
cairo_move_to (cr, -1*(linethick*0.15), (linethick*0.65))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--topline
cairo_move_to (cr, (-1*(width*0.5))-(linethick*0.5), ((-1*(width*0.5))-height)+(linethick*0.5))
cairo_rel_line_to (cr, width+linethick, 0)
cairo_stroke (cr)
--top left diagonal
cairo_move_to (cr, 0, -height+(linethick*0.5))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
--top right diagonal
cairo_move_to (cr, width+(linethick*0.15), -height+(linethick*0.35))
cairo_rel_line_to (cr, (-1*(width*0.5)), (-1*(width*0.5)))
cairo_stroke (cr)
cairo_translate (cr, -bar_across, -bar_down)
end
end

function conky_draw_shape ()

local schriftart="PF Tempesta Seven" -- font
local updates=conky_parse('${updates}')

local bar_vertical=480
local txt_vertical=500

update_num=tonumber(updates)

if update_num > 5 then
if conky_window==nil then return end
local w=tonumber(conky_window.width)
local h=tonumber(conky_window.height)
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)

-- ##############################################
-- ### Prozessor (CPU #1) #######################
-- ##############################################

conkyobject=conky_parse('${cpu}')

title="CPU1"
font=schriftart
fontsize=8

framelines=0 -- no frameline=0, frameline=1
linethick=0.5 -- thick of the line

width=20 -- width of the bar
height=80 -- height of the bar

-- color frameline
linered=231/255
linegreen=226/255
lineblue=226/255
linealpha=1

-- color bar
facered=228/255
facegreen=125/255
faceblue=41/255
facealpha=1

-- color title
txtred=163/255
txtgreen=162/255
txtblue=63/255
txtalpha=1

-- color txt value
-- dnc(0xd1cf3d,0xb3a7a7)
valuered=163/255
valuegreen=162/255
valueblue=63/255
valuealpha=1

bar_across=40 -- position bar horizontal
bar_down=bar_vertical -- position bar vertical

txt_across=36 -- position title horizontal
txt_down=txt_vertical -- position title vertical

value_across=0 -- position txt value horizontal
value_down=15 -- position txt value vertical

-- call of the function
bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, bar_across, bar_down, title, framelines, font, fontsize, txt_across, txt_down,txtred,txtgreen,txtblue,txtalpha,valuered,valuegreen,valueblue,valuealpha,value_across,value_down,value_pos)


--###################################
--### Prozessor (CPU #2) ############
--###################################
conkyobject=conky_parse('${cpu cpu1}')

title="CPU2"
font=schriftart
fontsize=8

width=20
height=80

framelines=0
linethick=0.5

linered=231/255
linegreen=226/255
lineblue=226/255
linealpha=1

facered=228/255
facegreen=125/255
faceblue=41/255
facealpha=1

txtred=163/255
txtgreen=162/255
txtblue=63/255
txtalpha=1

valuered=163/255
valuegreen=162/255
valueblue=63/255
valuealpha=1

bar_across=85
bar_down=bar_vertical

txt_across=80
txt_down=txt_vertical

value_across=0
value_down=15

bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, bar_across, bar_down, title, framelines, font, fontsize, txt_across, txt_down,txtred,txtgreen,txtblue,txtalpha,valuered,valuegreen,valueblue,valuealpha,value_across,value_down)

-- #################################################
-- #### Arbeitsspeicher RAM  #######################
-- #################################################
conkyobject=conky_parse('${memperc}')
title="RAM"
font=schriftart
fontsize=8

framelines=0
linethick=0.5

width=20
height=80

linered=231/255
linegreen=226/255
lineblue=226/255
linealpha=1

facered=255/255
facegreen=255/255
faceblue=0/255
facealpha=1

txtred=163/255
txtgreen=162/255
txtblue=63/255
txtalpha=1

valuered=163/255
valuegreen=162/255
valueblue=63/255
valuealpha=1

bar_across=130
bar_down=bar_vertical

txt_across=128
txt_down=txt_vertical

value_across=0
value_down=15

bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, bar_across, bar_down, title, framelines, font, fontsize, txt_across, txt_down, txtred, txtgreen, txtblue, txtalpha,valuered,valuegreen,valueblue,valuealpha,value_across,value_down)


-- #####################################################
-- ######### Heimat-Verzeichnis  (HDD - HOME) ##########
-- #####################################################

conkyobject=conky_parse('${fs_used_perc /home/alexander/}')
title="HOME"
font=schriftart
fontsize=8

framelines=0
linethick=0.6

width=20
height=80

txtred=163/255
txtgreen=162/255
txtblue=63/255
txtalpha=1

linered=231/255
linegreen=226/255
lineblue=226/255
linealpha=1

facered=116/255
facegreen=115/255
faceblue=42/255
facealpha=1

valuered=163/255
valuegreen=162/255
valueblue=63/255
valuealpha=1

bar_across=175
bar_down=bar_vertical

txt_across=170
txt_down=txt_vertical

value_across=-3 -- position txt value horizontal
value_down=15 -- position txt value vertical

bar3d(conkyobject, linethick, width, height, linered, linegreen, lineblue, linealpha, facered, facegreen, faceblue, facealpha, bar_across, bar_down, title, framelines, font, fontsize, txt_across, txt_down,txtred,txtgreen,txtblue,txtalpha,valuered,valuegreen,valueblue,valuealpha,value_across,value_down)

end
end


function laenge()


-- time of the sunrise
local Stunden1=string.sub(sun_rise_24[1],1,2)
local UmrechnungStundenMinuten1=tonumber(Stunden1)*60
local Minuten1=string.sub(sun_rise_24[1],4,5)
local Gesamt1=tonumber(Minuten1)+UmrechnungStundenMinuten1 -- 395

-- time of the sunset
local Stunden2=string.sub(sun_set_24[1],1,2)
local UmrechnungStundenMinuten2=tonumber(Stunden2)*60
local Minuten2=string.sub(sun_set_24[1],4,5)
local Gesamt2=tonumber(Minuten2)+UmrechnungStundenMinuten2


local anzahl_minuten=(Gesamt2-Gesamt1)/60
local anzahl_stunden=string.sub(anzahl_minuten,1,2) -- anzahl stunden

local anzahl_min_gesamt=tonumber(anzahl_stunden) * 60

return Minuten2-Minuten1

end

i've added some function to display it. thanks to mrpeachy!

now we have:

windspeed (value as text)
counting of the month and display the text-version (9 = september)
alignment of the text (right)
changed the format of the windspeed (8 -> 8,0)
isometric bars (made by mrpeachy)
black background
text appears red on the end of the maya-calender
and so on smile

now it looks better (in my opinion).

Offline

#766 2012-09-06 04:03:35

ameyjah
New Member
Registered: 2012-09-06
Posts: 1

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

Hi

I am using conky lua from here

Everything works fine but upon clicking on conky window, it disappears.

I tried following parameters in lua but it then stops displaying the conky.

own_window_type override

Could you please tell me the fix.

Offline

#767 2012-09-06 04:29:52

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

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

ameyjah wrote:

Hi

I am using conky lua from here

Everything works fine but upon clicking on conky window, it disappears.

I tried following parameters in lua but it then stops displaying the conky.

own_window_type override

Could you please tell me the fix.

try the different variations for own_window_type:
normal or desktop

here are my window settings

own_window yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

Offline

#768 2012-09-06 12:47:05

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

ameyjah wrote:

Hi

I am using conky lua from here

Everything works fine but upon clicking on conky window, it disappears.

I tried following parameters in lua but it then stops displaying the conky.

own_window_type override

Could you please tell me the fix.

This is the conky that runs that template:

## To use #! in a conky use: ${exec echo '#!'}
## killall conky && conky -c ~/Conky/S11_v9_H.conky &
##
## The latest script is a lua only weather script. aka: v9000
## http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
##
## the file:
## http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz
##
## mrppeachys LUA Tutorial
## http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
##
##
###  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_hints undecorated,below,skip_taskbar,skip_pager,sticky  #to use on all desktops
own_window_colour gray
own_window_class Horizontal v9000
own_window_title Horizontal v9000

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

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

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

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

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color gray
default_outline_color black

default_color DCDCDC #220 220 220    Gainsboro
color0 8FBC8F #143 188 143    DarkSeaGreen
color1 778899 #119 136 153    LightSlateGray
color2 FF8C00 #255 140   0    DarkOrange
color3 7FFF00 #127 255   0    Chartreuse
color4 FFA07A #255 160 122    LightSalmon
color5 FFDEAD #255 222 173    NavajoWhite
color6 00BFFF #  0 191 255    DeepSkyBlue
color7 00FFFF #  0 255 255    Cyan
color8 FFFF00 #255 255   0    Yellow
color9 B22222 #178  34  34    FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#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

#   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

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.5
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
############### V9000 ########################################################
#starts the lua weather data gathering function, call once at top of conkyrc
lua_load ~/v9000/v9000.lua
lua_draw_hook_post weather
lua_load ~/Conky/templates/h-10d-template.lua
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1800
# leave one blank line after TEXT
TEXT

To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#769 2012-09-06 12:50:37

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

lionhead wrote:

i modified my template a bit:

i've added some function to display it. thanks to mrpeachy!

now we have:

windspeed (value as text)
counting of the month and display the text-version (9 = september)
alignment of the text (right)
changed the format of the windspeed (8 -> 8,0)
isometric bars (made by mrpeachy)
black background
text appears red on the end of the maya-calender
and so on smile

now it looks better (in my opinion).

WOW!!!  Excellent!  How did I miss that?


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#770 2012-10-01 12:54:31

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

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

here is a new design:

vZnEwMA

Last edited by lionhead (2012-10-02 06:40:58)

Offline

#771 2012-10-19 13:31:08

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

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

i've just found a new weathercondition for the translation table: ["Mostly Sunny"]="meist sonnig",

i will post more smile

Offline

#772 2012-10-29 11:38:26

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

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

new weather-conditons:
["AM Snow Showers"]="vormittags Schneeschauer",
["AM Fog/PM Clouds"]="vormittags Nebel/nachmittags bewölkt",
["Chance of Rain"]="hohe Regenwahrscheinlichkeit",
["Chance of Snow"]="hohe Schneefallwahrscheinlichkeit",
["Fog Early/Clouds"]="leichter Nebel/bewölkt",
["Ice Pellets"]="Graupel",
["PM Showers"]="nachmittags Regenschauer",
["PM Rain"]="nachmittags Regen",
["AM Light Rain"]="vormittags leichter Regen",
["Showers/Wind"]="Schauer/windig",
["Snow/Wind"]="Schnee/windig",
["Blowing Snow"]="Schneegestöber",
["Moderate Snow"]="mäßiger Schneefall",
["Snow"]="Schneefall",
["Rain/Snow Early"]="leichter Schneeregen",

and here the complete german translation table smile

new format (12.2.2014):

--SETTINGS AND PREFERENCES--SETTINGS AND PREFERENCES--SETTINGS AND PREFERENCES
function weather_settings()--#### DO NOT EDIT THIS LINE #################
--#######################################################################
--[[NOTE NOTE NOTE
Any changes made to these settings will not take effect until conky
has been killed and recycled!
--]]
settings={--OPENS SETTINGS TABLE, DO NOT EDIT
--[[
the free wunderground api has a usage limit, while it is unlikely that the daily limit
of 500 will be met, the minute limit of 10 is quite possible to exceed while in development
set 1 below to force the script to use saved data and prevent downloading new data
set 0 for normal behavior.  In devloper mode all indicator dots will be red
--]]
developer_mode=0,
--[[
Go to http://www.wunderground.com/weather/api/
get the Cumulus Plan or above, key must be in quotes
--]]
key="0419fe8c1c1c1bea",
--[[
script will ping sites before download to see if site is responding, see further down
in the config.  but even if a site is responding a slow internet connection can cause
curl, the program that downloads the data, to time out.  Set how many attempts the script
make to download the data before falling back to saved data.
--]]
tries=3,
--[[
time between updates.  it is important to note that the value set below will be
multiplied by the value of update_interval set in the conky config file.
If conky updates every second, then the number set below will be in seconds
If conky updates every minute (update_interval 60) then the number below will be in minutes
--]]
interval=1800,
--[[
LOCATION
from http://www.wunderground.com/weather/api/d/docs?d=data/index
--options for entering location
location="CA/San_Francisco",		--US state/city
location="60290",			--US zipcode
location="Australia/Sydney",		--country/city
location="37.8,-122.4",			--latitude,longitude
location="KJFK",			--airport code
location="autoip",			--AutoIP address location
location="pws:KCASANFR70",		--PWS id
pws means personal weather station
go here to pick your pws:
http://www.wunderground.com/weatherstation/about.asp
--]]
location="63125",--must be in quotes
--[[
LANGUAGE OPTIONS
http://www.wunderground.com/weather/api/d/docs?d=language-support
--]]
language="DE",--must be in quotes
--[[
Do you want astronomy data?
wun.lua has the ability to fetch sun and moon rise and set data for 10 days
it can also fetch azimuth and altitude data for 36 hours.
If you do not intend to use this kind of data then set 0 or set 1 to activate
--]]
astronomy=1,
--[[
wun.lua can use an extended set of icons based on weather conditions text.
this is limited to language EN.  There are 2 choices foe extended icons, see below.
set 1 below if you want to use extended icons, 0 if you dont
--]]
use_extended_icons=1,
--[[
In the wun folder icons are seperated by type.  
Use the following lines to point to the folders of your choice
you can have them all pointing at the same folder also
NOTE in the template you can set a default that overrides these settings
--]]
--the following icon sets have basic and extended sets
--weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_wun/",
--icon sets below need to be added to ~/wun/additional_files/weathericons/
--weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_falldown/",
weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_merlinthered_colorful/",
--weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_merlinthered_dark/",
--weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_merlinthered_flat_black/",
--weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_merlinthered_flat_colorful/",
--weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_merlinthered_light/",
--weather_icons		="/home/alexander/wun/additional_files/weathericons/icons_merlinthered_white/",
--[[
credit to the icon artists
falldown - http://falldown-aka-chris.deviantart.com/gallery/
tick icons by xiao4 - http://xiao4.deviantart.com/art/tick-weather-icons-96294478
merlinthered - http://merlinthered.deviantart.com/art/plain-weather-icons-157162192
--]]
wind_icons			="/home/alexander/wun/additional_files/weathericons/wind/",
moon_icons			="/home/alexander/wun/additional_files/weathericons/moon/",
--[[SET UNITS
Sometimes weather options gathered from the api are NA so units are not required.
For those options that can be NA the script can generate units when the option 
is not NA and hide the units when it is.  Example:
now.windchill_f can be NA
now.windchill_f_unit shows or hides the unit.  Use in the out function like so
txt=now.windchill_f..now.windchill_f_unit
Set how you would like the units to appear:
This section may need to be updated as the script matures
--]]
--imperial
unit_f			="°",--fahrenheit
unit_in			="\"",--inches, distance measurements
unit_in_pressure	="\"",--atmospheric pressure inches of mercury, to use a " sign enter as "\""
unit_mph		=" mph",--miles per hour
unit_mi			=" mi",--miles, distance
--metric units
unit_c			="°",--celsius
unit_mm			=" mm",--millimeters, used for rain
unit_cm			=" cm",--centimeters, used for snow
unit_pressure_mb	=" mb",--atmospheric pressure millibars=hectopascals
unit_kph		=" kph",--kilometers per hour
unit_km			=" km",--kilometers, distance
--set how you would like NA results to appear
NA_text			="NA",
--set how you would like precedig and following days to be indicated
--in additional moon rise and set options
moon_preceding		="-",
moon_following		="+",
--[[PING SETTINGS
The updated script uses PING to test if the weatherunderground and usno sites are responding
set below the time in milliseconds that equals a successful test.  The default is 1000ms.
If you are not sure how many ms to enter, try this in a terminal a few times:
"ping www.wunderground.com -q -c 1"
you will see a line like this in the output:
"2 packets transmitted, 2 received, 0% packet loss, time 0ms"
1000 should be plenty to test if a site is responding
--]]
ms=1000,
--[[set script status settings- indicator consists of 2 dots side by side
1st weather data indicator, green if using current data, yellow if using backup data once, red if using backup data more than once
2nd same as weather data but for astronomy data
--]]
indicator=0,--set 1 for on, 0 for off
indicator_x=5,--center of first indicator
indicator_y=5,--center of first indicator
indicator_r=2,--radius of indicator dot
indicator_gap=15,--gap between center of dots
--[[SET USER TEXT
The script outputs the weather conditions set by wunderground.
If you would like to represent conditions in a different way, for example to 
shorten a condition that is too long, you can set an alternates here.  
Like so:
["Original Condition"]="my alternate condition",
The format of the original condition must match exactly
To access the user generated conditions, use like so in a template:
now.conditions_user
--]]
conditions_user={--OPENS TABLE, DO NOT EDIT
["AM Clouds/PM Sun"]="vormittags bewölkt/nachmittags sonnig",
["AM Rain/Snow Showers"]="vormittags Regen-/Schneeschauer",
["AM Showers"]="vormittags Regenschauer",
["AM Snow Showers"]="vormittags Schneeschauer", 
["AM Snow Showers/Wind"]="vormittags Schneeschauer/windig",
["AM Fog/PM Sun"]="vormittags Nebel/nachmittags Sonne",
["AM Fog/PM Clouds"]="vormittags Nebel/nachmittags bewölkt",     ----------- neu
["AM Drizzle"]="vormittags Nieselregen",
["AM Light Rain"]="vormittags leichter Regen",
["PM Light Rain"]="nachmittags leichter Regen",
["PM Rain"]="nachmittags Regen",
["PM Showers"]="nachmittags Regen",
["Chance of Rain"]="hohe Regenwahrscheinlichkeit",
-- ["PM Drizzle"]
-- ["Drizzle Late"]
-- ["Early Drizzle"]
["Broken Clouds"]="überwiegend bewölkt",
["Drizzle"]="Nieselregen",
["Few Clouds"]="leichte Bewölkung",
["Few Showers"]="leichter Regenschauer",
["Few Snow Showers"]="wenig Schneeschauer",
["Fog Early/Clouds"]="leichter Nebel/bewölkt", --- neu
["Freezing Rain"]="überfrierender Regen",
["Freezing Drizzle"]="überfrierender Nieselregen",
["Partly Cloudy"]="teilweise bewölkt",
["Partly Cloudy/Wind"]="teilweise bewölkt/windig",
["Hail"]="Hagel",
["Haze"]="schwül/neblig",
["Heavy Rain"]="starker Regen",
["Heavy Snow"]="starker Schneefall",
["Hot"]="sehr warm",
["Isolated Thunderstorms"]="vereinzelt Gewitter",
["Ice Pellets"]="Graupel",
["Light Rain"]="leichter Regen",
["Light Rain Late"]="leichter Regen nachmittags",
["Light Rain/Wind"]="leichter Regen/windig",
["Light Snow"]="leichter Schneefall",
["Light Fog"]="leichter Nebel",
["Fog Late"]="dichter Nebel",
["Mixed Rain and Hail"]="verm. Regen und Hagel",
["Mixed Rain and Snow"]="verm. Regen und Schnee",
["Mixed Rain and Sleet"]="verm. Regen und Graupel",
["Mixed Precipitation"]="verschiedener Niederschlag",
["Moderate Fog"]="mäßig neblig",
["Moderate Rain"]="mäßiger Regen",
["Moderate Snow"]="mäßiger Schneefall",
["Mostly Cloudy"]="meist bewölkt",
["Mostly Sunny"]="meist sonnig",
["Mostly Clear"]="meist klar",
["Rain/Snow Early"]="leichter Schneeregen",
["Rain/Snow"]="Schneeregen",
["Rain Showers"]="Regenschauer",
["Rain/Snow Showers"]="Regen-/Schneeschauer",
["Drifting Snow"]="Treibschnee",
["Chance of Snow"]="hohe Schneefallwahrscheinlichkeit",
["Scattered Thunderstorms"]="vereinzelt Gewitter",
["Scattered Clouds"]="gering bewölkt",
["Scattered Showers"]="vereinzelt leichter Regen",
["Blowing Snow"]="Schneetreiben", --- neu
["Snow Showers"]="Schneeschauer",
["Snow Showers Late"]="Schneeschauer nachmittags",
["Snow Flurries"]="Schneeaufwirbelung",
["Snow/Wind"]="Schnee/windig",
["Showers Early"]="leichter Regen",
["Showers/Wind"]="Schauer/windig", 
["Clear"]="klar, heiter",
["Clear/Wind"]="klar/windig",
["Blustery"]="stürmisch",
["Cloudy"]="bewölkt",
["Overcast"]="zunehmend bedeckt",
["Showers"]="Schauer",
["Sprinkles"]="Sprühregen",
["Sunny"]="sonnig",
["Thunderstorm"]="Gewitter / Unwetter",
--["Thunderstorms/Wind"]="T.Storms/Wnd"
["Wind Early"]="früh oder am morgen windig",
["Wind"]="windig",
},--CLOSES CONDITIONS_USER TABLE, DO NOT EDIT
--END OF SETTINGS########################################################
}--CLOSES SETTINGS TABLE, DO NOT EDIT ###################################
--#######################################################################
return settings--########################################################
--#######################################################################
end--OF SETTINGS AND PREFERENCES ########################################
--#######################################################################

old format:

--SETTINGS AND PREFERENCES--SETTINGS AND PREFERENCES--SETTINGS AND PREFERENCES
function weather_settings()--#### DO NOT EDIT THIS LINE #################
--#######################################################################
--[[set update interval.  update interval is based on conky cycles
if your conkyrc has an update_interval of 1, ie updates every second
then if you enter 60 below, the script will update every 60 seconds
however, if your conkyrc update_interval is 10, then by setting 60 below,
v9000 will update every 600 seconds (10 minutes)]]
local update_interval=1800 --avoid an interval of 1
--get web address by going to the intellicast site and entering your location in the box

--click on "Extended Forecast" to get the necessary address
local web="http://www.intellicast.com/Local/Forecast.aspx?unit=C&location=GMXX0156"--insert unit=C& after aspx? for C
-- nur für temperatur in celsius
-- http://www.intellicast.com/Local/Forecast.aspx?unit=C&location=GMXX0156

-- nur für temperatur in fahrenheit
-- http://www.intellicast.com/Local/Forecast.aspx?unit=F&location=GMXX0156

local weathericons="/home/alexander/bazinga/additional_files/weathericons/"
--short conditions setup
--this section allows you to set your own shorter terms to replace the terms foud in conditions
--to use for current: now["conditions_short"], now["conditions_short_caps"], now["conditions_short_lc"]
--to use for forecast: conditions_short[n], conditions_short_caps[n], conditions_short_lc[n]
--ALSO USE THIS TABLE TO ENTER CONDITIONS TRANSLATIONS

con_short={--start of table, put entries below in form eg: ["Thunderstorm"]="T.Strm",
["AM Clouds/PM Sun"]="vormittags bewölkt/nachmittags sonnig",
["AM Rain/Snow Showers"]="vormittags Regen-/Schneeschauer",
["AM Showers"]="vormittags Regenschauer",
["AM Snow Showers"]="vormittags Schneeschauer", 
["AM Snow Showers/Wind"]="vormittags Schneeschauer/windig",
["AM Fog/PM Sun"]="vormittags Nebel/nachmittags Sonne",
["AM Fog/PM Clouds"]="vormittags Nebel/nachmittags bewölkt",     ----------- neu
["AM Drizzle"]="vormittags Nieselregen",
["AM Light Rain"]="vormittags leichter Regen",
["PM Light Rain"]="nachmittags leichter Regen",
["PM Rain"]="nachmittags Regen",
["PM Showers"]="nachmittags Regen",
-- ["PM Drizzle"]
-- ["Drizzle Late"]
-- ["Early Drizzle"]
["Broken Clouds"]="überwiegend bewölkt",
["Drizzle"]="Nieselregen",
["Few Clouds"]="leichte Bewölkung",
["Few Showers"]="leichter Regenschauer",
["Few Snow Showers"]="wenig Schneeschauer",
["Fog Early/Clouds"]="leichter Nebel/bewölkt", --- neu
["Freezing Rain"]="überfrierender Regen",
["Freezing Drizzle"]="überfrierender Nieselregen",
["Partly Cloudy"]="teilweise bewölkt",
["Partly Cloudy/Wind"]="teilweise bewölkt/windig",
["Hail"]="Hagel",
["Haze"]="schwül/neblig",
["Heavy Rain"]="starker Regen",
["Heavy Snow"]="starker Schneefall",
["Hot"]="sehr warm",
["Isolated Thunderstorms"]="vereinzelt Gewitter",
["Light Rain"]="leichter Regen",
["Light Rain Late"]="leichter Regen nachmittags",
["Light Rain/Wind"]="leichter Regen/windig",
["Light Snow"]="leichter Schneefall",
["Light Fog"]="leichter Nebel",
["Fog Late"]="dichter Nebel",
["Mixed Rain and Hail"]="verm. Regen und Hagel",
["Mixed Rain and Snow"]="verm. Regen und Schnee",
["Mixed Rain and Sleet"]="verm. Regen und Graupel",
["Mixed Precipitation"]="verschiedener Niederschlag",
["Moderate Fog"]="mäßig neblig",
["Moderate Rain"]="mäßiger Regen",
["Moderate Snow"]="mäßiger Schneefall",
["Mostly Cloudy"]="meist bewölkt",
["Mostly Sunny"]="meist sonnig",
["Mostly Clear"]="meist klar",
["Rain/Snow Early"]="leichter Schneeregen",
["Rain/Snow"]="Schneeregen",
["Rain Showers"]="Regenschauer",
["Rain/Snow Showers"]="Regen-/Schneeschauer",
["Drifting Snow"]="Treibschnee",
["Scattered Thunderstorms"]="vereinzelt Gewitter",
["Scattered Clouds"]="gering bewölkt",
["Scattered Showers"]="vereinzelt leichter Regen",
["Blowing Snow"]="Schneetreiben", --- neu
["Snow Showers"]="Schneeschauer",
["Snow Showers Late"]="Schneeschauer nachmittags",
["Snow Flurries"]="Schneeaufwirbelung",
["Snow/Wind"]="Schnee/windig",
["Showers Early"]="leichter Regen",
["Showers/Wind"]="Schauer/windig", 
["Clear"]="klar, heiter",
["Clear/Wind"]="klar/windig",
["Blustery"]="stürmisch",
["Cloudy"]="bewölkt",
["Overcast"]="zunehmend bedeckt",
["Showers"]="Schauer",
["Sprinkles"]="Sprühregen",
["Sunny"]="sonnig",
["Thunderstorm"]="Gewitter / Unwetter",
--["Thunderstorms/Wind"]="T.Storms/Wnd"
["Wind Early"]="früh oder am morgen windig",
["Wind"]="windig", 
}--this bracket closes the table
--the script is capable of converting between several unit types
--set how many decimal places you want the conversions to show
local decimal_places=1
--some weather data options need to come with their own units attached as they can be NA on occasion
--set here what you want to have for units, or set "" for nothing
--include spaces, if desired, for formatting purposes. 
--NOTE ALSO EDIT THESE SETTINGS FOR TRANSLATION PURPOSES
local visibility_unit=" mi"
local wind_mph_unit=" mph"
local wind_km_unit=" km/h"
local wind_kts_unit=" kts"
local ceiling_unit=" ft"
local wind_degrees_unit="°"
--do you want the script to use translation tables?
--set 1 if you want to translate, 0 if not.
--the translation tables are located below
local translate=1
--set alerts on or off, set to 0 so that the script does not check for alerts
--set 1 to check for alerts
local alert_check=0
--#######################################################################
--TRANSLATION TABLES, activate by setting translate=1 above
--use con_short table above to translate weather conditions
--edit units settings above to complete translation
--translate NESW text
neswtext={
S="S",
SSW="SSW",
SW="SW",
WSW="WSW",
W="W",
WNW="WNW",
NW="NW",
NNW="NNW",
N="N",
NNE="NNO",
NE="NO",
ENE="ONO",
E="O",
ESE="OSO",
SE="SO",
SSE="SSO",
}--end of  N E S W text table
--translate time suffix
tsuffix={
AM="AM",
PM="AM",
}--end of time suffix table
--enter translations for uv index text
uvindextext={
["Low"]="gering",
["Moderate"]="mittel",
["High"]="hoch",
["Very High"]="sehr hoch",--format is different because of the space in the text
["Extreme"]="extrem",
}--end of uv text table
--enter translations for moonpahse
moonphases={
["New"]="Neumond", -- Mond steht für uns unsichtbar am Taghimmel
["Waxing Crescent"]="zunehmende Sichel",  -- Mond ab Vormittag bis Abend zu sehen
["First Quarter"]="erstes Viertel (Halbmond)", -- Mond ist ab Mittags bis Mitternacht zu sehen
["Waxing Gibbous"]="zunehmender Mond", -- Mond ist ab Nachmittags bis nach Mitternacht zu sehen
["Full"]="Vollmond", -- Mond ist die ganze Nacht zu sehen
["Waning Gibbous"]="abnehmender Mond", -- Mond ist von vor Mitternacht bis zum Vormittag zu sehen
["Last Quarter"]="letztes Viertel (Halbmond)", -- Mond ist von Mitternacht bis zum Mittag zu sehen
["Waning Crescent"]="abnehmende Sichel", -- Mond ist vom Morgen bis Nachmittags zu sehen
}--end of moon phase table
--enter translations for FULL day names
daynames={
Monday="Montag",
Tuesday="Dienstag",
Wednesday="Mittwoch",
Thursday="Donnerstag",
Friday="Freitag",
Saturday="Samstag",
Sunday="Sonntag",
}--end day names table
--enter translations for SHORT day names
dayshort={
Monday="Mo",
Tuesday="Di",
Wednesday="Mi",
Thursday="Do",
Friday="Fr",
Saturday="Sa",
Sunday="So"
}--end short day names table
--enter translation for FULL month names
monthnames={
January="Januar",
February="Februar",
March="März",
April="April",
May="Mai",
June="Juni",
July="Juli",
August="August",
September="September",
October="Oktober",
November="November",
December="Dezember"
}--end of month name translations
--enter translations for SHORT month names
monthshort={
January="Jan",
February="Feb",
March="März",
April="April",
May="Mai",
June="Juni",
July="Juli",
August="Aug",
September="Sep",
October="Okt",
November="Nov",
December="Dez"
}--end of short month name translations
--enter some additional translations
additional={
NA="t_NA",
Unl="t_Unl"--for ceiling data option
}--end of additional translations


--END OF TRANSLATION TABLES
--#######################################################################
--NOTE if you make changes to these settings, they will only take effect at the next weather update
--or after killall conky and restart
--#######################################################################
if translate==1 then
return {update_interval,web,weathericons,con_short,decimal_places,visibility_unit,wind_mph_unit,wind_km_unit,wind_kts_unit,ceiling_unit,wind_degrees_unit,translate,alert_check,neswtext,tsuffix,uvindextext,moonphases,daynames,dayshort,monthnames,monthshort,additional}
else
return {update_interval,web,weathericons,con_short,decimal_places,visibility_unit,wind_mph_unit,wind_km_unit,wind_kts_unit,ceiling_unit,wind_degrees_unit,translate,alert_check}
end
end--OF SETTINGS AND PREFERENCES ########################################
--#######################################################################

this are the first 'winter-weather conditions' of the script smile i will add each new weather condition. within this posting you will find the most actual german translation table.

Last edited by lionhead (2014-02-12 14:01:26)

Offline

#773 2012-11-04 18:34:03

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,785
Website

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

OK I have a question....

I look in my /home/sector11/v9000/v9000.lua script and I see a list:

--setup tables for forecast weather
forecast_day={}
forecast_day_caps={}
forecast_day_lc={}
forecast_day_short={}
forecast_day_short_caps={}
forecast_day_short_lc={}
forecast_month={}
forecast_month_caps={}
forecast_month_lc={}
forecast_month_short={}
forecast_month_short_caps={}
forecast_month_short_lc={}
forecast_date={}
weather_icon={}
weather_font={}
high_temp={}
low_temp={}
conditions={}
conditions_caps={}
conditions_lc={}
conditions_short={}
conditions_short_caps={}
conditions_short_lc={}
sun_rise={}
sun_rise_lc={}
sun_rise_time={}
sun_rise_24={}
moon_rise={}
moon_rise_lc={}
moon_rise_time={}
moon_rise_24={}
moon_rise_ampm={}
moon_rise_ampm_lc={}
sun_set={}
sun_set_lc={}
sun_set_time={}
sun_set_24={}
moon_set={}
moon_set_lc={}
moon_set_time={}
moon_set_24={}
moon_set_ampm={}
moon_set_ampm_lc={}
humidity={}
precipitation={}
snow={}
cloud_cover={}
moon_phase={}
moon_phase_caps={}
moon_phase_lc={}
moon_font={}
moon_icon={}
wind_mph={}
wind_km={}
wind_kts={}
wind_font={}
wind_icon={}
wind_deg={}
wind_nesw={}
uv_index_num={}
uv_index_txt={}
uv_index_txt_caps={}
uv_index_txt_lc={}

Something isn't right.  First off they show curly brackets but my templates use the square brackets.

I am trying to show moon phase image, here's a sample:

image({w=45,h=1,x=5,y=134,file="/media/5/Conky/images/yellow_1.png"})
-- start of forcast days
out({c=0x9ACD32,a=1,x=5,y=datay+(datayy*9),txt=forecast_day_short[2]})
out({c=0x9ACD32,a=1,x=35,y=datay+(datayy*9),txt=forecast_date[2]})
--image({x=25,y=imgy,file=weather_icon[2]})
  image({x=25,y=imgy,file=moon_icon[1]})
out({c=0xFF8C00,a=1,x=5,y=datay+(datayy*10),txt=high_temp[2]})
out({c=0x00BFFF,a=1,x=5,y=datay+(datayy*11),txt=low_temp[2]})

acqGy26N.jpg  <<-- What am I doing wrong?  Any help appreciated.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#774 2012-11-04 18:45:13

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

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

curly brakets denote a table while square brackets are how you look up something in a table
so

table = { 1 , 2 , 3 }

to get first entry in table

first = table[1]

as for the moon phase image i'll have to take a look... just noticed that the link in my sig to lua weather isnt working

Offline

Help fund CrunchBang, donate to the project!

#775 2012-11-04 18:59:27

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

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

just check on my puter and i do get moon icons with this line

image({x=50,y=50,w=40,h=40,file=moon_icon[1]})

check that the path is correct
moon_icon[1] should point to:
/home/username/v9000/additional_files/weathericons/moon_waning_gibbous.png

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.

Debian Logo