You are not logged in.

#876 2018-02-12 18:49:49

Indian
Member
Registered: 2018-02-05
Posts: 21

Re: Show us your conky

Trying the lua script the problem could be that something in the weather page has changed.

Offline

#877 2018-02-12 20:59:44

Alpetjr
Member
Registered: 2018-01-11
Posts: 12

Re: Show us your conky

It updates fine and I do have the weather icons in ~/weathericons.

Offline

#878 2018-02-13 16:21:44

unklar
Member
Registered: 2015-10-31
Posts: 602

Re: Show us your conky

https://forums.bunsenlabs.org/viewtopic … 124#p68124

@loutch,
Thank you for sharing. cool
I like it very much, because of the bigger picture. In the configuration I had to adjust this line because the autostart was not done with the system.

${texeci 2 $HOME/.conky/radiotray/logo.sh}${texeci 5 $HOME/.conky/radiotray/pochette.sh}

radiotray1.th.png radiotray2.th.png radiotray3.th.jpg


The channel logo only works for as long as the channel is running. If I turn off radiotray, the logo.sh-script takes the "general Google image" (according to
~/.conky/radiotray/images no picture is stored).

If you want to test it, here's my channel:

http://stream.srg-ssr.ch/m/rsp/mp3_128

http://www.radioswisspop.ch/en

Last edited by unklar (2018-02-13 16:34:45)

Offline

#879 2018-02-14 08:42:00

loutch
Member
Registered: 2015-12-12
Posts: 201

Re: Show us your conky

Hello

@ unklar

i don't have this problem because i  use a script too call-kill the conky & radiotray with a shortcut in my Xbar

first clic open conky & radiotray
choose any station & listen
second clic kill conky & radiotray

so the conky & radiotray are killed together

Maybe modifiy the conkyrc like this

${if_running radiotray}
${lua fDrawImage ~/.conky/radiotray/images/caset.png 00 00 150 150}
${voffset 120}${if_match "${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30}" == "Playing"} 
${else}${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30 }${endif}
${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30 > ~/.conky/radiotray/artiste_titre.txt}
${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio > ~/.conky/radiotray/logo.txt}
${texeci 5 ~/.conky/radiotray/pochette.sh}${texeci 2 ~/.conky/radiotray/logo.sh}
${if_match "${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30}" == "Playing"}${lua fDrawImage ~/.conky/radiotray/logo.png 19 19 112 112}
${else}${lua fDrawImage ~/.conky/radiotray/pochette.png 19 19 112 112}${endif}${else}
Radiotray not running${endif}

After "${else}"radiotray not running" you can put something else or any image .


@+

Last edited by loutch (2018-02-14 09:03:15)

Offline

#880 2018-02-14 16:32:30

Indian
Member
Registered: 2018-02-05
Posts: 21

Re: Show us your conky

Alpetjr wrote:

It updates fine and I do have the weather icons in ~/weathericons.

Do you have icons in the day 1 and 2 of the forecast?

Offline

#881 2018-02-14 16:42:26

unklar
Member
Registered: 2015-10-31
Posts: 602

Re: Show us your conky

loutch wrote:

first clic open conky & radiotray
choose any station & listen
second clic kill conky & radiotray

^ Hello,
that does the trick!  big_smile

Merci beaucoup, loutch.

Offline

#882 2018-02-14 21:07:18

Alpetjr
Member
Registered: 2018-01-11
Posts: 12

Re: Show us your conky

Indian wrote:
Alpetjr wrote:

It updates fine and I do have the weather icons in ~/weathericons.

Do you have icons in the day 1 and 2 of the forecast?

When I start it up none of the current weather appear, with no icons. When I close the terminal the current weather disappears. The template is showing, but nothing else.

Offline

#883 2018-02-15 16:31:27

Indian
Member
Registered: 2018-02-05
Posts: 21

Re: Show us your conky

This is because the page where it takes the data has changed. The best solution is to use another weather forecast lua script and modiofy it to something you like.

Offline

#884 2018-02-15 23:25:30

manuel-909
Member
Registered: 2017-10-09
Posts: 25

Re: Show us your conky

My new conky desktop.....
2018-02-15-18-22-42_scrot.th.png

Offline

#885 2018-02-16 18:55:18

manuel-909
Member
Registered: 2017-10-09
Posts: 25

Re: Show us your conky

an upgrade......
2018-02-16-13-52-54_scrot.th.png

Offline

#886 2018-02-16 19:05:43

Alpetjr
Member
Registered: 2018-01-11
Posts: 12

Re: Show us your conky

Any chance you could post your weather code? Every time  try to get some weather code to work I run into a invisible wall and I have nothing but problems. Thanks

Offline

#887 2018-02-17 02:36:47

manuel-909
Member
Registered: 2017-10-09
Posts: 25

Re: Show us your conky

conkyrc

conky.config = {
--Use XFT?
	use_xft = true,
	font = 'caviar dreams:size=10',
	xftalpha = 0.8,
	text_buffer_size = 2048,
	max_text_width = 0,
	override_utf8_locale = true,
	uppercase = false,
	no_buffers = true,
	short_units = true,
	format_human_readable = true,

-- Like it says, ot pads the decimals on % values
-- doesn't seem to work since v1.7.1
	pad_percents = 2,

-- Update interval in seconds
	update_interval = 1,

-- This is the number of times Conky will update before quitting.
-- Set to zero to run forever.
	total_run_times = 0,

-- Create own window instead of using desktop (required in nautilus)
	own_window = true,
	own_window_transparent = true,
	own_window_type = 'desktop',
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
 own_window_argb_visual = true,
 own_window_argb_value = 255,
	background = true,
	use_spacer = 'none',

-- Use double buffering (reduces flicker, may not work for everyone)
	double_buffer = true,

-- Minimum size of text area -adjust if you would like to user smaller fonts etc.
	minimum_width = 450, minimum_height = 570,
	--maximum_width = 465,
	--max_specials = '1024',
	max_user_text = 16384,
--default_bar_size 215 5

-- Desired output unit of all objects displaying a temperature. Parameters are
-- either "fahrenheit" or "celsius". The default unit is degree Celsius.
	temperature_unit = 'fahrenheit',

-- Draw shades?
	draw_shades = false,
	default_shade_color = '#000000',

-- Draw outlines?
	draw_outline = false,
	default_outline_color = '#000000',

--##  Color Settings
	default_color = 'b2b2b2', 
color0 = '555555',         
color1 = '483D8B',         -- Dark Slate Blue
color2 = 'B8860B',         -- Dark goldenrod
color3 = '#7FFF00',--127 255   0	Chartreuse
color4 = '8B0000',         -- Dark red
color5 = '008080',         -- Teal
color6 = '99ccff',         -- Gray20
color7 = 'C8C8FF',         -- (COOL)
color8 = 'FFFFCC',         -- (WARM)
color9 = 'FCCCCC',         -- (HOT) 

-- Draw borders around text
	draw_borders = false,

-- Stippled borders?
	stippled_borders = 0,

-- border margins
	border_inner_margin = 10,
	border_outer_margin = 0,

-- border width
	border_width = 1,

-- graph borders
	draw_graph_borders = false,--no
--default_graph_size 15 40
--show_graph_range = false,
--show_graph_scale = false,

-- Text alignment, other possible values are commented
--alignment = 'top_left',
alignment = 'top_right',
--alignment = 'top_middle',
--alignment = 'bottom_left',
--alignment = 'bottom_right',
--alignment = 'bottom_middle',

-- Gap between borders of screen and text
-- same thing as passing -x at command line
	gap_x = 13,
	gap_y = 20,


-- -- Lua Load -- #
lua_load = '~/.draw-bg.lua',
-- ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
--lua_draw_hook_pre = 'draw_bg 20 0 0 0 0 0x000000 0.2'
--lua_draw_hook_post = 'draw_bg 20 0 0 0 0 0x000000 0.2',

-- -- Album art fix -- #
	imlib_cache_size = 0,

template0 = [[
${font Neuropolitical:bold:size=8}${color7}\1 ${font}${hr 2}${font}${color8}]],
template1 = [[
${color8}$\1]],
template2 = [[
${color8}\1${color8} \2]],

-- ASCII Characters
-- │ ─ ┌ ┬ ┐ └ ┴ ┘ ├ ┼ ┤
-- ║ ═ ╔ ╦ ╗ ╚ ╩ ╝ ╠ ╬ ╣

-- ↑ ↓ → ← ↔ ► ◄ ▲ ▼ « »
-- ░  ▒  ▓ ☺ ☻ ♥ ♦ ♣ ♠
-- • ◘ ○ ◙ ♂ ♀ ♪ ♫ ☼
-- ¼ ½ ¾ ® ©
 lua_load = '~/conky-conf/weather/launcher.lua',
lua_draw_hook_post = 'main', 
};

conky.text = [[
${texeci 500 bash $HOME/1_accuweather/1_accuweather -f2015}
${voffset -15}${execpi 600 sed -n '1p' $HOME/1_accuweather/first_days}  ${execpi 600 sed -n '5p' $HOME/1_accuweather/first_days|cut -c1-20}${execpi 600 sed -n '5p' $HOME/1_accuweather/first_days|cut -c21-40}  ${execpi 600 sed -n '3p' $HOME/1_accuweather/first_days}°/${execpi 600 sed -n '4p' $HOME/1_accuweather/first_days}°
#### Prelier cadre ####
${voffset 10}${font 7LED :size=55:style=Medium}${color 808080}${goto 20}${time %I}${goto 130}${time %M}${font 7LED :size=20:style=Medium}${color 808080}${goto 235}${time %S}$font
#### Date ####
${voffset -30}${color white}${font caviar dreams:size=9}${alignc -120}${time %A, %d %B %Y}$font
### vent ####
${voffset 10}
${goto 310}${font caviar dreams:size=10}Wind D : ${execi 90 sed -n '5p' $HOME/1_accuweather/curr_cond} 
${goto 310}Wind S : ${execi 90 sed -n '6p' $HOME/1_accuweather/curr_cond}
${goto 310}Pressure : ${execi 90 sed -n '8p' $HOME/1_accuweather/curr_cond}
${goto 310}Index UV : ${execi 90 sed -n '9p' $HOME/1_accuweather/curr_cond}${alignr}Dp: ${color8}${execpi 300 sed -n '12p' $HOME/1_accuweather/curr_cond}° $font
#### Ville ####
${voffset -40}${font caviar dreams:size=13}${execi 90 sed -n '4p' $HOME/1_accuweather/curr_cond}${font} 
Temp.: ${execi 90 sed -n '2p' $HOME/1_accuweather/curr_cond} °F   Feels.: ${execi 90 sed -n '3p' $HOME/1_accuweather/curr_cond} °F 
#### Deuxième cadre ####
##### Affichage temperatures #####
${voffset 20}
${goto 20}${color7}${execi 90 sed -n '9p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '8p' $HOME/1_accuweather/first_days}°${color}\
${goto 95}${color7}${execi 90 sed -n '14p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '13p' $HOME/1_accuweather/first_days}°${color}\
${goto 170}${color7}${execi 90 sed -n '19p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '18p' $HOME/1_accuweather/first_days}°${color}\
${goto 245}${color7}${execi 90 sed -n '24p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '23p' $HOME/1_accuweather/first_days}°${color}\
${goto 320}${color7}${execi 90 sed -n '4p' $HOME/1_accuweather/last_days}°${color}/${color9}${execi 90 sed -n '3p' $HOME/1_accuweather/last_days}°${color}\
${goto 400}${color7}${execi 90 sed -n '9p' $HOME/1_accuweather/last_days}°${color}/${color9}${execi 90 sed -n '8p' $HOME/1_accuweather/last_days}°${color}
#### Affichage date ####
${voffset 40}
${goto 20}${execi 3600 echo `date --date="1 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="1 day" | awk '{print $3}'`}\
${goto 95}${execi 3600 echo `date --date="2 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="2 day" | awk '{print $3}'`}\
${goto 170}${execi 3600 echo `date --date="3 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="3 day" | awk '{print $3}'`}\
${goto 245}${execi 3600 echo `date --date="4 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="4 day" | awk '{print $3}'`}\
${goto 320}${execi 3600 echo `date --date="5 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="5 day" | awk '{print $3}'`}\
${goto 400}${execi 3600 echo `date --date="6 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="6 day" | awk '{print $3}'`}
${execpi 90 ~/conky-conf/weather/alert.sh}
#### premier cadre ####
${lua conky_draw_bg 20 0 0 0 180 0x000000 0.6}
${lua conky_draw_bg 20 0 185 0 145 0x000000 0.6}
${lua conky_draw_bg 20 0 340 0 250 0x000000 0.6}
#${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 40 450 110}
#${lua fDrawImage ~/conky-conf/weather/flip_bg.png 9 25 110 100}
#${lua fDrawImage ~/conky-conf/weather/flip_bg.png 119 25 110 100}
#### Second cadre ####
#${image ~/conky-conf/weather/flip_bg.png -p 0,20 -s 100x90}
#${image ~/conky-conf/weather/flip_bg.png -p 120,20 -s 100x90}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_0.png 175 115 132 70}
${lua fDrawImage ~/1_accuweather/forecast_2015/wind_0.png 385 70 90 90}
#${image $HOME/1_accuweather/forecast_2015/forecast_0.png -p 170,100 -s 132x70}
#${image $HOME/1_accuweather/forecast_2015/wind_0.png -p 385,55 -s 90x90}
#### icônes Second  ####
${texeci 500 bash $HOME/4_Moon/moon_MoonGiant}${lua fDrawImage ~/4_Moon/0.png 390 10 60 60}
#${image $HOME/1_accuweather/forecast_2015/forecast_1.png -p 350,0 -s 90x54}
#${image $HOME/1_accuweather/forecast_2015/forecast_2.png -p -5,195 -s 90x54}
#${image $HOME/1_accuweather/forecast_2015/forecast_3.png -p 70,195 -s 90x54}
#${image $HOME/1_accuweather/forecast_2015/forecast_4.png -p 145,195 -s 90x54}
#${image $HOME/1_accuweather/forecast_2015/forecast_5.png -p 220,195 -s 90x54}
#${image $HOME/1_accuweather/forecast_2015/forecast_6.png -p 295,195 -s 90x54}
#${image $HOME/1_accuweather/forecast_2015/forecast_7.png -p 375,195 -s 90x54}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_1.png 300 20 90 55}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_2.png  0 210 90 55}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_3.png  70 210 90 55}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_4.png  145 210 90 55}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_5.png  220 210 90 55}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_6.png  295 210 90 55}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_7.png  375 210 90 55}
#${voffset -220}
]];

