SEARCH

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

You are not logged in.

#326 2012-01-29 17:21:08

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 - documented of course

@gregkwaste
ah...
well drawing a line in lua is pretty easy

--set line width
cairo_set_line_width (cr,1)--width of 1 pixel
--set line color red green blue alpha values from 0 to 1
cairo_set_source_rgba (cr,1,1,1,1)--fully opaque white
--set start coordinates for line
cairo_move_to (cr,100,100)--start at x=100, y=100
--set up line
cairo_line_to (cr,200,100)--draw line to x=200, y=100
--draw the line
cairo_stroke (cr)

Offline

Help fund CrunchBang, donate to the project!

#327 2012-01-29 17:54:23

gregkwaste
Member
Registered: 2012-01-25
Posts: 25

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

mrpeachy wrote:

@ sector11 - documented of course

@gregkwaste
ah...
well drawing a line in lua is pretty easy

--set line width
cairo_set_line_width (cr,1)--width of 1 pixel
--set line color red green blue alpha values from 0 to 1
cairo_set_source_rgba (cr,1,1,1,1)--fully opaque white
--set start coordinates for line
cairo_move_to (cr,100,100)--start at x=100, y=100
--set up line
cairo_line_to (cr,200,100)--draw line to x=200, y=100
--draw the line
cairo_stroke (cr)

that surely did the trick ^^

but i can't manage to get a quality equal to that from $hr. The line created from $hr seems more accurate, smaller and whiter. The line created from lua at 1 pixel setting seems to be greym and only gets whiter when increasing the pixels.

Are there any other functions to tweak it? maybe make it bolder or something like that.

Edit: I am really interested to learn more about this lua scripting thing. Can you please give me any reference? ^^

Last edited by gregkwaste (2012-01-29 17:57:40)

Offline

#328 2012-01-29 18:07:09

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

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

gregkwaste wrote:
mrpeachy wrote:

@ sector11 - documented of course

@gregkwaste
ah...
well drawing a line in lua is pretty easy

--set line width
cairo_set_line_width (cr,1)--width of 1 pixel
--set line color red green blue alpha values from 0 to 1
cairo_set_source_rgba (cr,1,1,1,1)--fully opaque white
--set start coordinates for line
cairo_move_to (cr,100,100)--start at x=100, y=100
--set up line
cairo_line_to (cr,200,100)--draw line to x=200, y=100
--draw the line
cairo_stroke (cr)

that surely did the trick ^^

but i can't manage to get a quality equal to that from $hr. The line created from $hr seems more accurate, smaller and whiter. The line created from lua at 1 pixel setting seems to be greym and only gets whiter when increasing the pixels.

Are there any other functions to tweak it? maybe make it bolder or something like that.

Edit: I am really interested to learn more about this lua scripting thing. Can you please give me any reference? ^^

the infamous blurriness of the cairo 1 pixel line!
set your coordinates to .5 values and it will go nice an crisp
so 100.5 instead of just 100

ive started writing a how to about lua/cairo with conky
http://crunchbanglinux.org/forums/topic … -in-conky/

then there is the lua 5.1 manual
http://www.lua.org/manual/5.1/

and the cairo documentation
http://cairographics.org/documentation/

Offline

#329 2012-01-29 18:24:57

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

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

mrpeachy wrote:

ive started writing a how to about lua/cairo with conky
http://crunchbanglinux.org/forums/topic … -in-conky/

This will come in helpful for us mortals trying to learn lua with conky. lol

Offline

#330 2012-01-29 19:15:30

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

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

gregkwaste wrote:

Of course i saw that mrpeachy is the creator, but you Mr Sector11, have done some important work too^^. Thats why i wanted to thank you both. smile

Edit: Well its not as great as i thought... All i wanted to do was to add $hr in the weather script, but instead of getting an horizontal line, i am getting a stupid square.... When using cpu, its working just fine. Can anyone check that for me?

@ gregkwaste
Well, in that case thank you.

For me I'm going to draw lines the same way I did with the two vertical lines in the horizontal conky seen below; with a 1x1 pixel image:

image({x=205,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})

and

image({x=275,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})

I also left the commented out lines that show where I used a red 1x1 pixel image during development, That red image showed me what the actual limits of the transparent images the LUA script is using.

@ the whole world:

