You are not logged in.

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

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

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

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

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

Re: Show us your conky

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

Offline

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

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,641

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

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

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

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

#885 2018-02-21 07:03:22

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

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

#886 2018-02-21 07:32:06

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

Re: Show us your conky

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

Last edited by manuel-909 (2018-02-21 07:34:15)

Offline

#887 2018-02-21 20:06:32

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

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 (2018-02-21 20:22:09)

Offline

#888 2018-02-22 01:42:46

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

Re: Show us your conky

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

Offline

#889 2018-02-22 08:52:12

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,641

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

#890 2018-02-22 10:43:38

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

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

#891 2018-02-22 19:28:50

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

Re: Show us your conky

thank you for the link devnull....
wink

Offline

#892 2018-02-23 13:39:30

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

Re: Show us your conky

^manuel-909, I like your new weather better than the other one you gave me except one thing. Your high and low temps are backwards. Other than that, great job

Offline

#893 2018-02-23 18:01:23

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

Re: Show us your conky

thank's   wink

Offline

#894 2018-02-24 12:41:47

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,641

Re: Show us your conky

Hello friends,

I have here a @damo script for displaying the forum atom feed in a Conky.
Unfortunately, I don't manage to shift all 6 lines by 130 pixels to the right.  :8
Again and again he only moves the first line correctly.

rssFeed.th.jpg

can a scripting expert help me?  smile

here the original script

#!/bin/bash

# extract text between "CDATA[" and "]]" (Post title text)
# cut first line with tail
# keep first 6 lines from result of tail
URL="https://forums.bunsenlabs.org/extern.php?action=feed&type=atom"

connectiontest() {
    local -i i attempts=${1-0}
    for (( i=0; i < attempts || attempts == 0; i++ )); do
        if wget -O - 'http://ftp.debian.org/debian/README' &> /dev/null; then
            return 0
        fi
        if (( i == attempts - 1 )); then # if last attempt
            return 1
        fi
    done
}

connectiontest 10

if (( $? == 0 ));then
    # Get 6 lines; trim to 50 chars; remove any '$' chars; add conky var code to beginning of line
    curl -s "$URL" | grep "<title" | grep -o -P '(?<=CDATA\[).*(?=\]\])'| tail -n +2 | head -n 6 | cut -c 1-50 | sed 's/\$//' | sed 's/^/${goto 263}/'  

else
    echo "\${goto 263}No internet connection"
    echo "\${goto 263}Forum feed unavailable"
    echo "\${goto 263}"
    echo "\${goto 263}"
    echo "\${goto 263}"
    echo "\${goto 263}"
fi

and the Conky

#von @devnull
#https://forums.bunsenlabs.org/viewtopic.php?pid=68371#p68371
#geändert auf v1.9 unklar Februar 2018
  alignment bottom_left
  background no
  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 yes
own_window_argb_value 0
  double_buffer yes
  draw_borders no
  draw_graph_borders no
  draw_outline no
  draw_shades no
  use_xft yes
  xftalpha = 0.5,
  font monofur:size=10
  gap_x 0
  gap_y 55
  minimum_size 640 40
  maximum_width 640
  own_window yes
  own_window_class Conky
  own_window_type normal
  own_window_transparent yes
  own_window_hints undecorated,below,skip_taskbar,skip_pager   #sticky,
  short_units yes
  use_spacer left
  stippled_borders 0
  update_interval 1
############## 12-24 Hour Clock #######################
lua_load ~/S11/TEST/scripte/luaclock2412.lua
lua_draw_hook_pre main

TEXT
${goto 130}${execi 300 $HOME/S11/TEST/scripte/e-BL-atomfeed.sh}

${goto 130}Boot: ${color ffffff}${pre_exec who -b | cut -c23-} ${color}CPU ${color ffffff}${hwmon 1 temp 4}° ${color}FAN ${color ffffff}${hwmon 0 fan 4} ${color}RAM ${color ffffff}${memperc}% ${color}SWAP ${color ffffff}${swapperc}% ${color}HDD ${color ffffff}${fs_used_perc /}% ${color}MB ${color ffffff}${hwmon 0 temp 2}°

Thank you!

Offline

#895 2018-02-24 14:45:58

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

Re: Show us your conky

unklar wrote:

I have here a @damo script for displaying the forum atom feed in a Conky.
Unfortunately, I don't manage to shift all 6 lines by 130 pixels to the right.  ops
Again and again he only moves the first line correctly.

You can add spaces to the bash script, it's not the best solution but it could do the job, just change the last part of the sed line:

| sed 's/^/${goto 263}/'   --->   | sed 's/^/        /'

Offline

#896 2018-02-24 19:44:15

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

Re: Show us your conky

alpetjr , yes i have it backwards i fix it change colors too...
2018-02-24-14-37-58_scrot.th.png

Offline

#897 2018-02-24 20:02:42

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

Re: Show us your conky

unklar ths is a good link to start with sed:
http://sed.sourceforge.net/sed1line.txt

Last edited by manuel-909 (2018-02-24 20:03:32)

Offline

#898 2018-02-25 10:23:39

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,641

Re: Show us your conky

^Thanks Indian, that's what it does.  wink

Thank you manuel-909.
Can you explain this comment of damo to me in the script?

...remove any '$' chars; add conky var code to beginning of line

Offline

#899 2018-02-25 21:35:09

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

Re: Show us your conky

no really if you type conky var code in terminal start a conky i remove goto don't needed.

if (( $? == 0 ));then
    # Get 6 lines; trim to 50 chars; remove any '$' chars; add conky var code to beginning of line
curl -s "$URL" | grep "<title" | grep -o -P '(?<=CDATA\[).*(?=\]\])'| tail -n +1 | head -n 10 | cut -c 1-50  | sed 's/^/        /' | sed 's|[<>$,]||g'

else
    echo "\No internet connection"
    echo "\Forum feed unavailable"

this inside conky give de same:

};
conky.text = [[
${rss https://forums.bunsenlabs.org/extern.ph … d&type=rss 1 item_titles 10}

2018-02-25-16-28-54_scrot.th.png

Offline

#900 2018-02-28 18:34:17

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,641

Re: Show us your conky

^ Thank you, manuel-909   smile

Offline

Board footer

Powered by FluxBB