draw_bg.lua

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

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

so:

lua_load ~/Conky/LUA/draw_bg.lua
TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}


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

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

20             corner_radius
 0             x_position
 0             y_position
 0             width
 0             height
 0x000000      color
 0.4           alpha

]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end

equalizer.lua

--[[ BARGRAPH WIDGET
	v2.1 by wlourf (07 Jan. 2011)
	edited by Caymus
	this widget draws a bargraph with different effects 
	http://u-scripts.blogspot.com/2010/07/bargraph-widget.html
	
To call the script in a conky, use, before TEXT
	lua_load /path/to/the/script/bargraph.lua
	lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT

	
Parameters are :
3 parameters are mandatory
name	- the name of the conky variable to display, for example for {$cpu cpu0}, just write name="cpu"
arg		- the argument of the above variable, for example for {$cpu cpu0}, just write arg="cpu0"
		  arg can be a numerical value if name=""
max		- the maximum value the above variable can reach, for example, for {$cpu cpu0}, just write max=100
	
Optional parameters:
x,y		- coordinates of the starting point of the bar, default = middle of the conky window
cap		- end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
		  http://www.cairographics.org/samples/set_line_cap/
angle	- angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
		  set to 90 for an horizontal bar
skew_x	- skew bar around x axis, default = 0
skew_y	- skew bar around y axis, default = 0
blocks  - number of blocks to display for a bar (values >0) , default= 10
height	- height of a block, default=10 pixels
width	- width of a block, default=20 pixels
space	- space between 2 blocks, default=2 pixels
angle_bar	- this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
radius		- for cicular bars, internal radius, default=0
			  with radius, parameter width has no more effect.

Colours below are defined into braces {colour in hexadecimal, alpha}
fg_colour	- colour of a block ON, default= {0x00FF00,1}
bg_colour	- colour of a block OFF, default = {0x00FF00,0.5}
alarm		- threshold, values after this threshold will use alarm_colour colour , default=max
alarm_colour - colour of a block greater than alarm, default=fg_colour
smooth		- (true or false), create a gradient from fg_colour to bg_colour, default=false 
mid_colour	- colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
			  for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
			  3 colurs to gradient created by fg_colour and alarm_colour, default=no mid_colour
led_effect	- add LED effects to each block, default=no led_effect
			  if smooth=true, led_effect is not used
			  possibles values : "r","a","e" for radial, parallelel, perdendicular to the bar (just try!)
			  led_effect has to be used with theses colours :
fg_led		- middle colour of a block ON, default = fg_colour
bg_led		- middle colour of a block OFF, default = bg_colour
alarm_led	- middle colour of a block > ALARM,  default = alarm_colour

reflection parameters, not avaimable for circular bars
reflection_alpha    - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                      other values = starting opacity
reflection_scale    - scale of the reflection (default = 1 = height of text)
reflection_length   - length of reflection, define where the opacity will be set to zero
					  calues from 0 to 1, default =1
reflection			- position of reflection, relative to a vertical bar, default="b"
					  possibles values are : "b","t","l","r" for bottom, top, left, right
draw_me     - if set to false, text is not drawn (default = true or 1)
              it can be used with a conky string, if the string returns 1, the text is drawn :
              example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",

v1.0 (10 Feb. 2010) original release
v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value	
v1.2 (28 Feb. 2010) just renamed the widget to bargraph
v1.3 (03 Mar. 2010) added parameters radius & angle_bar to draw the bar in a circular way
v2.0 (12 Jul. 2010) rewrite script + add reflection effects and parameters are now set into tables
v2.1 (07 Jan. 2011) Add draw_me parameter and correct memory leaks, thanks to "Creamy Goodness"

--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation version 3 (GPLv3)
--     
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--     
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
--      MA 02110-1301, USA.		

]]

require 'cairo'