There is a movie: A Field of Dreams - "If you build it they will come"
mrpeachy built the field, I'm one of the "they" that came.

I have a new one that will fit mrpeachy's screen, the horizontal one size: 820 260

b1c9bc172246698.jpg

In the bottom left corner is the new conky under development and it brings me to a request of mrpeachy see that the end of this post.

the conky ~/Conky/t9000_h.conky

## To use #! in a conky use: ${exec echo '#!'}
## killall conky && conky -c ~/Conky/t9000_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

# 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

own_window_type normal
own_window_transparent yes #no
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_colour black
own_window_class v9000 t9002
own_window_title v9000 t9001

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### 'own_window_type override'
own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### 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 150

minimum_size 820 260     ## width, height
maximum_width 820       ## width, usually a good idea to equal minimum width

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

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

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

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

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

default_color DCDCDC #Gainsboro
color0 DAA520 #Goldenrod  FFFFF0 #Ivory
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 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

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## 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.4}
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
##
## OR Both above TEXT (No composite manager required - no blinking!)
##
## lua_load ~/wea_conky/draw_bg.lua
## lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
## TEXT
##
#######################################################  End LUA Settings  ###

# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1

#lua_load ~/Conky/LUA/weather9001.lua
#lua_draw_hook_pre conky_weather 
#starts the lua weather data gathering function, call once at top of conkyrc

lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load ~/Conky/templates/t9000_h_template.lua

TEXT
${lua conky_draw_bg 15 0 0 0 0 0x000000 0.7}

and ~/Conky/templates/t9000_h_template.lua

--[[
 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/v9000.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="Anonymous Pro:bold"--font must be in quotes
default_font_size=11
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
out({c=0x00BFFF,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=15,txt=now["date"].." "..now["month_short"].." "..now["year"]..": Fetched @ "..now["time"]})
image({x=20,y=20,h=40,w=40,file=now["weather_icon"]})
-- Temp / FeelsLike & CONDITIONS TEXT
out({c=0x48D1CC,a=1,f="Digital-7",fs=50,x=80,y=60,txt=now["temp"]})
out({c=0x00BFFF,a=1,f="Digital-7",fs=50,x=140,y=60,txt=now["feels_like"]})
out({c=0xA4FFA4,a=1,f="Anonymous Pro:bold",fs=11,x=81,y=72,txt="Temp          WC · HI"})

out({c=0x48D1CC,a=1,f="Zekton",fs=18,x=10,y=94,txt=now["conditions"]})

-- data titles
--    data output 
datay=110   -- y=datay or
dataadd=15   -- y=datay+(dataadd*1) use 1 or more

out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay,txt="Wind Chill:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=70,y=datay,txt=now["wind_chill"].."°"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=100,y=datay,txt="Heat Index:"})
   out({c=0xFF8C00,a=1,f="Anonymous Pro:bold",fs=11,x=165,y=datay,txt=now["heat_index"].."°"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*1),txt="Today's Hi·Lo:"})
   out({c=0xFF8C00,a=1,f="Anonymous Pro:bold",fs=11,x=100,y=datay+(dataadd*1),txt=high_temp[1].."°"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=140,y=datay+(dataadd*1),txt=low_temp[1].."°"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*2),txt="Wind:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=60,y=datay+(dataadd*2),txt=now["wind_km"]})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=110,y=datay+(dataadd*2),txt=now["wind_nesw"]})
   out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=140,y=datay+(dataadd*2),txt="@"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=165,y=datay+(dataadd*2),txt=now["wind_deg"]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*3),txt="Hum:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=60,y=datay+(dataadd*3),txt=now["humidity"].."%"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=100,y=datay+(dataadd*3),txt="Dew Point:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=165,y=datay+(dataadd*3),txt=now["dew_point"].."°"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*4),txt="Bar:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=60,y=datay+(dataadd*4),txt=now["pressure_mb"]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*5),txt="Ceil:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=60,y=datay+(dataadd*5),txt=now["ceiling"]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=110,y=datay+(dataadd*5),txt="Vis:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=145,y=datay+(dataadd*5),txt=now["visibility"]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*6),txt="Precip:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=60,y=datay+(dataadd*6),txt=precipitation[1].."%"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=110,y=datay+(dataadd*6),txt="Cloud:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=150,y=datay+(dataadd*6),txt=cloud_cover[1].."%"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*7),txt="UV:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=60,y=datay+(dataadd*7),txt=uv_index_num[1]})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=110,y=datay+(dataadd*7),txt=uv_index_txt[1]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=18,y=datay+(dataadd*8),txt="Sun  Rise:"})
   out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=80,y=datay+(dataadd*8),txt=sun_rise_time[1]})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=115,y=datay+(dataadd*8),txt="Set:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=145,y=datay+(dataadd*8),txt=sun_set_time[1]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*9),txt="Moon  Rise:"})
   out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=80,y=datay+(dataadd*9),txt=moon_rise_time[1]})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=115,y=datay+(dataadd*9),txt="Set:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=145,y=datay+(dataadd*9),txt=moon_set_time[1]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=10,y=datay+(dataadd*10),txt="Phase:"})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=55,y=datay+(dataadd*10),txt=moon_phase[1]})