----------------START OF PARAMETERS ----------
function conky_main_bars()
	local bars_settings={
		{
			name="cpu",
			arg="cpu0",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=10,y=438,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
		{
			name="cpu",
			arg="cpu1",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=95,y=438,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
                {
			name="cpu",
			arg="cpu2",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=190,y=438,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
		{
			name="cpu",
			arg="cpu3",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=285,y=438,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
		{
			name="cpu",
			arg="cpu4",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=380,y=438,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
		{
			name="memperc",
			arg="",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			x=10,y=460,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
		
                {
			name="fs_used_perc",
			arg="/",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=95,y=460,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
                {
			name="fs_used_perc",
			arg="/media/manuel/Files",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=190,y=460,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
                {
			name="fs_used_perc",
			arg="/media/manuel/Windows 10",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=285,y=460,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
                {
			name="fs_used_perc",
			arg="/media/manuel/L-Mint",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=380,y=460,
			blocks=25,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
			mid_colour={{0.5,0xFF8C00,1}}
		},
	{
			name="downspeedf",
			arg="eth0",
			max=1000,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=10,y=530,
			blocks=45,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
draw_me="${if_existing /proc/net/route eth0}1${else}0$endif",
			mid_colour={{0.5,0xFF8C00,1}}
		},
		{
			name="upspeedf",
			arg="eth0",
			max=500,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=330,y=530,
			blocks=45,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
draw_me="${if_existing /proc/net/route eth0}1${else}0$endif",
			mid_colour={{0.5,0xFF8C00,1}}
		},
                {
			name="downspeedf",
			arg="wlan0",
			max=1000,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=10,y=530,
			blocks=40,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
draw_me="${if_existing /proc/net/route wlan0}1${else}0$endif",
			mid_colour={{0.5,0xFF8C00,1}}
		},
		{
			name="upspeedf",
			arg="wlan0",
			max=500,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=350,y=530,
			blocks=40,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
draw_me="${if_existing /proc/net/route wlan0}1${else}0$endif",
			mid_colour={{0.5,0xFF8C00,1}}
		},
		{
			name="wireless_link_qual_perc",
			arg="wlan0",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=165,y=530,
			blocks=45,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
draw_me="${if_existing /proc/net/route wlan0}1${else}0$endif",
                    	mid_colour={{0.5,0xFF8C00,1}}
                },
                {
			name="battery_percent",
			arg="BAT0",
			max=100,
			alarm=80,
			bg_colour={0XDCDCDC,0.25},
			fg_colour={0X7FFF00,1},
			alarm_colour={0xff0000,1},
			x=200,y=573,
			blocks=85,
			height=1,width=7,
			angle=90,
			smooth=true,
			cap="e",
			skew_y=0,
--draw_me="${if_existing /proc/net/route wlan0}1${else}0$endif",
                    	mid_colour={{0.5,0xFF8C00,1}}
                },
		
						
	}
	
-----------END OF PARAMETERS--------------


    
	if conky_window == nil then return end
	
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
	
	cr = cairo_create(cs)    
	--prevent segmentation error when reading cpu state
    if tonumber(conky_parse('${updates}'))>3 then
        for i in pairs(bars_settings) do
        	
        	draw_multi_bar_graph(bars_settings[i])
        	
        end
    end
	cairo_destroy(cr)
	cairo_surface_destroy(cs)
	cr=nil

end



function draw_multi_bar_graph(t)
	cairo_save(cr)
	--check values
	if t.draw_me == true then t.draw_me = nil end
	if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end	
	if t.name==nil and t.arg==nil then 
		print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ") 
		return
	end
	if t.max==nil then
		print ("No maximum value defined, use 'max'")
		return
	end
	if t.name==nil then t.name="" end
	if t.arg==nil then t.arg="" end

	--set default values	
	if t.x == nil		then t.x = conky_window.width/2 end
	if t.y == nil		then t.y = conky_window.height/2 end
	if t.blocks == nil	then t.blocks=10 end
	if t.height == nil	then t.height=10 end
	if t.angle == nil 	then t.angle=0 end
	t.angle = t.angle*math.pi/180
	--line cap style
	if t.cap==nil		then t.cap = "b" end
	local cap="b"
	for i,v in ipairs({"s","r","b"}) do 
		if v==t.cap then cap=v end
	end
	local delta=0
	if t.cap=="r" or t.cap=="s" then delta = t.height end
	if cap=="s" then 	cap = CAIRO_LINE_CAP_SQUARE
	elseif cap=="r" then
		cap = CAIRO_LINE_CAP_ROUND
	elseif cap=="b" then
		cap = CAIRO_LINE_CAP_BUTT
	end
	--end line cap style
	--if t.led_effect == nil	then t.led_effect="r" end
	if t.width == nil	then t.width=20 end
	if t.space == nil	then t.space=2 end
	if t.radius == nil	then t.radius=0 end
	if t.angle_bar == nil	then t.angle_bar=0 end
	t.angle_bar = t.angle_bar*math.pi/360 --halt angle
	
	--colours
	if t.bg_colour == nil 	then t.bg_colour = {0x00FF00,0.5} end
	if #t.bg_colour~=2 		then t.bg_colour = {0x00FF00,0.5} end
	if t.fg_colour == nil 	then t.fg_colour = {0x00FF00,1} end
	if #t.fg_colour~=2 		then t.fg_colour = {0x00FF00,1} end
	if t.alarm_colour == nil 	then t.alarm_colour = t.fg_colour end
	if #t.alarm_colour~=2 		then t.alarm_colour = t.fg_colour end

	if t.mid_colour ~= nil then	
		for i=1, #t.mid_colour do    
		    if #t.mid_colour[i]~=3 then 
		    	print ("error in mid_color table")
		    	t.mid_colour[i]={1,0xFFFFFF,1} 
		    end
		end
    end
    
	if t.bg_led ~= nil and #t.bg_led~=2	then t.bg_led = t.bg_colour end
	if t.fg_led ~= nil and #t.fg_led~=2	then t.fg_led = t.fg_colour end
	if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
	
	if t.led_effect~=nil then
		if t.bg_led == nil then t.bg_led = t.bg_colour end
		if t.fg_led == nil 	then t.fg_led = t.fg_colour end
		if t.alarm_led == nil  then t.alarm_led = t.fg_led end
	end
	

	if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
	if t.smooth == nil then t.smooth = false end

	if t.skew_x == nil then 
		t.skew_x=0 
	else
		t.skew_x = math.pi*t.skew_x/180	
	end
	if t.skew_y == nil then 
		t.skew_y=0
	else
		t.skew_y = math.pi*t.skew_y/180	
	end
	
	if t.reflection_alpha==nil then t.reflection_alpha=0 end
	if t.reflection_length==nil then t.reflection_length=1 end
	if t.reflection_scale==nil then t.reflection_scale=1 end
	
	--end of default values
	

 	local function rgb_to_r_g_b(col_a)
		return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
	end
	
	
	--functions used to create patterns

	local function create_smooth_linear_gradient(x0,y0,x1,y1)
		local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
		if t.mid_colour ~=nil then
			for i=1, #t.mid_colour do
				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
			end
		end
		return pat
	end

	local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
		local pat =  cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
		if t.mid_colour ~=nil then
			for i=1, #t.mid_colour do
				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
			end
		end
		return pat
	end
	
	local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
		local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
		cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
		cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
		cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
		return pat
	end

	local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
		local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
		if mode==3 then
			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))				
			cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
		else
			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
		end
		return pat
	end






	local function draw_single_bar()
		--this fucntion is used for bars with a single block (blocks=1) but 
		--the drawing is cut in 3 blocks : value/alarm/background
		--not zvzimzblr for circular bar
		local function create_pattern(col_alp,col_led,bg)
			local pat
			
			if not t.smooth then
				if t.led_effect=="e" then
					pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
				elseif t.led_effect=="a" then
					pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
				elseif  t.led_effect=="r" then
					pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
				else
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
				end
			else
				if bg then
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
				else
					pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
				end
			end
			return pat
		end
		
		local y1=-t.height*pct/100
		local y2,y3
		if pct>(100*t.alarm/t.max) then 
			y1 = -t.height*t.alarm/100
			y2 = -t.height*pct/100
			if t.smooth then y1=y2 end
		end
		
		if t.angle_bar==0 then
		
			--block for fg value
			local pat = create_pattern(t.fg_colour,t.fg_led,false)
			cairo_set_source(cr,pat)
			cairo_rectangle(cr,0,0,t.width,y1)
			cairo_fill(cr)
			cairo_pattern_destroy(pat)
		
			-- block for alarm value			
			if not t.smooth and y2 ~=nil then 
				pat = create_pattern(t.alarm_colour,t.alarm_led,false)
				cairo_set_source(cr,pat)
				cairo_rectangle(cr,0,y1,t.width,y2-y1)
				cairo_fill(cr)
				y3=y2
				cairo_pattern_destroy(pat)
			else
				y2,y3=y1,y1
			end
			-- block for bg value
			cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
			pat = create_pattern(t.bg_colour,t.bg_led,true)
			cairo_set_source(cr,pat)
			cairo_pattern_destroy(pat)
			cairo_fill(cr)
		end		
	end  --end single bar
	





	local function draw_multi_bar()
		--function used for bars with 2 or more blocks
		for pt = 1,t.blocks do 
			--set block y
			local y1 = -(pt-1)*(t.height+t.space)
			local light_on=false
			
			--set colors
			local col_alp = t.bg_colour
			local col_led = t.bg_led
			if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
				if pct>=(pcb*(pt-1))  then 
					light_on = true
					col_alp = t.fg_colour
					col_led = t.fg_led
					if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then 
						col_alp = t.alarm_colour 
						col_led = t.alarm_led 
					end
				end
			end

			--set colors
			--have to try to create gradients outside the loop ?
			local pat 
			
			if not t.smooth then
				if t.angle_bar==0 then
					if t.led_effect=="e" then
						pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
					elseif t.led_effect=="a" then
						pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)					
					elseif  t.led_effect=="r" then
						pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)	
					else
						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
					end
				else
					 if t.led_effect=="a"  then
						 pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
														 0, 0, t.radius+(t.height+t.space)*(pt),						 
											 col_alp,col_led,3)	
					else
						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))					
					end
					
				end
			else
				
				if light_on then
					if t.angle_bar==0 then
						pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
					else
						pat = create_smooth_radial_gradient(0, 0, (t.height+t.space),  0,0,(t.blocks+1)*(t.height+t.space),2)
					end
				else		
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
				end
			end
			cairo_set_source (cr, pat)
			cairo_pattern_destroy(pat)

			--draw a block
			if t.angle_bar==0 then
				cairo_move_to(cr,0,y1)
				cairo_line_to(cr,t.width,y1)
			else		
				cairo_arc( cr,0,0,
					t.radius+(t.height+t.space)*(pt)-t.height/2,
					 -t.angle_bar -math.pi/2 ,
					 t.angle_bar -math.pi/2)
			end
			cairo_stroke(cr)
		end	
	end
	
	
	
	
	local function setup_bar_graph()
		--function used to retrieve the value to display and to set the cairo structure
		if t.blocks ~=1 then t.y=t.y-t.height/2 end
		
		local value = 0
		if t.name ~="" then
			value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
			--$to_bytes doesn't work when value has a decimal point,
			--https://garage.maemo.org/plugins/ggit/browse.php/?p=monky;a=commitdiff;h=174c256c81a027a2ea406f5f37dc036fac0a524b;hp=d75e2db5ed3fc788fb8514121f67316ac3e5f29f
			--http://sourceforge.net/tracker/index.php?func=detail&aid=3000865&group_id=143975&atid=757310
			--conky bug?
			--value = (conky_parse(string.format('${%s %s}', t.name, t.arg)))
			--if string.match(value,"%w") then
			--	value = conky_parse(string.format('${to_bytes %s}',value))
			--end
		else
			value = tonumber(t.arg)
		end

		if value==nil then value =0 end
		
		pct = 100*value/t.max
		pcb = 100/t.blocks
		
		cairo_set_line_width (cr, t.height)
		cairo_set_line_cap  (cr, cap)
		cairo_translate(cr,t.x,t.y)
		cairo_rotate(cr,t.angle)

		local matrix0 = cairo_matrix_t:create()
		tolua.takeownership(matrix0)
		cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
		cairo_transform(cr,matrix0)

	
		
		--call the drawing function for blocks
		if t.blocks==1 and t.angle_bar==0 then
			draw_single_bar()
			if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
		else
			draw_multi_bar()
		end

		--dot for reminder
		--[[
		if t.blocks ~=1 then
			cairo_set_source_rgba(cr,1,0,0,1)
			cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
			cairo_fill(cr)
		else
			cairo_set_source_rgba(cr,1,0,0,1)
			cairo_arc(cr,0,0,3,0,2*math.pi)
			cairo_fill(cr)
		end]]
		
		--call the drawing function for reflection and prepare the mask used		
		if t.reflection_alpha>0 and t.angle_bar==0 then
			local pat2
			local matrix1 = cairo_matrix_t:create()
			tolua.takeownership(matrix1)
			if t.angle_bar==0 then
				pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
				if t.reflection=="t" then
					cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
					pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
				elseif t.reflection=="r" then
					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
					pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
				elseif t.reflection=="l" then
					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
					pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
				else --bottom
					cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
					pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
				end
			end
			cairo_transform(cr,matrix1)

			if t.blocks==1 and t.angle_bar==0 then
				draw_single_bar()
				cairo_translate(cr,0,-t.height/2) 
			else
				draw_multi_bar()
			end
			
			
			cairo_set_line_width(cr,0.01)
			cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
			cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
			if t.angle_bar==0 then
				cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
			end
			cairo_clip_preserve(cr)
			cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
			cairo_stroke(cr)
			cairo_mask(cr,pat2)
			cairo_pattern_destroy(pat2)
			cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
			
		end --reflection
		pct,pcb=nil
	end --setup_bar_graph()
	
	--start here !
	setup_bar_graph()
	cairo_restore(cr)
end

function conky_main_box()

    if conky_window==nil then return end
    
	---------------------- PARAMETERS BEGIN HERE
    local boxes_settings={
	{x=0,y=50,w=200,h=60, corners={ {"circle",10} },colour={ {0,0x1F1F1F,0.5} },operator="atop" } ,
	{x=0,y=195,w=200,h=60, corners={ {"circle",10} },colour={ {0,0x1F1F1F,0.5} },operator="atop" } ,
	{x=0,y=320,w=200,h=60, corners={ {"circle",10} },colour={ {0,0x1F1F1F,0.5} },operator="atop" } ,
	{x=0,y=410,w=200,h=60, corners={ {"circle",10} },colour={ {0,0x1F1F1F,0.5} },operator="atop" } ,
	{x=0,y=520,w=200,h=60, corners={ {"circle",10} },colour={ {0,0x1F1F1F,0.5} },operator="atop" } ,
	{x=0,y=615,w=200,h=150, corners={ {"circle",10} },colour={ {0,0x1F1F1F,0.5} },operator="atop" } ,
    }


    ---------------------------- PARAMETERS END HERE
    
    local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local cr=cairo_create(cs)
    
    if tonumber(conky_parse("$updates"))<5 then return end
    for i in pairs(boxes_settings) do
        draw_box (cr,boxes_settings[i])
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)    
end

    
function draw_box(cr,t)

	if t.draw_me == true then t.draw_me = nil end
	if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end	

    local table_corners={"circle","curve","line"}

    local t_operators={
        clear   = CAIRO_OPERATOR_CLEAR,
        source  = CAIRO_OPERATOR_SOURCE,
        over    = CAIRO_OPERATOR_OVER,
        ["in"]      = CAIRO_OPERATOR_IN,
        out     = CAIRO_OPERATOR_OUT,
        atop    = CAIRO_OPERATOR_ATOP,
        dest    = CAIRO_OPERATOR_DEST,
        dest_over   = CAIRO_OPERATOR_DEST_OVER,
        dest_in = CAIRO_OPERATOR_DEST_IN,
        dest_out = CAIRO_OPERATOR_DEST_OUT,
        dest_atop = CAIRO_OPERATOR_DEST_ATOP,
        xor = CAIRO_OPERATOR_XOR,
        add = CAIRO_OPERATOR_ADD,
        saturate =  CAIRO_OPERATOR_SATURATE,
    }
        
    function rgba_to_r_g_b_a(tc)
        --tc={position,colour,alpha}
        local colour = tc[2]
        local alpha = tc[3]
        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end

    function table.copy(t)
      local t2 = {}
      for k,v in pairs(t) do
       t2[k] = {v[1],v[2]}
      end
      return t2
    end

    function draw_corner(num,t)
        local shape=t[1]
        local radius=t[2]
        local x,y = t[3],t[4]
        if shape=="line" then
            if num == 1 then cairo_line_to(cr,radius,0) 
                elseif num == 2 then cairo_line_to(cr,x,radius) 
                elseif num == 3 then cairo_line_to(cr,x-radius,y)
                elseif num == 4 then cairo_line_to(cr,0,y-radius)
            end
        end
        if shape=="circle" then
		    local PI = math.pi
           if num == 1 then cairo_arc(cr,radius,radius,radius,-PI,-PI/2)
                elseif num == 2 then cairo_arc(cr,x-radius,y+radius,radius,-PI/2,0)
                elseif num == 3 then cairo_arc(cr,x-radius,y-radius,radius,0,PI/2) 
                elseif num == 4 then cairo_arc(cr,radius,y-radius,radius,PI/2,-PI)
            end
        end
        if shape=="curve" then
            if num == 1 then cairo_curve_to(cr,0,radius ,0,0 ,radius,0) 
                elseif num == 2 then cairo_curve_to(cr,x-radius,0, x,y, x,radius)
                elseif num == 3 then cairo_curve_to(cr,x,y-radius, x,y, x-radius,y)
                elseif num == 4 then cairo_curve_to(cr,radius,y, x,y, 0,y-radius)
            end
        end        
    end   

    --check values and set default values
    if t.x == nil then t.x = 0 end
    if t.y == nil then t.y = 0 end
    if t.w == nil then t.w = conky_window.width end
    if t.h == nil then t.h = conky_window.height end
    if t.radius == nil then t.radius = 0 end
    if t.border == nil then t.border = 0 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,0.5}} end
    if t.linear_gradient ~= nil then 
        if #t.linear_gradient ~= 4 then
            t.linear_gradient = {t.x,t.y,t.width,t.height}
        end
    end 
    if t.angle==nil then t.angle = 0 end

	if t.skew_x == nil then t.skew_x=0  end
	if t.skew_y == nil then  t.skew_y=0 end
	if t.scale_x==nil then t.scale_x=1 end
	if t.scale_y==nil then t.scale_y=1 end	
	if t.rot_x == nil then t.rot_x=0  end
	if t.rot_y == nil then  t.rot_y=0 end
    
    if t.operator == nil then t.operator = "over" end
    if (t_operators[t.operator]) == nil then
        print ("wrong operator :",t.operator)
        t.operator = "over"
    end
    
    if t.radial_gradient ~= nil then 
        if #t.radial_gradient ~= 6 then
            t.radial_gradient = {t.x,t.y,0, t.x,t.y, t.width}
        end
    end 
    
    for i=1, #t.colour do    
        if #t.colour[i]~=3 then 
            print ("error in color table")
            t.colour[i]={1,0xFFFFFF,1} 
        end
    end

    if t.corners == nil then t.corners={ {"line",0} } end
    local t_corners = {}
    local t_corners = table.copy(t.corners)
    --don't use t_corners=t.corners otherwise t.corners is altered

    --complete the t_corners table if needed
    for i=#t_corners+1,4 do    
        t_corners[i]=t_corners[#t_corners]
        local flag=false
        for j,v in pairs(table_corners) do flag=flag or (t_corners[i][1]==v) end 
        if not flag then print ("error in corners table :",t_corners[i][1]);t_corners[i][1]="curve"  end
    end

    --this way :    
    --    t_corners[1][4]=x    
    --    t_corners[2][3]=y
    --doesn't work
    t_corners[1]={t_corners[1][1],t_corners[1][2],0,0}
    t_corners[2]={t_corners[2][1],t_corners[2][2],t.w,0}
    t_corners[3]={t_corners[3][1],t_corners[3][2],t.w,t.h}    
    t_corners[4]={t_corners[4][1],t_corners[4][2],0,t.h}        

    t.no_gradient = (t.linear_gradient == nil ) and (t.radial_gradient == nil )

    cairo_save(cr)
    cairo_translate(cr, t.x, t.y)
    if t.rot_x~=0 or t.rot_y~=0 or t.angle~=0 then
        cairo_translate(cr,t.rot_x,t.rot_y)
        cairo_rotate(cr,t.angle*math.pi/180)
        cairo_translate(cr,-t.rot_x,-t.rot_y)
    end
    if t.scale_x~=1 or t.scale_y~=1 or t.skew_x~=0 or t.skew_y~=0 then
	    local matrix0 = cairo_matrix_t:create()
	    tolua.takeownership(matrix0)
	    cairo_matrix_init (matrix0, t.scale_x,math.pi*t.skew_y/180	, math.pi*t.skew_x/180	,t.scale_y,0,0)
	    cairo_transform(cr,matrix0)    
    end
    
    local tc=t_corners
    cairo_move_to(cr,tc[1][2],0)
    cairo_line_to(cr,t.w-tc[2][2],0)
    draw_corner(2,tc[2])
    cairo_line_to(cr,t.w,t.h-tc[3][2])
    draw_corner(3,tc[3])
    cairo_line_to(cr,tc[4][2],t.h)
    draw_corner(4,tc[4])
    cairo_line_to(cr,0,tc[1][2])
    draw_corner(1,tc[1])
    
    if t.no_gradient then
        cairo_set_source_rgba(cr,rgba_to_r_g_b_a(t.colour[1]))
    else
        if t.linear_gradient ~= nil then
            pat = cairo_pattern_create_linear (t.linear_gradient[1],t.linear_gradient[2],t.linear_gradient[3],t.linear_gradient[4])
        elseif t.radial_gradient ~= nil then
            pat = cairo_pattern_create_radial (t.radial_gradient[1],t.radial_gradient[2],t.radial_gradient[3],
            	t.radial_gradient[4],t.radial_gradient[5],t.radial_gradient[6])
        end
        for i=1, #t.colour do
            cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgba_to_r_g_b_a(t.colour[i]))
        end
        cairo_set_source (cr, pat)
        cairo_pattern_destroy(pat)
    end 
     
    cairo_set_operator(cr,t_operators[t.operator]) 

    if t.border>0 then
        cairo_close_path(cr)
        if t.dash ~= nil then cairo_set_dash(cr, t.dash, 1, 0.0) end
        cairo_set_line_width(cr,t.border)
        cairo_stroke(cr)
    else
        cairo_fill(cr)
    end

    cairo_restore(cr)
end

image.lua

-- From Didier-T 
require 'cairo'
home = os.getenv ('HOME')
-- Display function
function conky_fDrawImage (path, x, y, w, h, arc)
   path = string.gsub (path, "~", home)
   path = string.gsub (path, "$HOME", home)
   local cs = cairo_xlib_surface_create (conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)

    local function fDrawImage (path, x, y, w, h, arc)
      x = x + (w / 2)
      y = y + (h / 2)
      local img = cairo_image_surface_create_from_png (path)
      local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)
      local cr = cairo_create (cs)
      cairo_translate (cr, x, y)
      if arc then
         cairo_rotate (cr, arc)
       end
      cairo_scale (cr, w / w_img, h / h_img)
      cairo_set_source_surface (cr, img, -w_img / 2, -h_img / 2)
      cairo_paint (cr)
      cairo_destroy (cr)
      cairo_surface_destroy (img)
    end
   fDrawImage (path, x, y, w, h, arc)
   cairo_surface_destroy (cs)
   return ""
 end 

text.lua

--[[TEXT WIDGET v1.3 by Wlourf 25/06/2010
This widget can drawn texts set in the "text_settings" table with some parameters
http://u-scripts.blogspot.com/2010/06/text-widget.html

The parameters (all optionals) are :
text        - text to display, default = "Conky is good for you"
			  use conky_parse to display conky value ie text=conly_parse("${cpu cpu1}")
            - coordinates below are relative to top left corner of the conky window
x           - x coordinate of first letter (bottom-left), default = center of conky window
y           - y coordinate of first letter (bottom-left), default = center of conky window
h_align		- horizontal alignement of text relative to point (x,y), default="l"
			  available values are "l": left, "c" : center, "r" : right
v_align		- vertical alignment of text relative to point (x,y), default="b"
			  available values "t" : top, "m" : middle, "b" : bottom
font_name   - name of font to use, default = Free Sans
font_size   - size of font to use, default = 14
italic      - display text in italic (true/false), default=false
oblique     - display text in oblique (true/false), default=false (I don' see the difference with italic!)
bold        - display text in bold (true/false), default=false
angle       - rotation of text in degrees, default = 0 (horizontal)
colour      - table of colours for text, default = plain white {{1,0XC8C8FF,0.5}}
			  this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = beginning of text, 1= end of text)
              C=hexadecimal colour 
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle of the text
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
			  and so on ...
orientation	- in case of gradient, "orientation" defines the starting point of the gradient, default="ww"
			  there are 8 available starting points : "nw","nn","ne","ee","se","ss","sw","ww"
			  (n for north, w for west ...)
			  theses 8 points are the 4 corners + the 4 middles of text's outline
			  so a gradient "nn" will go from "nn" to "ss" (top to bottom, parallele to text)
			  a gradient "nw" will go from "nw" to "se" (left-top corner to right-bottom corner)
radial		- define a radial gradient (if present at the same time as "orientation", "orientation" will have no effect)
			  this parameter is a table with 6 numbers : {xa,ya,ra,xb,yb,rb}
			  they define two circle for the gradient :
			  xa, ya, xb and yb are relative to x and y values above
reflection_alpha    - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                      other values = starting opacity
reflection_scale    - scale of the reflection (default = 1 = height of text)
reflection_length   - length of reflection, define where the opacity will be set to zero
					  calues from 0 to 1, default =1
skew_x,skew_y    - skew text around x or y axis
			  

Needs conky 1.8.0 

To call this script in the conkyrc, in before-TEXT section:
    lua_load /path/to/the/lua/script/text.lua
    lua_draw_hook_pre draw_text
 
v1.0	07/06/2010, Original release
v1.1	10/06/2010	Add "orientation" parameter
v1.2	15/06/2010  Add "h_align", "v_align" and "radial" parameters
v1.3	25/06/2010  Add "reflection_alpha", "reflection_length", "reflection_scale", 
                    "skew_x" et "skew_y"
-- 18/06/14/ram leak modified

]]
require 'cairo'