-- line
image({x=205,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})
-- 3 hour output
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=15,txt="Next 3"})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=12,x=220,y=30,txt="Hours"})
-- 1st hour
out({c=0xA4FFA4,x=220,y=50,txt=now["fc_hour1_time"].."  "..now["fc_hour1_ampm"]})
image({w=30,h=30,x=223,y=55,file=now["fc_hour1_wicon"]}) -- image({w=30,h=30,x=223,y=55,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=100,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0xA4FFA4,x=220,y=datay+(dataadd*1),txt=now["fc_hour2_time"].."  "..now["fc_hour2_ampm"]})
image({w=30,h=30,x=223,y=130,file=now["fc_hour2_wicon"]}) -- image({w=30,h=30,x=223,y=130,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=180,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xA4FFA4,x=220,y=210,txt=now["fc_hour3_time"].."  "..now["fc_hour3_ampm"]})
image({w=30,h=30,x=223,y=215,file=now["fc_hour3_wicon"]}) -- image({w=30,h=30,x=223,y=215,file="/home/sector11/Conky/images/red-1.png"})
out({x=228,y=datay+(dataadd*10),txt=now["fc_hour3_temp"] .."°"})
-- line
image({x=275,y=5,w=1,h=260,file="/home/sector11/Conky/images/cyan-1.png"})

--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=10
topy=15
topyy=135 -- topy+(topyy*1)
topx=285
topxx=110
--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1]        =topx            ,topy
   top_left_x_coordinate[2],top_left_y_coordinate[2]     =topx+(topxx*1)  ,topy
top_left_x_coordinate[3],top_left_y_coordinate[3]        =topx+(topxx*2)  ,topy
   top_left_x_coordinate[4],top_left_y_coordinate[4]     =topx+(topxx*3)  ,topy
top_left_x_coordinate[5],top_left_y_coordinate[5]        =topx+(topxx*4)  ,topy
   top_left_x_coordinate[6],top_left_y_coordinate[6]     =topx            ,topy+(topyy*1)
top_left_x_coordinate[7],top_left_y_coordinate[7]        =topx+(topxx*1)  ,topy+(topyy*1)
   top_left_x_coordinate[8],top_left_y_coordinate[8]     =topx+(topxx*2)  ,topy+(topyy*1)
top_left_x_coordinate[9],top_left_y_coordinate[9]        =topx+(topxx*3)  ,topy+(topyy*1)
   top_left_x_coordinate[10],top_left_y_coordinate[10]   =topx+(topxx*4)  ,topy+(topyy*1)
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
out({c=0xA4FFA4,a=1,f="Anonymous Pro:bold",fs=11,x=tlx,y=tly,txt=forecast_day_short[i].."  "..forecast_date[i].."  "..forecast_month_short[i]})
image({x=tlx,y=tly+5,h=30,w=30,file=weather_icon[i]})
out({c=0xFF8C00,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+35,y=tly+15,txt=high_temp[i].."°"})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+35,y=tly+30,txt=low_temp[i].."°"})
out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx,y=tly+50,txt=conditions_short[i]})

out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx,y=tly+65,txt="P: "..precipitation[i].."%"})
   out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+50,y=tly+65,txt="UV: "..uv_index_num[i]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx,y=tly+80,txt="H: "..humidity[i].."%"})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx,y=tly+95,txt="S: 0"..sun_rise_time[i]})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+55,y=tly+95,txt="0"..sun_set_time[i]})