function conky_draw_text()
	--BEGIN OF PARAMETRES
	local ts=os.date("*t")
    local text_settings={
--date
--[[		{
			text=conky_parse"${time %a %d %b %Y}",
			font_name="Larabiefont",
			font_size=20,
			h_align="l",
			--v_align="m",
			bold=true,
			x=50,
			y=430,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},    
--time
		{
			text=conky_parse"${time %I %M}",
			font_name="hooge 05_53",
			font_size=50,
			h_align="l",
			--v_align="m",
			bold=true,
			x=70,
			y=70,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},--]]

                 {
			text=conky_parse"${execi 3600 lsb_release -d | cut -c14-38}               ${kernel}  -  ${machine}",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=360,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		}, 
              
                {
			text=conky_parse"${nodename}               System Updates:${execi 3600 aptitude search '~U' | wc -l | tail}               Uptime: ${uptime_short}              ",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=375,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		}, 

                {
			text=conky_parse"System:${fs_type}         Load: $loadavg      Processes: $processes ($running_processes running)",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=390,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},

                {
			text=conky_parse"Env.:${execp env | grep DESKTOP_SESSION= |cut -c 17-}                          Week: ${time %W}  (Day: ${time %j} / 365)",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=405,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		}, 

               {
			text=conky_parse"${execi 3600 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //' | tail -n1}       Cpu temp:${acpitemp}F",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=420,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},                                                                                                   
--cpu1
		{
			text=conky_parse"cpu ${cpu cpu0}%",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=435,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
--cputext

--cpu2
		{
			text=conky_parse"cpu1 ${cpu cpu1}%",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=96,
			y=435,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
--cpu2text

                {
			text=conky_parse"cpu2 ${cpu cpu2}%",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=191,
			y=435,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
--cpu2text	
--ram
		{
			text=conky_parse"cpu3 ${cpu cpu3}%",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=286,
			y=435,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
--memtext
                {
			text=conky_parse"cpu4 ${cpu cpu4}%",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=380,
			y=435,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
               {
			text=conky_parse"mem ${memperc}%",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=457,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
		
		{
			text=conky_parse"                 Root ${fs_used_perc /}%        Files ${fs_used_perc /media/manuel/Files}%         Win10 ${fs_used_perc /media/manuel/Windows 10}%       Mint ${fs_used_perc /media/manuel/L-Mint}%",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=457,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
	
		
		{
			text=conky_parse"HDD Temp: ${exec hddtemp /dev/sda -n --unit=F}°             Diskio_read: ${diskio_read /dev/sdb7}               Diskio_write: ${diskio_write /dev/sdb7}",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=480,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},

                {
			text=conky_parse"${if_gw}Network:Online              DGW:$gw_ip${endif}          Nameserver:$nameserver",

			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=495,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},

              {
			text=conky_parse"${if_existing /proc/net/route eth0}Interface:eth0                IP-Address:${addr eth0}${else}${endif}${if_existing /proc/net/route wlan0}Interface:wifi                IP-Address:${addr wlan0}${endif}",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=510,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
               {
			text=conky_parse"${if_existing /proc/net/route eth0}Speed:  Down:${downspeedf eth0}          TCP Connections ${tcp_portmon 1 65535 count}             Up:${upspeedf eth0}${else}${endif}${if_existing /proc/net/route wlan0}Speed:  Down:${downspeedf wlan0}        TCP Connections ${tcp_portmon 1 65535 count}                Up:${upspeedf wlan0}${else}${endif}",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=525,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},					 							
--ul

		{
			text=conky_parse"${if_existing /proc/net/route wlan0}     ESSID: ${wireless_essid wlan0}${endif}${if_existing /proc/net/route wlan0} Qualty: ${wireless_link_qual_perc wlan0}${endif}",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=120,
			y=550,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                						

                {
			text=conky_parse"Battery is ${battery BAT0}.                                  Ac: ${acpiacadapter AC0}",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=565,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"${battery_time BAT0} remaining.",
			font_name="caviar dreams",
			font_size=13,
			h_align="l",
			--v_align="m",
			bold=true,
			x=10,
			y=580,
			colour={{0.5,0xFFFFCC,0.6},{1,0XC8C8FF,0.5}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},--]]      

}
--------------END OF PARAMETERES----------------
  --------------END OF PARAMETERES----------------

    if conky_window == nil then return end
    if tonumber(conky_parse("$updates"))<3 then return end
       
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
		
    for i,v in pairs(text_settings) do    
        cr = cairo_create (cs)
        display_text(v)
        cairo_destroy(cr)
	    cr = nil
    end
    
    cairo_surface_destroy(cs)
		
end

function rgb_to_r_g_b2(tcolour)
    local colour,alpha=tcolour[2],tcolour[3]
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function display_text(t)
    if t.draw_me==true then t.draw_me = nil end
    if t.draw_me~=nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end
    local function set_pattern(te)
        --this function set the pattern
        if #t.colour==1 then 
            cairo_set_source_rgba(cr,rgb_to_r_g_b2(t.colour[1]))
        else
            local pat
            
            if t.radial==nil then
                local pts=linear_orientation(t,te)
                pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
            else
                pat = cairo_pattern_create_radial (t.radial[1],t.radial[2],t.radial[3],t.radial[4],t.radial[5],t.radial[6])
            end
        
            for i=1, #t.colour do
                cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgb_to_r_g_b2(t.colour[i]))
            end
            cairo_set_source (cr, pat)
            cairo_pattern_destroy(pat)
        end
    end
    
    --set default values if needed
    if t.text==nil then t.text="Conky is good for you !" end
    if t.x==nil then t.x = conky_window.width/2 end
    if t.y==nil then t.y = conky_window.height/2 end
    if t.colour==nil then t.colour={{1,0XC8C8FF,0.5}} end
    if t.font_name==nil then t.font_name="Arial" end
    if t.font_size==nil then t.font_size=13 end
    if t.angle==nil then t.angle=0 end
    if t.italic==nil then t.italic=false end
    if t.oblique==nil then t.oblique=false end
    if t.bold==nil then t.bold=false end
    if t.radial ~= nil then
        if #t.radial~=6 then 
            print ("error in radial table")
            t.radial=nil 
        end
    end
    if t.orientation==nil then t.orientation="ww" end
    if t.h_align==nil then t.h_align="l" end
    if t.v_align==nil then t.v_align="b" end    
    if t.reflection_alpha == nil then t.reflection_alpha=0 end
    if t.reflection_length == nil then t.reflection_length=1 end
    if t.reflection_scale == nil then t.reflection_scale=1 end
    if t.skew_x==nil then t.skew_x=0 end
    if t.skew_y==nil then t.skew_y=0 end    
    cairo_translate(cr,t.x,t.y)
    cairo_rotate(cr,t.angle*math.pi/180)
    cairo_save(cr)       
     
    local slant = CAIRO_FONT_SLANT_NORMAL
    local weight = CAIRO_FONT_WEIGHT_NORMAL
    if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
    if t.oblique then slant = CAIRO_FONT_SLANT_OBLIQUE end
    if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end
    
    cairo_select_font_face(cr, t.font_name, slant,weight)
 
    for i=1, #t.colour do    
        if #t.colour[i]~=3 then 
            print ("error in color table")
            t.colour[i]={1,0XC8C8FF,0.5} 
        end
    end

    local matrix0 = cairo_matrix_t:create()
    tolua.takeownership(matrix0) 
    local skew_x,skew_y=t.skew_x/t.font_size,t.skew_y/t.font_size
    cairo_matrix_init (matrix0, 1,skew_y,skew_x,1,0,0)
    cairo_transform(cr,matrix0)
    cairo_set_font_size(cr,t.font_size)
    local te=cairo_text_extents_t:create()
    tolua.takeownership(te) 
    local text=conky_parse(t.text)
    if text~="" then t.text = text end
    cairo_text_extents (cr,t.text,te)
    set_pattern(te)
            
    local mx,my=0,0
    
    if t.h_align=="c" then
        mx=-te.width/2-te.x_bearing
    elseif t.h_align=="r" then
        mx=-te.width
    end
    if t.v_align=="m" then
        my=-te.height/2-te.y_bearing
    elseif t.v_align=="t" then
        my=-te.y_bearing
    end
    cairo_move_to(cr,mx,my)
    
    cairo_show_text(cr,t.text)

     
        
        
   if t.reflection_alpha ~= 0 then 
        local matrix1 = cairo_matrix_t:create()
		tolua.takeownership(matrix1)         
        cairo_set_font_size(cr,t.font_size)

        cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(te.height+te.y_bearing+my)*(1+t.reflection_scale))
        cairo_set_font_size(cr,t.font_size)
        te=nil
        local te=cairo_text_extents_t:create()
        tolua.takeownership(te) 
        cairo_text_extents (cr,t.text,te)
        
                
        cairo_transform(cr,matrix1)
        set_pattern(te)
        cairo_move_to(cr,mx,my)
        cairo_show_text(cr,t.text)

        local pat2 = cairo_pattern_create_linear (0,
                                        (te.y_bearing+te.height+my),
                                        0,
                                        te.y_bearing+my)
        cairo_pattern_add_color_stop_rgba (pat2, 0,1,0,0,1-t.reflection_alpha)
        cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)    
        
        --line is not drawn but with a size of zero, the mask won't be nice
        cairo_set_line_width(cr,1)
        local dy=te.x_bearing
        if dy<0 then dy=dy*(-1) end
        cairo_rectangle(cr,mx+te.x_bearing,te.y_bearing+te.height+my,te.width+dy,-te.height*1.05)
        cairo_clip_preserve(cr)
        cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
        --cairo_stroke(cr)
        cairo_mask(cr,pat2)
        cairo_pattern_destroy(pat2)
        cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
        te=nil
    end
    
end


function linear_orientation(t,te)
    local w,h=te.width,te.height
    local xb,yb=te.x_bearing,te.y_bearing
    
    if t.h_align=="c" then
        xb=xb-w/2
    elseif t.h_align=="r" then
        xb=xb-w
       end    
    if t.v_align=="m" then
        yb=-h/2
    elseif t.v_align=="t" then
        yb=0
       end    
    local p=0
    if t.orientation=="nn" then
        p={xb+w/2,yb,xb+w/2,yb+h}
    elseif t.orientation=="ne" then
        p={xb+w,yb,xb,yb+h}
    elseif t.orientation=="ww" then
        p={xb,h/2,xb+w,h/2}
    elseif vorientation=="se" then
        p={xb+w,yb+h,xb,yb}
    elseif t.orientation=="ss" then
        p={xb+w/2,yb+h,xb+w/2,yb}
    elseif t.orientation=="ee" then
        p={xb+w,h/2,xb,h/2}        
    elseif t.orientation=="sw" then
        p={xb,yb+h,xb+w,yb}
    elseif t.orientation=="nw" then
        p={xb,yb,xb+w,yb+h}
    end
    return p
end

alert.sh

#!/bin/bash
# alert.sh
# copyright 2011 by Mobilediesel
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
 
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
 
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
if ping -c1 www.weather.gov 1>/dev/null
then
alert=$(~/conky-conf/weather/conky-rss.sh "https://alerts.weather.gov/cap/wwaatmget.php?x=VAC069&y=1"|sed -e 's/\(NOAA - National Weather Service\)//' -e 's/\(There are no active watches, warnings or advisories.*\|special weather statement.*\)//i' -e '/^$/d'|sort -u|fold -sw75|sed -e "s/\(.*Warning .*\)/\${color red}\1\${color 99ccff}/" -e "s/\(.*Watch .*\)/\${color red}\1\${color red}/")
fi
if [ -z "$alert" ]
then
echo "$alert"
else
alert=$(echo -en "\${color3}Weather Alert\${color 99ccff}\n$alert")
echo "$alert"
fi

conky-rss.sh

#!/bin/bash
# RSS Display Script by Bill Woodford (admin@sdesign.us) v1.0
############################################################
# This work is licensed under the Creative Commons         #
# Attribution-Share Alike 3.0 Unported License.            #
# To view a copy of this license, visit                    #
# http://creativecommons.org/licenses/by-sa/3.0/           #
# or send a letter to Creative Commons, 171 Second Street, #
# Suite 300, San Francisco, California, 94105, USA.        #
############################################################
#
#RSS Setup - Don't change unless you want these values hard-coded!
uri=$1                                                  #URI of RSS Feed
lines=$2                                                #Number of headlines
titlenum=$3                                             #Number of extra titles
#Script start
#Require a uri, as a minimum
if [[ "$uri" == "" ]]; then
        echo "No URI specified, cannot continue!" >&2
        echo "Please read script for more information" >&2
else
        #The actual work
        curl -A "mozilla/10.0" -s --connect-timeout 30 $uri |\
        sed 's/\(<\!\[CDATA\[\|\]\]\)//g'|\
        grep -io "<[rs:]\{0,4\}title>[^<>]*"|\
        sed -e 's/<[^>]*>//'|\
        head -n $[${lines:-25} + ${titlenum:-2}] |\
        tail -n $[${lines:-25}]
fi

launcher.lua

function conky_main()
    dofile ('/home/manuel/conky-conf/weather/image.lua')
    dofile ('/home/manuel/conky-conf/weather/text.lua')
    dofile ('/home/manuel/conky-conf/weather/equalizer.lua')
    dofile ('/home/manuel/conky-conf/weather/draw_bg.lua')
    
    conky_draw_text()
    conky_main_bars()
    conky_fDrawImage (path, x, y, w, h, arc)
    
    
    
end
                                                                                                                                                                                
                   

Offline

#888 2018-02-17 03:13:47

manuel-909
Member
Registered: 2017-10-09
Posts: 25

Re: Show us your conky

you can try this one...

2018-02-16-22-17-44_scrot.th.png

conky.config = {
--Use XFT?
	use_xft = true,
	font = 'Monofur:style=normal:pixelsize=14',
	xftalpha = 0.8,
	text_buffer_size = 2048,
	max_text_width = 0,
	override_utf8_locale = true,
	uppercase = false,
	no_buffers = true,
	short_units = true,
	format_human_readable = true,

-- Like it says, ot pads the decimals on % values
-- doesn't seem to work since v1.7.1
	pad_percents = 2,

-- Update interval in seconds
	update_interval = 1,

-- This is the number of times Conky will update before quitting.
-- Set to zero to run forever.
	total_run_times = 0,

-- Create own window instead of using desktop (required in nautilus)
	own_window = true,
	own_window_transparent = true,
	own_window_type = 'normal',
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
 own_window_argb_visual = true,
 own_window_argb_value = 255,
	background = true,
	use_spacer = 'none',

-- Use double buffering (reduces flicker, may not work for everyone)
	double_buffer = true,

-- Minimum size of text area -adjust if you would like to user smaller fonts etc.
	minimum_width = 290, minimum_height = 500,
	maximum_width = 290,
	--max_specials = '1024',
	max_user_text = 16384,
--default_bar_size 215 5

-- Desired output unit of all objects displaying a temperature. Parameters are
-- either "fahrenheit" or "celsius". The default unit is degree Celsius.
	temperature_unit = 'fahrenheit',

-- Draw shades?
	draw_shades = false,
	default_shade_color = '#000000',

-- Draw outlines?
	draw_outline = false,
	default_outline_color = '#000000',

--##  Color Settings
	default_color = '#b2b2b2',--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 ##FF0000 #255   0   0	Red

-- Draw borders around text
	draw_borders = false,

-- Stippled borders?
	stippled_borders = 0,

-- border margins
	border_inner_margin = 5,
	border_outer_margin = 0,

-- border width
	border_width = 1,

-- graph borders
	draw_graph_borders = true,--no
--default_graph_size 15 40
--show_graph_range no
--show_graph_scale no

-- Text alignment, other possible values are commented
	alignment = 'top_right',
--alignment top_right
--alignment bottom_left
--alignment bottom_right

-- Gap between borders of screen and text
-- same thing as passing -x at command line
	gap_x = 10,
	gap_y = 10,

--Default weather to Fahrenheit, please change the below if you prefer Celsius.
	temperature_unit = 'fahrenheit',

-- -- Lua Load -- #
lua_load = '~/.draw-bg.lua',
-- ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.2}
--lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.2
lua_draw_hook_post = 'draw_bg 20 0 0 0 0 0x000000 0.2',

-- -- Album art fix -- #
	imlib_cache_size = 0,

};

conky.text = [[
${texeci 500 bash $HOME/1_accuweather/1_accuweather -f2015}
${color7}${alignc}${font sesame-shadow:pixelsize=10}${execpi 600 sed -n '4p' $HOME/1_accuweather/curr_cond|cut -c1-20}
${image $HOME/1_accuweather/forecast_2015/forecast_0.png -p 65,30 -s 157x90}\
${color2}${font alba:pixelsize=35}${execi 300 sed -n '2p' ~/1_accuweather/curr_cond}\
${color3}${alignr}±${execi 300 sed -n '3p' ~/1_accuweather/curr_cond}${font}

${color2}  UVI: ${color3}${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}/11\
 ${color3}${alignr}${execi 300 sed -n '8p' ~/1_accuweather/curr_cond}${color2}:Bar
${image $HOME/1_accuweather/forecast_2015/wind_0.png -p 105,110 -s 90x90}
${color2}Wind: ${color3}${execi 300 sed -n '5p' ~/1_accuweather/curr_cond} ${execi 300 sed -n '6p' ~/1_accuweather/curr_cond}\
 ${color3}${alignr}${execi 300 sed -n '7p' ~/1_accuweather/curr_cond} ${color2}:Hum

${color2} Cld: ${color3}${execi 300 sed -n '10p' ~/1_accuweather/curr_cond}\
${color3} ${alignr}${execi 300 sed -n '13p' ~/1_accuweather/curr_cond} ${color2}:Vis

${color2}  Dp: ${color3}${execpi 300 sed -n '12p' $HOME/1_accuweather/curr_cond}° \
${color3}${alignr}${execpi 300 sed -n '8p' $HOME/1_accuweather/curr_cond} ${color2}:Pres
${texeci 500 bash $HOME/4_Moon/moon_MoonGiant}
${image ~/4_Moon/0.png -p 105,220 -s 60x60}
${voffset -20}${alignc}${color2}${swapbar 0,50} ${color7}Current Moon & Forecast ${color2}${swapbar 0,50}
${color3}${execi 3600 echo `date --date="0 day" | awk '{print $1" "$3" "$2}'`}\
${alignr 20}${execi 3600 echo `date --date="1 day" | awk '{print $1" "$3" "$2}'`} ${color}
${image $HOME/1_accuweather/forecast_2015/forecast_1.png -p 10,235 -s 50x30}\
${image $HOME/1_accuweather/forecast_2015/forecast_2.png -p 195,235 -s 50x30}\
${color2}${if_match "${execpi 300 sed -n '1p' /home/manuel/1_accuweather/first_days}" == "Lo"}\
${else}${color3}${execpi 300 sed -n '3p' /home/manuel/1_accuweather/first_days}${endif}\
${color3}${goto 190}${execi 300 sed -n '8p' ~/1_accuweather/first_days}
${color2}${goto 65}${if_match "${execpi 300 sed -n '3p' /home/manuel/1_accuweather/first_days}" == "Lo"}\
${color2}${execpi 50 sed -n '4p' /home/manuel/1_accuweather/first_days}\
${goto 250}${execi 300 sed -n '9p' ~/1_accuweather/first_days}
${color7}${font Arial:size=8}${execpi 300 sed -n '5p' $HOME/1_accuweather/first_days|cut -c1-17}${goto 190}${execpi 300 sed -n '10p' $HOME/1_accuweather/first_days|cut -c1-17}
${execpi 300 sed -n '5p' $HOME/1_accuweather/first_days|cut -c18-34}${goto 190}${execpi 300 sed -n '10p' $HOME/1_accuweather/first_days|cut -c18-34}${font}
${color3}${voffset}${execi 3600 echo `date --date="2 day" | awk '{print $1" "$3" "$2}'`}\
${color3}${alignr 30}${execi 3600 echo `date --date="3 day" | awk '{print $1" "$3" "$2}'`}
${image $HOME/1_accuweather/forecast_2015/forecast_3.png -p 10,310 -s 50x30}\
${image $HOME/1_accuweather/forecast_2015/forecast_4.png -p 195,310 -s 50x30}\
${color3}${execi 300 sed -n '13p' ~/1_accuweather/first_days}\
${color3}${alignr 95}${execi 300 sed -n '18p' ~/1_accuweather/first_days}
${color2}${goto 65}${execi 300 sed -n '14p' ~/1_accuweather/first_days}\
${color2}${alignr 30}${execi 300 sed -n '19p' ~/1_accuweather/first_days}
${color7}${font Arial:size=8}${voffset}${execpi 600 sed -n '15p' $HOME/1_accuweather/first_days|cut -c1-17}${goto 190}${execpi 600 sed -n '20p' $HOME/1_accuweather/first_days|cut -c1-20}
${execpi 300 sed -n '15p' $HOME/1_accuweather/first_days|cut -c18-34}${goto 190}${execpi 300 sed -n '20p' $HOME/1_accuweather/first_days|cut -c21-40}${font}
${font Arial:size=10}${execpi 300 ~/conky-conf/met5/alert.sh}${color3}
${voffset -10}${font DejaVuSansMono:size=9}${execi 300 curl wttr.in/22655?u0pqT}
${voffset -70}
]];

Last edited by manuel-909 (2018-02-17 03:19:00)

Offline

#889 2018-02-20 14:40:36

Indian
Member
Registered: 2018-02-05
Posts: 21

Re: Show us your conky

>> manuel-909
You forgot to show us: $HOME/1_accuweather/1_accuweather

Offline

#890 2018-02-20 18:37:18

unklar
Member
Registered: 2015-10-31
Posts: 602

Re: Show us your conky

Indian wrote:

>> manuel-909
You forgot to show us: $HOME/1_accuweather/1_accuweather

^ https://forums.bunsenlabs.org/viewtopic … 1545#p1545

Offline

#891 2018-02-20 20:55:11

Indian
Member
Registered: 2018-02-05
Posts: 21

Re: Show us your conky

unklar wrote:

Indian wrote:

    >> manuel-909
    You forgot to show us: $HOME/1_accuweather/1_accuweather

^ https://forums.bunsenlabs.org/viewtopic … 1545#p1545

Thanks

Offline

#892 Yesterday 07:03:22

manuel-909
Member
Registered: 2017-10-09
Posts: 25

Re: Show us your conky

weather update:
2018-02-21-01-43-33_scrot.th.png

conky.config = {
--Use XFT?
	use_xft = true,
	--font = 'Monofur:style=normal:pixelsize=13',
	--font = 'Monospace:style=normal:pixelsize=13',
	--font = 'zekton:style=normal:pixelsize=13',
	--font = 'Anonymous Pro:style=normal:pixelsize=13',
	font = 'Terminus:pixelsize=14',
	xftalpha = 0.8,
	text_buffer_size = 2048,
	max_text_width = 0,
	override_utf8_locale = true,
	uppercase = false,
	no_buffers = true,
	short_units = true,
	format_human_readable = true,

-- Like it says, ot pads the decimals on % values
-- doesn't seem to work since v1.7.1
	pad_percents = 2,

-- Update interval in seconds
	update_interval = 1,

-- This is the number of times Conky will update before quitting.
-- Set to zero to run forever.
	total_run_times = 0,

-- Create own window instead of using desktop (required in nautilus)
	own_window = true,
	own_window_transparent = true,
	own_window_type = 'desktop',
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
	own_window_argb_visual = true,-- Options: yes or no
	own_window_argb_value = 255,
	background = true,
	use_spacer = 'none',

-- Use double buffering (reduces flicker, may not work for everyone)
	double_buffer = true,

-- Minimum size of text area -adjust if you would like to user smaller fonts etc.
	minimum_width = 415, minimum_height = 190,
	--maximum_width = 270,
	--max_specials = '1024',
	max_user_text = 16384,
--default_bar_size 215 5

-- Desired output unit of all objects displaying a temperature. Parameters are
-- either "fahrenheit" or "celsius". The default unit is degree Celsius.
	temperature_unit = 'fahrenheit',

-- Draw shades?
	draw_shades = false,
	default_shade_color = '#000000',

-- Draw outlines?
	draw_outline = false,
	default_outline_color = '#000000',

--##  Color Settings
	default_color = 'b2b2b2', 
color0 = '555555',         
color1 = '483D8B',         -- Dark Slate Blue
color2 = 'B8860B',         -- Dark goldenrod
color3 = '4682B4',         -- Steelblue
color4 = '8B0000',         -- Dark red
color5 = '008080',         -- Teal
color6 = '99ccff',         -- Gray20
color7 = 'C8C8FF',         -- (COOL)
color8 = 'FFFFCC',         -- (WARM)
color9 = 'FCCCCC',         -- (HOT) 

-- Draw borders around text
	draw_borders = false,

-- Stippled borders?
	stippled_borders = 0,

-- border margins
	border_inner_margin = 20,
	border_outer_margin = 0,

-- border width
	border_width = 1,

-- graph borders
	draw_graph_borders = false,--no
	--default_graph_width = 15, default_graph_height = 40,
	show_graph_range = false,
	show_graph_scale = false,

-- Text alignment, other possible values are commented
	alignment = 'top_left',
	--alignment = 'top_right',
	--alignment = 'bottom_left',
	--alignment = 'bottom_right',
	--alignment = 'bottom_middle',

-- Gap between borders of screen and text
-- same thing as passing -x at command line
	gap_x = 25,
	gap_y = 15,

-- -- Album art fix -- #
	imlib_cache_size = 0,

--##############TEMPLATES##############################
template0 = [[
${font Neuropolitical:bold:size=8}${color1}\1 ${font}${hr 2}${font}${color}]],
template1 = [[
${color}$\1]],
template2 = [[
${color}\1${color} \2]],

      
--# │ ─ ┌ ┬ ┐ └ ┴ ┘ ├ ┼ ┤
--# ║ ═ ╔ ╦ ╗ ╚ ╩ ╝ ╠ ╬ ╣

--# ↑ ↓ → ← ↔ ► ◄ ▲ ▼ « »
--# ░  ▒  ▓ ☺ ☻ ♥ ♦ ♣ ♠
--# • ◘ ○ ◙ ♂ ♀ ♪ ♫ ☼
--# ¼ ½ ¾ ® ©


lua_load = 'settings.lua ./scripts/loadall.lua' ,
	lua_draw_hook_post = 'main' ,
    lua_startup_hook = 'vars',
};
conky.text = [[
${texeci 500 bash $HOME/4_Moon/moon_MoonGiant}${lua fDrawImage ~/4_Moon/0.png 380 20 50 50}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_0.png 200 90 90 55}
${lua fDrawImage ~/1_accuweather/forecast_2015/wind_0.png 375 60 90 90}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_1.png 290 25 70 45}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_2.png  27 165 70 45}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_3.png  92 165 70 45}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_4.png  157 165 70 45}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_5.png  220 165 70 45}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_6.png  283 165 70 45}
${lua fDrawImage ~/1_accuweather/forecast_2015/forecast_7.png  346 165 70 45}
]];