out({c=0xFAFAEC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx,y=tly+110,txt="M: "..moon_rise_time[i]})
   out({c=0x48D1CC,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+55,y=tly+110,txt=moon_set_time[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################

6 conkys running - 1 on desktop 3 that isn't shown and 2 large v9000 LUA conkys and the slim horizontal conky on the right with a light version of v9000 LUA running, the one under my tint2 bar and the calendar in the bottom left corner, and it's drawing CPU 8% on my single core 800mHz CPU.

Now that's awesome!

@ mrpeachy a humble request

See the Sun Rise Set times - there's a "0" in front of the times hard coded to represent 24 hr time. - that will always work here as the sun never sets after 10:00 pm even on the longest day of the year.  But in places where it does set after 10:00pm that will not work.

It also means that to use Sun/Moon Rise Set times with am/pm the conky has to be wider and each day requires more width.  And below that the Moon Rise Set with am/pm turned on and must be there if it's NOT 24 hr time it's needed


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

Offline

#331 2012-01-29 22:50:44

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

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

off-topic:

Thanks for posting the "Hobbit House" screen background here the other day Sector11. I quickly found the brilliant site that it came from. smile

http://www.simondale.net/house/index.htm

/off topic

Last edited by handy (2012-01-29 22:51:11)

Offline

#332 2012-01-29 23:46:58

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

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

handy wrote:

off-topic:

Thanks for posting the "Hobbit House" screen background here the other day Sector11. I quickly found the brilliant site that it came from. smile

http://www.simondale.net/house/index.htm

/off topic

off-topic
Never saw that site before, I found by: Google "Hobbit" > Image - it's the second one. Clicked on more sizes and ended up here:

http://architecture.curiouscatnetwork.c … ory/green/

But yea, same house ... I want it
/off-topic


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

Offline

#333 2012-01-30 00:06:26

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

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

Sector11 wrote:
handy wrote:

off-topic:

Thanks for posting the "Hobbit House" screen background here the other day Sector11. I quickly found the brilliant site that it came from. smile

http://www.simondale.net/house/index.htm

/off topic

off-topic
Never saw that site before, I found by: Google "Hobbit" > Image - it's the second one. Clicked on more sizes and ended up here:

http://architecture.curiouscatnetwork.c … ory/green/

But yea, same house ... I want it
/off-topic

off-topic:

The site is really well worth reading, the content cuts right down to it, very intelligently put together.

I'll stop this now. smile

/off-topic

Offline

#334 2012-01-30 00:42:44

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

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

handy wrote:
Sector11 wrote:
handy wrote:

off-topic:

Thanks for posting the "Hobbit House" screen background here the other day Sector11. I quickly found the brilliant site that it came from. smile

http://www.simondale.net/house/index.htm

/off topic

off-topic
Never saw that site before, I found by: Google "Hobbit" > Image - it's the second one. Clicked on more sizes and ended up here:

http://architecture.curiouscatnetwork.c … ory/green/

But yea, same house ... I want it
/off-topic

off-topic:

The site is really well worth reading, the content cuts right down to it, very intelligently put together.

I'll stop this now. smile

/off-topic

Check the second post here


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

Offline

#335 2012-01-30 02:43:43

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

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

sheesh!  im gone for a couple of hours and hobbits take up residence in my thread!! big_smile

Offline

#336 2012-01-30 02:55:31

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

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

^^  Check out the post above yours ... I moved them  big_smile

And I did make a new horizontal v9000 conky. and created another new conky (from an old one) for my Desktop #3

Last edited by Sector11 (2012-01-30 13:38:36)


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

Offline

#337 2012-02-04 04:17:06

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

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

PART 9 - how to get your v9000 to work with a slow conky update_interval setting

as long as you have no intention of using

conky_parse("${cpu}")

anywhere in any of the v9000 files, it is possible to have v9000 update at a slow interval thus saving cpu cycles

but it will take a little bit of file editing

first open up .v9000_config.lua

find this line

local secs=1800--set update interval

and overwrite with these lines which consist of a replacement variable called "update_interval" and some instructions

--[[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=2 --avoid an interval of 1

next scroll to the bottom of .v9000_config.lua and find this line

return {secs,web,weathericons,con_short,decimal_places,visibility_unit,wind_mph_unit,wind_km_unit,wind_kts_unit,ceiling_unit,wind_degrees_unit,translate}

change "secs" to "update_interval" so the line looks like this

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}

save the file and close

open up v9000.lua

delete the "if updates>5" line and matching end
the if updates line is on line 17

if updates>5 then

the end is on line 758

end-- if updates>5

dont remove the conky_parse line, just the "if updates>5" line and end

go back towards the top of the script and insert a line like so
i put it between these lines around lines 9 and 10

--END SETUP--END SETUP--END SETUP--END SETUP--END SETUP--END SETUP--END SETUP--END---
start=1
--######## main function ########### 

next go to line 21, it should look like this

local secs=settings_table[1]

edit it so it looks like this, again changing "secs" to "update_interval"

local update_interval=settings_table[1]

now go to line 38 and you should see these lines

local timer=(updates %secs)+1
--#######################################
if timer==secs or updates==6 then--######
--#######################################

replace these lines with

local timer=(updates %update_interval)
--################################################
if timer==0 or start==1 then--######
start=nil--#######################################
--################################################

save and close and you should be good to go! (although a backup copy never hurt before you go editing)

i wrote that you should avoid an update_interval in the v9000 config because for some reason, setting 1 will make the script fire the curl command 4 times in a row on start up
not a huge problem, it shouldnt cause any problems and from then on in the update curl cycles run normally

so if you set "update_interval=2" in .v9000_config.lua

and in your conky rc you have

update_interval 900

then v9000 will get new weather data every 1800 seconds

let me know how you get on if you try it!

Offline

#338 2012-02-04 13:45:31

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

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

EDIT: did not RTFullM  :::

Thank you, that works GREAT!

I now have:

~/.v9000_nocpu.config.lua
~/.v9000.config.lua

and

~/v9000/v9000_nocpu.lua
~/v9000/v9000.lua

With one more change in ~/.v9000.config.lua:

package.path = '/home/'..username..'/.v9000_nocpu.config.lua'

Just in case ... now I have both worlds.

Well done mepeachy - as usual!

Last edited by Sector11 (2012-02-04 15:38:30)


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

Offline

#339 2012-02-04 19:28:49

Vetto
New Member
Registered: 2012-02-03
Posts: 3

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

hello all
I think I'm in the right place
A few days ago I installed CrunchBang
and difficult to install but I conkymeteo,
for sure and also due to the fact that I understand very little 's English, there would be someone to say to me all the passages to install the conkymeteo,

thank you .....!

Offline

#340 2012-02-04 19:43: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!

Vetto wrote:

hello all
I think I'm in the right place
A few days ago I installed CrunchBang
and difficult to install but I conkymeteo,
for sure and also due to the fact that I understand very little 's English, there would be someone to say to me all the passages to install the conkymeteo,

thank you .....!

almost smile

i guess i do need to go change the title of this thread

if you are referring to getting conkyforecast up and running
(ie this http://ubuntuforums.org/showthread.php?t=869328)

then this isnt quite right... this thread is about an conkyforecast alternative i wrote

conkyforecast as it was is no longer active but if you follow the above link the original author is/as an alternative too

Offline

#341 2012-02-04 22:09:20

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

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

mrpeachy wrote:

i guess i do need to go change the title of this thread

3 letters: LUA weather in conky  big_smile


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

Offline

#342 2012-02-05 11:15:08

Vetto
New Member
Registered: 2012-02-03
Posts: 3

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

almost smile

i guess i do need to go change the title of this thread

if you are referring to getting conkyforecast up and running
(ie this http://ubuntuforums.org/showthread.php?t=869328)

then this isnt quite right... this thread is about an conkyforecast alternative i wrote

conkyforecast as it was is no longer active but if you follow the above link the original author is/as an alternative too

I tried to follow your advice
but I have these errors in the terminal


root@crunchbang:/home/vetto# sudo rm /etc/apt/sources.list.d/m-buck* && sudo rm /etc/apt/sources.list.d/conkyhardcore*
rm: impossibile rimuovere "/etc/apt/sources.list.d/m-buck*": No such file or directory
root@crunchbang:/home/vetto# sudo rm /etc/apt/sources.list.d/m-buck* && sudo rm /etc/apt/sources.list.d/conkyhardcore
rm: impossibile rimuovere "/etc/apt/sources.list.d/m-buck*": No such file or directory
root@crunchbang:/home/vetto# sudo add-apt-repository ppa:conky-companions/ppa
sudo: add-apt-repository: command not found
root@crunchbang:/home/vetto# sudo apt-get update && sudo apt-get install conkyforecast
Trovato http://security.debian.org squeeze/updates Release.gpg
Ign http://security.debian.org/ squeeze/updates/main Translation-en           
Ign http://security.debian.org/ squeeze/updates/main Translation-it           
Trovato http://ftp.de.debian.org squeeze Release.gpg                           
Ign http://ftp.de.debian.org/debian/ squeeze/contrib Translation-en           
Trovato http://security.debian.org squeeze/updates Release                     
Ign http://ftp.de.debian.org/debian/ squeeze/contrib Translation-it           
Ign http://ftp.de.debian.org/debian/ squeeze/main Translation-en           
Trovato http://ftp.de.debian.org/debian/ squeeze/main Translation-it       
Ign http://ftp.de.debian.org/debian/ squeeze/non-free Translation-en       
Ign http://ftp.de.debian.org/debian/ squeeze/non-free Translation-it       
Trovato http://ftp.de.debian.org squeeze Release                           
Trovato http://packages.crunchbanglinux.org statler Release.gpg             
Ign http://packages.crunchbanglinux.org/statler/ statler/main Translation-en
Trovato http://security.debian.org squeeze/updates/main i386 Packages     
Trovato http://ftp.de.debian.org squeeze/main i386 Packages
Ign http://packages.crunchbanglinux.org/statler/ statler/main Translation-it
Trovato http://packages.crunchbanglinux.org statler Release
Trovato http://ftp.de.debian.org squeeze/contrib i386 Packages
Trovato http://ftp.de.debian.org squeeze/non-free i386 Packages
Trovato http://packages.crunchbanglinux.org statler/main i386 Packages
Lettura elenco dei pacchetti... Fatto
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze       
Lettura informazioni sullo stato... Fatto
E: Impossibile trovare il pacchetto conkyforecast
root@crunchbang:/home/vetto#

how can I fix this?
Crazie for the collaboration

Offline

#343 2012-02-05 12:30:27

gmonti
#! CrunchBanger
From: Caracas, Venezuela
Registered: 2011-12-07
Posts: 108

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

Vetto wrote:

hello all
I think I'm in the right place
A few days ago I installed CrunchBang
and difficult to install but I conkymeteo,
for sure and also due to the fact that I understand very little 's English, there would be someone to say to me all the passages to install the conkymeteo,

thank you .....!

Vetto, forse Io ti posso aiutare, pero prima contattami in privato giulianomontiavellino@gmail.com perche penso che questa non e la lista che tu bisogni. Forse http://crunchbanglinux.org/forums/topic … ky-thread/ o quella di http://browse.deviantart.com/?qh=&secti … onky-meteo o unaltra. Voglio sapere cosa vuoi realmente.

English Translation:

Vetto, maybe I can help you, but first contact me a my e-mail giulianomontiavellino@gmail.com because I think this is not the forum you need. Maybe at  http://crunchbanglinux.org/forums/topic … ky-thread/ or http://browse.deviantart.com/?qh=&secti … onky-meteo or another. I would like to know what do you really want.

Last edited by gmonti (2012-02-05 12:35:22)


Giuliano Monti Avellino
Debian/Squeeze
Gnome

Offline

#344 2012-02-05 15:12:50

gmonti
#! CrunchBanger
From: Caracas, Venezuela
Registered: 2011-12-07
Posts: 108

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

I helped Vetto in howto install conkyforecast, and suggest him to ask at:
http://crunchbanglinux.org/forums/topic … ky-thread/

and

http://forum.ubuntu-it.org/index.php?PH … c=290268.0


Giuliano Monti Avellino
Debian/Squeeze
Gnome

Offline

#345 2012-02-05 15:31:21

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

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

gmonti wrote:

I helped Vetto in howto install conkyforecast, and suggest him to ask at:
http://crunchbanglinux.org/forums/topic … ky-thread/

and

http://forum.ubuntu-it.org/index.php?PH … c=290268.0


Except conkyForecast doesn't work any more it costs $20.00/month and the format has changed.  There is a conkyForecastWU in "alpha" but work is going slow.  I suggested mrpeachy's script here for him


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

Offline

#346 2012-02-07 19:59:45

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

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

http://dl.dropbox.com/u/19008369/new%20 … 000.tar.gz

this is the new update of v9000
i havnt updated post 1 yet as i would be appreciative if a volunteer would test this setup out first

it will run with any existing template files you currently have
it just adds some additional features

the data option weather_location can be used with the out() function to automate location

i have implemented the color coded wind direction icons
you can use them with the image() function
for the current weather like this:
now["wind_icon"]
for forecast weather like this:
wind_icon[n] where n is the day number (or substitute i for use in the forecast repeat)

also to use with the image() function there are moon icons
moon_icon[n] where n is the day number (or substitute i for use in the forecast repeat)

the other significant addition is weather alerts, which are only available for US locations unfortunately
there is an alert icon
alert_icon that can be used with the image() function

then there is a method similar to the weather repeat code to get alerts displayed
the data types for alerts are as follows and should be self explanatory:

alert_type[ i ]
alert_location[ i ]
alert_issed[ i ]

you will always use them with the i inside the brackets because you will put them in a for loop for the repeat

here is the code in the default display
you use the out function within the loop to set positions for the text in each alert
then you set a gap number instead of setting individual coordinates

--ALERTS SECTION
--show alert icon
image({x=0,y=390,h=20,w=20,file=alert_icon})
--show number of alerts
out({x=5,y=430,fs=18,txt=alert_number})
--display alert information
display_alerts=2--set number of alerts to show,set 0 to show all
top_left_alert_x=30--set top left coordinates for entire alerts section
top_left_alert_y=400--^alerts will display in a single column
alert_gap=50--sets the gap between the TOP of one alert and the Top of the next alert
--#######################################################################################################################################
if alert_number==0 then noal=1 elseif alert_number~=0 and display_alerts>alert_number then noal=alert_number else noal=display_alerts end
for i=1,noal do--start of alerts display section. do not edit ###########################################################################
local tlx=top_left_alert_x--write output relative to tlx #################################
local tly=top_left_alert_y+((i-1)*alert_gap)--write output relative to tlx ###############
--########################################################################################
out({c=0xffffff,a=1,f="mono",fs=8,x=tlx,y=tly,   txt=alert_type[ i ]})
out({c=0xffffff,a=1,f="mono",fs=8,x=tlx,y=tly+15,txt=alert_location[i]})
out({c=0xffffff,a=1,f="mono",fs=8,x=tlx,y=tly+30,txt=alert_issued[i]})
--########################################################################################
end--of alert display section ############################################################

if you have already gone through the process of altering the script for slow conkyrc cycles then you only need extract and replace the main v9000.lua script

if not then the config file and v9000 have been altered as in this post
http://crunchbanglinux.org/forums/post/186277/#p186277

screenshota9bce9f77402594cf09a5918b8f5d480.png

Last edited by mrpeachy (2012-02-07 20:36:57)

Offline

#347 2012-02-07 20:34:46

gmonti
#! CrunchBanger
From: Caracas, Venezuela
Registered: 2011-12-07
Posts: 108

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

@ Mrpeachy, tested and working smoothly without any error.

Do you want to do something special??


Giuliano Monti Avellino
Debian/Squeeze
Gnome

Offline

#348 2012-02-07 20:37:50

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

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

gmonti wrote:

@ Mrpeachy, tested and working smoothly without any error.

thanks gmonti smile

Do you want to do something special??

something special? how do you mean?

Offline

#349 2012-02-07 20:43:24

gmonti
#! CrunchBanger
From: Caracas, Venezuela
Registered: 2011-12-07
Posts: 108

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

mrpeachy wrote:
gmonti wrote:

@ Mrpeachy, tested and working smoothly without any error.

thanks gmonti smile

Do you want to do something special??

something special? how do you mean?

I don't know... change something in the lua or in the conkyrc, whatever you want to test outside your pc.

see the screenshot http://satelite.dynalias.net/conky/v9000.png


Giuliano Monti Avellino
Debian/Squeeze
Gnome

Offline

Be excellent to each other!

#350 2012-02-07 20:47:25

gmonti
#! CrunchBanger
From: Caracas, Venezuela
Registered: 2011-12-07
Posts: 108

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

Mrpeachy just one question... How do I change the mph to kmh???


Giuliano Monti Avellino
Debian/Squeeze
Gnome

Offline

Board footer

Powered by FluxBB

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

Debian Logo