image.lua

-- From Didier-T 
require 'cairo'
home = os.getenv ('HOME')
-- Display function
function conky_fDrawImage (path, x, y, w, h, arc)
   path = string.gsub (path, "~", home)
   path = string.gsub (path, "$HOME", home)
   local cs = cairo_xlib_surface_create (conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)

    local function fDrawImage (path, x, y, w, h, arc)
      x = x + (w / 2)
      y = y + (h / 2)
      local img = cairo_image_surface_create_from_png (path)
      local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)
      local cr = cairo_create (cs)
      cairo_translate (cr, x, y)
      if arc then
         cairo_rotate (cr, arc)
       end
      cairo_scale (cr, w / w_img, h / h_img)
      cairo_set_source_surface (cr, img, -w_img / 2, -h_img / 2)
      cairo_paint (cr)
      cairo_destroy (cr)
      cairo_surface_destroy (img)
    end
   fDrawImage (path, x, y, w, h, arc)
   cairo_surface_destroy (cs)
   return ""
 end 

loadall.lua

-- Set the path to the scripts folder
package.path = "./scripts/?.lua"
-- ###################################


require 'lua0-box'
--require 'lua1-graphs'
require 'text'
require 'image'

function conky_main()
     conky_main_box()
     --conky_main_graph()
     conky_draw_text()
     conky_fDrawImage (path, x, y, w, h, arc)
end

--[[
#########################
# conky-system-lua-V3   #
# by +WillemO @wim66    #
# v1.5 23-dec-17        #
#                       #
#########################
]]

lua0-box.lua

--[[
#########################
# conky-system-lua-V3   #
# by +WillemO @wim66    #
# v1.5 23-dec-17        #
#                       #
#########################
]]

--[[BOX WIDGET v1.1 by Wlourf 27/01/2011
This widget can drawn some boxes, even circles in your conky window
http://u-scripts.blogspot.com/2011/01/box-widget.html)

Inspired by Background by londonali1010 (2009), thanks ;-) 

The parameters (all optionals) are :
x           - x coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
y           - y coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
w           - width of the box, default = width of the conky window
h           - height of the box, default = height of the conky window
corners     - corners is a table for the four corners in this order : top-left, top-right,bottom-right, bottom-left
              each corner is defined in a table with a shape and a radius, available shapes are : "curve","circle","line"
              example for the same shapes for all corners:
              { {"circle",10} }
              example for first corner different from the three others
              { {"circle",10}, {"circle",5}  }              
              example for top corners differents from bottom corners
              { {"circle",10}, {"circle",10}, {"line",0}  }   
              default = { {"line",0} } i.e=no corner
operator    - set the compositing operator (needs in the conkyrc : own_window_argb_visual yes)                          
              see http://cairographics.org/operators/
              available operators are :
              "clear","source","over","in","out","atop","dest","dest_over","dest_in","dest_out","dest_atop","xor","add","saturate"
              default = "over"
border      - if border>0, the script draws only the border, like a frame, default=0
dash        - if border>0 and dash>0, the border is draw with dashes, default=0
skew_x      - skew box around x axis, default = 0
skew_y      - skew box around y axis, default = 0
scale_x     - rescale the x axis, default=1, useful for drawing elipses ...
scale_y     - rescale the x axis, default=1
angle	    - angle of rotation of the box in degrees, default = 0
              i.e. a horizontal graph
rot_x       - x point of rotation's axis, default = 0,
              relative to top-left corner of the box, (not the conky window)
rot_y       - y point of rotation's axis, default = 0              
              relative to top-left corner of the box, (not the conky window)
draw_me     - if set to false, box is not drawn (default = true or 1)
              it can be used with a conky string, if the string returns 1, the box is drawn :
              example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",              
              
linear_gradient - table with the coordinates of two points to define a linear gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,x2,y2}
radial_gradient - table with the coordinates of two circle to define a radial gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,r1,x2,y2,r2} (r=radius)
colour      - table of colours, default = plain white {{1,0xFFFFFF,0.5}}
              this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = start of the gradient, 1= end of the gradient)
              C=hexadecimal colour 
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}        {x=80,y=150,w=20,h=20,
        radial_gradient={20,20,0,20,20,20},
        colour={{0.5,0xFFFFFF,1},{1,0x000000,0}},
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
              and so on ...



To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
    lua_load ~/scripts/box.lua
    lua_draw_hook_pre main_box
    
And leave one line blank or not after TEXT

Changelog:
+ v1.0 -- Original release (19.12.2010)
+ v1.1 -- Adding parameters: operator, dash, angle, skew_x, skew_y, draw_me
          corners are described in a table

--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation version 3 (GPLv3)
--     
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--     
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
--      MA 02110-1301, USA.		


]]

  
require 'cairo'
    
function conky_main_box()

    if conky_window==nil then return end
    
	---------------------- PARAMETERS BEGIN HERE
                                                          
    local boxes_settings={

        {
	x=10,y=15,w=438,h=210,
	colour= { {1,0x000000,0.3} }, 
        corners={ {"circle",5},},
	},

	{
	x=4,y=10,w=450,h=220,
	colour=color_x, linear_gradient={128,50,128,600}, 
        corners={ {"circle",5},}, border=4 
	},

--[[	{
	x=8,y=8,w=458,h=341,
	colour= { {0,0xFFFFFF,0.025}, {0.5,0xC2C2C2,0.25}, {1,0xFFFFFF,0.025}}, linear_gradient={0,0,0,642},
	},--]]

}

    ---------------------------- PARAMETERS END HERE
    
    local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local cr=cairo_create(cs)
    
    if tonumber(conky_parse("$updates"))<5 then return end
    for i in pairs(boxes_settings) do
        draw_box (cr,boxes_settings[i])
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)    
end

    
function draw_box(cr,t)

	if t.draw_me == true then t.draw_me = nil end
	if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end	

    local table_corners={"circle","curve","line"}

    local t_operators={
        clear   = CAIRO_OPERATOR_CLEAR,
        source  = CAIRO_OPERATOR_SOURCE,
        over    = CAIRO_OPERATOR_OVER,
        ["in"]      = CAIRO_OPERATOR_IN,
        out     = CAIRO_OPERATOR_OUT,
        atop    = CAIRO_OPERATOR_ATOP,
        dest    = CAIRO_OPERATOR_DEST,
        dest_over   = CAIRO_OPERATOR_DEST_OVER,
        dest_in = CAIRO_OPERATOR_DEST_IN,
        dest_out = CAIRO_OPERATOR_DEST_OUT,
        dest_atop = CAIRO_OPERATOR_DEST_ATOP,
        xor = CAIRO_OPERATOR_XOR,
        add = CAIRO_OPERATOR_ADD,
        saturate =  CAIRO_OPERATOR_SATURATE,
    }
        
    function rgba_to_r_g_b_a(tc)
        --tc={position,colour,alpha}
        local colour = tc[2]
        local alpha = tc[3]
        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end

    function table.copy(t)
      local t2 = {}
      for k,v in pairs(t) do
       t2[k] = {v[1],v[2]}
      end
      return t2
    end

    function draw_corner(num,t)
        local shape=t[1]
        local radius=t[2]
        local x,y = t[3],t[4]
        if shape=="line" then
            if num == 1 then cairo_line_to(cr,radius,0) 
                elseif num == 2 then cairo_line_to(cr,x,radius) 
                elseif num == 3 then cairo_line_to(cr,x-radius,y)
                elseif num == 4 then cairo_line_to(cr,0,y-radius)
            end
        end
        if shape=="circle" then
		    local PI = math.pi
           if num == 1 then cairo_arc(cr,radius,radius,radius,-PI,-PI/2)
                elseif num == 2 then cairo_arc(cr,x-radius,y+radius,radius,-PI/2,0)
                elseif num == 3 then cairo_arc(cr,x-radius,y-radius,radius,0,PI/2) 
                elseif num == 4 then cairo_arc(cr,radius,y-radius,radius,PI/2,-PI)
            end
        end
        if shape=="curve" then
            if num == 1 then cairo_curve_to(cr,0,radius ,0,0 ,radius,0) 
                elseif num == 2 then cairo_curve_to(cr,x-radius,0, x,y, x,radius)
                elseif num == 3 then cairo_curve_to(cr,x,y-radius, x,y, x-radius,y)
                elseif num == 4 then cairo_curve_to(cr,radius,y, x,y, 0,y-radius)
            end
        end        
    end   

    --check values and set default values
    if border_COLOR == "default" then color_x = { {1,0x34495E,1} } end
    if border_COLOR == "green" then color_x = { {0,0x003E00,1}, {0.5,0x03F404,1}, {1,0x003E00,1} } end
    if border_COLOR == "blue" then color_x =  { {0,0x0032FF,1}, {0.5,0x00CCFF,1}, {1,0x0032FF,1} } end
    if border_COLOR == "orange" then color_x =  { {0,0xE05700,1}, {0.5,0xFFD145,1}, {1,0xE05700,1} } end
    if border_COLOR == "black" then color_x =  { {0.15,0x101010,1}, {0.5,0xA1A1A1,1}, {0.85,0x101010,1} } end
                                                                                       
    if t.x == nil then t.x = 0 end
    if t.y == nil then t.y = 0 end
    if t.w == nil then t.w = conky_window.width end
    if t.h == nil then t.h = conky_window.height end
    if t.radius == nil then t.radius = 0 end
    if t.border == nil then t.border = 0 end
    if t.colour==nil then t.colour={{1,0x34495E,1}} end
    if t.linear_gradient ~= nil then 
        if #t.linear_gradient ~= 4 then
            t.linear_gradient = {t.x,t.y,t.width,t.height}
        end
    end 
    if t.angle==nil then t.angle = 0 end

	if t.skew_x == nil then t.skew_x=0  end
	if t.skew_y == nil then  t.skew_y=0 end
	if t.scale_x==nil then t.scale_x=1 end
	if t.scale_y==nil then t.scale_y=1 end	
	if t.rot_x == nil then t.rot_x=0  end
	if t.rot_y == nil then  t.rot_y=0 end
    
    if t.operator == nil then t.operator = "over" end
    if (t_operators[t.operator]) == nil then
        print ("wrong operator :",t.operator)
        t.operator = "over"
    end
    
    if t.radial_gradient ~= nil then 
        if #t.radial_gradient ~= 6 then
            t.radial_gradient = {t.x,t.y,0, t.x,t.y, t.width}
        end
    end 
    
    for i=1, #t.colour do    
        if #t.colour[i]~=3 then 
            print ("error in color table")
            t.colour[i]={1,0xFFFFFF,1} 
        end
    end

    if t.corners == nil then t.corners={ {"line",0} } end
    local t_corners = {}
    local t_corners = table.copy(t.corners)
    --don't use t_corners=t.corners otherwise t.corners is altered

    --complete the t_corners table if needed
    for i=#t_corners+1,4 do    
        t_corners[i]=t_corners[#t_corners]
        local flag=false
        for j,v in pairs(table_corners) do flag=flag or (t_corners[i][1]==v) end 
        if not flag then print ("error in corners table :",t_corners[i][1]);t_corners[i][1]="curve"  end
    end

    --this way :    
    --    t_corners[1][4]=x    
    --    t_corners[2][3]=y
    --doesn't work
    t_corners[1]={t_corners[1][1],t_corners[1][2],0,0}
    t_corners[2]={t_corners[2][1],t_corners[2][2],t.w,0}
    t_corners[3]={t_corners[3][1],t_corners[3][2],t.w,t.h}    
    t_corners[4]={t_corners[4][1],t_corners[4][2],0,t.h}        

    t.no_gradient = (t.linear_gradient == nil ) and (t.radial_gradient == nil )

    cairo_save(cr)
    cairo_translate(cr, t.x, t.y)
    if t.rot_x~=0 or t.rot_y~=0 or t.angle~=0 then
        cairo_translate(cr,t.rot_x,t.rot_y)
        cairo_rotate(cr,t.angle*math.pi/180)
        cairo_translate(cr,-t.rot_x,-t.rot_y)
    end
    if t.scale_x~=1 or t.scale_y~=1 or t.skew_x~=0 or t.skew_y~=0 then
	    local matrix0 = cairo_matrix_t:create()
	    tolua.takeownership(matrix0)
	    cairo_matrix_init (matrix0, t.scale_x,math.pi*t.skew_y/180	, math.pi*t.skew_x/180	,t.scale_y,0,0)
	    cairo_transform(cr,matrix0)    
    end
    
    local tc=t_corners
    cairo_move_to(cr,tc[1][2],0)
    cairo_line_to(cr,t.w-tc[2][2],0)
    draw_corner(2,tc[2])
    cairo_line_to(cr,t.w,t.h-tc[3][2])
    draw_corner(3,tc[3])
    cairo_line_to(cr,tc[4][2],t.h)
    draw_corner(4,tc[4])
    cairo_line_to(cr,0,tc[1][2])
    draw_corner(1,tc[1])
    
    if t.no_gradient then
        cairo_set_source_rgba(cr,rgba_to_r_g_b_a(t.colour[1]))
    else
        if t.linear_gradient ~= nil then
            pat = cairo_pattern_create_linear (t.linear_gradient[1],t.linear_gradient[2],t.linear_gradient[3],t.linear_gradient[4])
        elseif t.radial_gradient ~= nil then
            pat = cairo_pattern_create_radial (t.radial_gradient[1],t.radial_gradient[2],t.radial_gradient[3],
            	t.radial_gradient[4],t.radial_gradient[5],t.radial_gradient[6])
        end
        for i=1, #t.colour do
            cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgba_to_r_g_b_a(t.colour[i]))
        end
        cairo_set_source (cr, pat)
        cairo_pattern_destroy(pat)
    end 
     
    cairo_set_operator(cr,t_operators[t.operator]) 

    if t.border>0 then
        cairo_close_path(cr)
        if t.dash ~= nil then cairo_set_dash(cr, t.dash, 1, 0.0) end
        cairo_set_line_width(cr,t.border)
        cairo_stroke(cr)
    else
        cairo_fill(cr)
    end

    cairo_restore(cr)
end

text.lua

--[[TEXT WIDGET v1.3 by Wlourf 25/06/2010
This widget can drawn texts set in the "text_settings" table with some parameters
http://u-scripts.blogspot.com/2010/06/text-widget.html

The parameters (all optionals) are :
text        - text to display, default = "Conky is good for you"
			  use conky_parse to display conky value ie text=conly_parse("${cpu cpu1}")
            - coordinates below are relative to top left corner of the conky window
x           - x coordinate of first letter (bottom-left), default = center of conky window
y           - y coordinate of first letter (bottom-left), default = center of conky window
h_align		- horizontal alignement of text relative to point (x,y), default="l"
			  available values are "l": left, "c" : center, "r" : right
v_align		- vertical alignment of text relative to point (x,y), default="b"
			  available values "t" : top, "m" : middle, "b" : bottom
font_name   - name of font to use, default = Free Sans
font_size   - size of font to use, default = 14
italic      - display text in italic (true/false), default=false
oblique     - display text in oblique (true/false), default=false (I don' see the difference with italic!)
bold        - display text in bold (true/false), default=false
angle       - rotation of text in degrees, default = 0 (horizontal)
colour      - table of colours for text, default = plain white {{1,0xFFFFFF,1}}
			  this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = beginning of text, 1= end of text)
              C=hexadecimal colour 
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle of the text
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
			  and so on ...
orientation	- in case of gradient, "orientation" defines the starting point of the gradient, default="ww"
			  there are 8 available starting points : "nw","nn","ne","ee","se","ss","sw","ww"
			  (n for north, w for west ...)
			  theses 8 points are the 4 corners + the 4 middles of text's outline
			  so a gradient "nn" will go from "nn" to "ss" (top to bottom, parallele to text)
			  a gradient "nw" will go from "nw" to "se" (left-top corner to right-bottom corner)
radial		- define a radial gradient (if present at the same time as "orientation", "orientation" will have no effect)
			  this parameter is a table with 6 numbers : {xa,ya,ra,xb,yb,rb}
			  they define two circle for the gradient :
			  xa, ya, xb and yb are relative to x and y values above
reflection_alpha    - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                      other values = starting opacity
reflection_scale    - scale of the reflection (default = 1 = height of text)
reflection_length   - length of reflection, define where the opacity will be set to zero
					  calues from 0 to 1, default =1
skew_x,skew_y    - skew text around x or y axis
			  

Needs conky 1.8.0 

To call this script in the conkyrc, in before-TEXT section:
    lua_load /path/to/the/lua/script/text.lua
    lua_draw_hook_pre draw_text
 
v1.0	07/06/2010, Original release
v1.1	10/06/2010	Add "orientation" parameter
v1.2	15/06/2010  Add "h_align", "v_align" and "radial" parameters
v1.3	25/06/2010  Add "reflection_alpha", "reflection_length", "reflection_scale", 
                    "skew_x" et "skew_y"
-- 18/06/14/ram leak modified

]]
require 'cairo'


function conky_draw_text()
	--BEGIN OF PARAMETRES
	local ts=os.date("*t")
    local text_settings={
--date
		{
			text=conky_parse"${texeci 500 bash $HOME/1_accuweather/1_accuweather -f2015}",
			font_name="caviar dreams",
			font_size=10,
			h_align="l",
			--v_align="m",
			bold=true,
			x=30,
			y=45,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},    
--time
		{
			text=conky_parse"${execpi 600 sed -n '1p' $HOME/1_accuweather/first_days}  ${execpi 600 sed -n '5p' $HOME/1_accuweather/first_days|cut -c1-20}${execpi 600 sed -n '5p' $HOME/1_accuweather/first_days|cut -c21-40}  ${execpi 600 sed -n '3p' $HOME/1_accuweather/first_days}°/${execpi 600 sed -n '4p' $HOME/1_accuweather/first_days}°",
			font_name="caviar dreams",
			font_size=12,
			h_align="l",
			--v_align="m",
			bold=true,
			x=20,
			y=40,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}},
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
--cpu1
		{
			text=conky_parse"${time %I}",

			font_name="7LED",
			font_size=54,
			h_align="l",
			--v_align="m",
			bold=true,
			x=20,
			y=100,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"${time %M}",

			font_name="7LED",
			font_size=54,
			h_align="l",
			--v_align="m",
			bold=true,
			x=95,
			y=100,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"${time %S}",

			font_name="7LED",
			font_size=25,
			h_align="l",
			--v_align="m",
			bold=true,
			x=170,
			y=101,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},

		{
			text=conky_parse"${time %A, %d %B %Y}",
			font_name="caviar dreams",
			font_size=12,
			h_align="l",
			--v_align="m",
			bold=true,
			x=225,
			y=85,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                		
		{
			text=conky_parse"Wind D : ${execi 90 sed -n '5p' $HOME/1_accuweather/curr_cond} ",
			font_name="caviar dreams",
			font_size=11,
			h_align="l",
			--v_align="m",
			bold=true,
			x=300,
			y=100,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"Wind S : ${execi 90 sed -n '6p' $HOME/1_accuweather/curr_cond} ",
			font_name="caviar dreams",
			font_size=11,
			h_align="l",
			--v_align="m",
			bold=true,
			x=300,
			y=115,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"Pressure : ${execi 90 sed -n '8p' $HOME/1_accuweather/curr_cond} ",
			font_name="caviar dreams",
			font_size=11,
			h_align="l",
			--v_align="m",
			bold=true,
			x=300,
			y=130,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"Index UV: ${execi 90 sed -n '9p' $HOME/1_accuweather/curr_cond}    Dp: ${execpi 300 sed -n '12p' $HOME/1_accuweather/curr_cond}° ",
			font_name="caviar dreams",
			font_size=11,
			h_align="l",
			--v_align="m",
			bold=true,
			x=300,
			y=145,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"${execi 90 sed -n '4p' $HOME/1_accuweather/curr_cond}",
			font_name="caviar dreams",
			font_size=15,
			h_align="l",
			--v_align="m",
			bold=true,
			x=20,
			y=125,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"Temp.: ${execi 90 sed -n '2p' $HOME/1_accuweather/curr_cond} °F   Feels.: ${execi 90 sed -n '3p' $HOME/1_accuweather/curr_cond} °F",
			font_name="caviar dreams",
			font_size=12,
			h_align="l",
			--v_align="m",
			bold=true,
			x=20,
			y=140,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"      ${execi 90 sed -n '9p' $HOME/1_accuweather/first_days}°/${execi 90 sed -n '8p' $HOME/1_accuweather/first_days}°    ${execi 90 sed -n '14p' $HOME/1_accuweather/first_days}°/${execi 90 sed -n '13p' $HOME/1_accuweather/first_days}°    ${execi 90 sed -n '19p' $HOME/1_accuweather/first_days}°/${execi 90 sed -n '18p' $HOME/1_accuweather/first_days}°    ${execi 90 sed -n '24p' $HOME/1_accuweather/first_days}°/${execi 90 sed -n '23p' $HOME/1_accuweather/first_days}°    ${execi 90 sed -n '4p' $HOME/1_accuweather/last_days}°/${execi 90 sed -n '3p' $HOME/1_accuweather/last_days}°    ${execi 90 sed -n '9p' $HOME/1_accuweather/last_days}°/${execi 90 sed -n '8p' $HOME/1_accuweather/last_days}°",
			font_name="caviar dreams",
			font_size=12,
			h_align="l",
			--v_align="m",
			bold=true,
			x=20,
			y=160,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                {
			text=conky_parse"      ${execi 3600 echo `date --date='1 day' | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date='1 day' | awk '{print $3}'`}      ${execi 3600 echo `date --date='2 day' | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date='2 day' | awk '{print $3}'`}     ${execi 3600 echo `date --date='3 day' | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date='3 day' | awk '{print $3}'`}       ${execi 3600 echo `date --date='4 day' | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date='4 day' | awk '{print $3}'`}       ${execi 3600 echo `date --date='5 day' | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date='5 day' | awk '{print $3}'`}      ${execi 3600 echo `date --date='6 day' | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date='6 day' | awk '{print $3}'`}",
			font_name="caviar dreams",
			font_size=12,
			h_align="l",
			--v_align="m",
			bold=true,
			x=20,
			y=220,
			colour={{0.5,0XC8C8FF,0.8},{1,0XFFFFCC,0.8}}, 
			--radial={0,300,0,0,300,370},
			orientation="nn",
		},
                
		
}
--------------END OF PARAMETERES----------------
  --------------END OF PARAMETERES----------------

    if conky_window == nil then return end
    if tonumber(conky_parse("$updates"))<3 then return end
       
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
		
    for i,v in pairs(text_settings) do    
        cr = cairo_create (cs)
        display_text(v)
        cairo_destroy(cr)
	    cr = nil
    end
    
    cairo_surface_destroy(cs)
		
end

function rgb_to_r_g_b2(tcolour)
    local colour,alpha=tcolour[2],tcolour[3]
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function display_text(t)
    if t.draw_me==true then t.draw_me = nil end
    if t.draw_me~=nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end
    local function set_pattern(te)
        --this function set the pattern
        if #t.colour==1 then 
            cairo_set_source_rgba(cr,rgb_to_r_g_b2(t.colour[1]))
        else
            local pat
            
            if t.radial==nil then
                local pts=linear_orientation(t,te)
                pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
            else
                pat = cairo_pattern_create_radial (t.radial[1],t.radial[2],t.radial[3],t.radial[4],t.radial[5],t.radial[6])
            end
        
            for i=1, #t.colour do
                cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgb_to_r_g_b2(t.colour[i]))
            end
            cairo_set_source (cr, pat)
            cairo_pattern_destroy(pat)
        end
    end
    
    --set default values if needed
    if t.text==nil then t.text="Conky is good for you !" end
    if t.x==nil then t.x = conky_window.width/2 end
    if t.y==nil then t.y = conky_window.height/2 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,1}} end
    if t.font_name==nil then t.font_name="Arial" end
    if t.font_size==nil then t.font_size=14 end
    if t.angle==nil then t.angle=0 end
    if t.italic==nil then t.italic=false end
    if t.oblique==nil then t.oblique=false end
    if t.bold==nil then t.bold=false end
    if t.radial ~= nil then
        if #t.radial~=6 then 
            print ("error in radial table")
            t.radial=nil 
        end
    end
    if t.orientation==nil then t.orientation="ww" end
    if t.h_align==nil then t.h_align="l" end
    if t.v_align==nil then t.v_align="b" end    
    if t.reflection_alpha == nil then t.reflection_alpha=0 end
    if t.reflection_length == nil then t.reflection_length=1 end
    if t.reflection_scale == nil then t.reflection_scale=1 end
    if t.skew_x==nil then t.skew_x=0 end
    if t.skew_y==nil then t.skew_y=0 end    
    cairo_translate(cr,t.x,t.y)
    cairo_rotate(cr,t.angle*math.pi/180)
    cairo_save(cr)       
     
    local slant = CAIRO_FONT_SLANT_NORMAL
    local weight = CAIRO_FONT_WEIGHT_NORMAL
    if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
    if t.oblique then slant = CAIRO_FONT_SLANT_OBLIQUE end
    if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end
    
    cairo_select_font_face(cr, t.font_name, slant,weight)
 
    for i=1, #t.colour do    
        if #t.colour[i]~=3 then 
            print ("error in color table")
            t.colour[i]={1,0xFFFFFF,1} 
        end
    end

    local matrix0 = cairo_matrix_t:create()
    tolua.takeownership(matrix0) 
    local skew_x,skew_y=t.skew_x/t.font_size,t.skew_y/t.font_size
    cairo_matrix_init (matrix0, 1,skew_y,skew_x,1,0,0)
    cairo_transform(cr,matrix0)
    cairo_set_font_size(cr,t.font_size)
    local te=cairo_text_extents_t:create()
    tolua.takeownership(te) 
    local text=conky_parse(t.text)
    if text~="" then t.text = text end
    cairo_text_extents (cr,t.text,te)
    set_pattern(te)
            
    local mx,my=0,0
    
    if t.h_align=="c" then
        mx=-te.width/2-te.x_bearing
    elseif t.h_align=="r" then
        mx=-te.width
    end
    if t.v_align=="m" then
        my=-te.height/2-te.y_bearing
    elseif t.v_align=="t" then
        my=-te.y_bearing
    end
    cairo_move_to(cr,mx,my)
    
    cairo_show_text(cr,t.text)

     
        
        
   if t.reflection_alpha ~= 0 then 
        local matrix1 = cairo_matrix_t:create()
		tolua.takeownership(matrix1)         
        cairo_set_font_size(cr,t.font_size)

        cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(te.height+te.y_bearing+my)*(1+t.reflection_scale))
        cairo_set_font_size(cr,t.font_size)
        te=nil
        local te=cairo_text_extents_t:create()
        tolua.takeownership(te) 
        cairo_text_extents (cr,t.text,te)
        
                
        cairo_transform(cr,matrix1)
        set_pattern(te)
        cairo_move_to(cr,mx,my)
        cairo_show_text(cr,t.text)

        local pat2 = cairo_pattern_create_linear (0,
                                        (te.y_bearing+te.height+my),
                                        0,
                                        te.y_bearing+my)
        cairo_pattern_add_color_stop_rgba (pat2, 0,1,0,0,1-t.reflection_alpha)
        cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)    
        
        --line is not drawn but with a size of zero, the mask won't be nice
        cairo_set_line_width(cr,1)
        local dy=te.x_bearing
        if dy<0 then dy=dy*(-1) end
        cairo_rectangle(cr,mx+te.x_bearing,te.y_bearing+te.height+my,te.width+dy,-te.height*1.05)
        cairo_clip_preserve(cr)
        cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
        --cairo_stroke(cr)
        cairo_mask(cr,pat2)
        cairo_pattern_destroy(pat2)
        cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
        te=nil
    end
    
end


function linear_orientation(t,te)
    local w,h=te.width,te.height
    local xb,yb=te.x_bearing,te.y_bearing
    
    if t.h_align=="c" then
        xb=xb-w/2
    elseif t.h_align=="r" then
        xb=xb-w
       end    
    if t.v_align=="m" then
        yb=-h/2
    elseif t.v_align=="t" then
        yb=0
       end    
    local p=0
    if t.orientation=="nn" then
        p={xb+w/2,yb,xb+w/2,yb+h}
    elseif t.orientation=="ne" then
        p={xb+w,yb,xb,yb+h}
    elseif t.orientation=="ww" then
        p={xb,h/2,xb+w,h/2}
    elseif vorientation=="se" then
        p={xb+w,yb+h,xb,yb}
    elseif t.orientation=="ss" then
        p={xb+w/2,yb+h,xb+w/2,yb}
    elseif t.orientation=="ee" then
        p={xb+w,h/2,xb,h/2}        
    elseif t.orientation=="sw" then
        p={xb,yb+h,xb+w,yb}
    elseif t.orientation=="nw" then
        p={xb,yb,xb+w,yb+h}
    end
    return p
end

autostart.sh

#!/bin/sh
# You can use this script to create an autostart,it will cd into the theme folder before executing conky
# Conkies can be started individually through terminal from their directory (conky -c conky.conf or cd /path/to/theme/ && conky -c conky.conf)

    #killall conky

        # Making sure theme-dir is working-dir
        cd "$(dirname "$0")"

    ( set -x; setsid conky -c conky-weather.conf )

exit

settings.lua

function conky_vars()

        
    border_COLOR = "green" --options are green, blue, black, orange or default
    
    use_FONT = "caviar dreams"
    -- https://www.dafont.com/zekton.font
    
end

--[[
#########################
# conky-system-lua-V3   #
# by +WillemO @wim66    #
# v1.5 23-dec-17        #
#                       #
#########################
]]

Accuweather
https://forums.bunsenlabs.org/viewtopic.php?id=189

Offline

#893 Yesterday 07:32:06

manuel-909
Member
Registered: 2017-10-09
Posts: 25

Re: Show us your conky

2018-02-21-02-28-25_scrot.th.png

Last edited by manuel-909 (Yesterday 07:34:15)

Offline

#894 Yesterday 20:06:32

devnull
Member
Registered: 2017-06-29
Posts: 54

Re: Show us your conky

A very simple conky, but I'm proud of how much I didn't put in it and of the overall effect!

9AzonECl.png

Code for the bottom conky (is in conky 1.10):

conky.config = {
  alignment = 'bottom',
  background = false,
  border_width = 1,
  border_inner_margin = 4,
  default_color = '00f100',
  default_outline_color = '051317',
  default_shade_color = '051317',
  own_window_colour = '000000',
  own_window_argb_visual = true,
  own_window_argb_value = 0,
  double_buffer = true,
  draw_borders = false,
  draw_graph_borders = false,
  draw_outline = false,
  draw_shades = false,
  use_xft = true,
  xftalpha = 0.5,
  font = 'SFNS Display:style=Regular:size=10',
  gap_x = 0,
  gap_y = 6,
  minimum_height = 5,
  minimum_width = 1920,
  own_window = true,
  own_window_class = 'Conky',
  own_window_type = 'desktop',
  stippled_borders = 0,
  update_interval = 1.0,
  own_window_transparent = true,
  own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
  short_units = true,
  use_spacer = 'none'
}
conky.text = [[
  UPTIME: ${color ffffff}$uptime_short ${color}    CPU: ${cpugraph cpu0 14,65 00f100 ffffff s}    IP: ${color ffffff}${addr wlo1} ${color}    RAM ${color ffffff}${memperc}%${color}    SWAP ${color ffffff}${swapperc}%${color}    HDD ${color ffffff}${fs_used_perc /}%${color}    CPU ${color ffffff}${execi 300 sensors | grep temp2 | cut -c16-17 ;}°C${color}    ${time %m-%d %a %H:%M}  
]]

Code for the left conky:

# conky configuration
##############################################
# Settings
##############################################
use_xft yes
xftfont Liberation Sans:size=9
xftalpha 0
update_interval 1.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_argb_visual yes
own_window_colour 000000
own_window_argb_value 100


## Colori
color1 ffffff #white
color2 00f100 #My font Green

############################ Window ###
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 300
maximum_width 200
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff
default_shade_color 000000
default_outline_color 828282
alignment top_left
gap_x 45
gap_y 50
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no


############################# End Window ###
#  Output
##############################################

TEXT
${font Monospace:bold:size=10}${alignc}${color2}${time %X}
${color1}${hr}
${font Monospace:bold:size=10}${alignc}${color2}C R Y P T O
${color1}${hr}
${font Monospace:normal:size=9}${color1}${color2}${texeci 30 python /path/to/getMarket.py}

python script (let's call it getMarket.py):

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# requires ccxt. 
# More infos on https://github.com/ccxt/ccxt

# To put it in your conky place the script somewhere, chmod +x and in your conky file put a line like this
# ${font Monospace:normal:size=8}${color1}${texeci 300 python /path/to/getMarket.py

import ccxt

cmc=ccxt.coinmarketcap()


# Write here the coins you want to fetch the price for, in single quotes separated by a comma
# Some tickers in coinmarketcap can be unpredictable, like 'MIOTA' for iota. If it doesn't work check your ticker for coinmarketcap online
# The coins will appear on the list in the order you put them

coins=['ETH','LTC', 'XLM', 'XMR', 'XRP', 'EOS', 'MIOTA', 'BTC','NANO']

for coin in coins:
	cointick=dict(cmc.fetch_ticker(coin+'/EUR'))
	cointick=cointick.get('info')
	coinPrice=cointick.get('price_eur')
	coinWeek=cointick.get('percent_change_7d')
	coinDay=cointick.get('percent_change_24h')
	coinHour=cointick.get('percent_change_1h')
	print(coin +" "+str(round(float(coinPrice),3))+"\nW("+coinWeek+") D("+coinDay+") H("+coinHour+")\n")

Last edited by devnull (Yesterday 20:22:09)

Offline

#895 Today 01:42:46

manuel-909
Member
Registered: 2017-10-09
Posts: 25

Re: Show us your conky

can you share the wallpaper.
thank's........

Offline

#896 Today 08:52:12

unklar
Member
Registered: 2015-10-31
Posts: 602

Re: Show us your conky

devnull wrote:

A very simple conky, but I'm proud of how much I didn't put in it and of the overall effect!

^ Very good work! I like it very much, I love it.
Thanks for sharing.   cool

Offline

#897 Today 10:43:38

devnull
Member
Registered: 2017-06-29
Posts: 54

Re: Show us your conky

manuel-909 wrote:

can you share the wallpaper.
thank's........

here you have it sir: https://i.imgur.com/6yYadBy.jpg

As a disclaimer I didn't do it myself but I can't remember in what corner of the internet I found it... it may have some kind of copyright on it.

Thanks @unklar smile

Offline

Board footer

Powered by FluxBB