Page 20 of 32 FirstFirst ... 10181920212230 ... LastLast
Results 191 to 200 of 313

Thread: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

  1. #191
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    @ HangukMiguk

    # is the symbol conky uses to denote a comment, remove the # and it will work

    also heres an idea for colors...

    set them before the "TEXT

    color1 000000
    color2 111111

    TEXT

    ${color1}text${color2}text

  2. #192
    Join Date
    Feb 2008
    Location
    I'm lost ... HELP!
    Beans
    1,014
    Distro
    Xubuntu

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by mrpeachy View Post
    @ HangukMiguk

    # is the symbol conky uses to denote a comment, remove the # and it will work

    also heres an idea for colors...

    set them before the "TEXT

    color1 000000
    color2 111111

    TEXT

    ${color1}text${color2}text
    Code:
    ...
    TEXT
    
    ...
    default color ${color CCCCCC} color=cccccc ${color} default color
    ...
    Should work just as well. But you're right don't use a # in the hex color code.

  3. #193
    Join Date
    Aug 2009
    Location
    East of Atlantic
    Beans
    81
    Distro
    Ubuntu

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Hi all,

    Here is my entry for this CotM contest : St Valentine's Day /Massacre ! Nice choice by the way . If you like it, you can vote for it here

    For this, I made a simple blooding heart like on this image:

    The seven vertical "lines" are linked to conky, from left to right we have:
    memperc, cpu0, uploadspeed, mixer volume, download speed, cpu1, running processes.

    For better vizualisation, you should see it in action, on this video.

    The same used with a wallpaper from dA : for_a_rainy_day_by_fusiom



    With the same script, I can choose other shapes, for example, a heart breathing :

    This one is linked to cpu usage on this video.

    But, if you don't care with heart and things like that, you can draw your own shape.
    This one for example :

    In action here (top and bottom = cpu0 and cpu1, left and right are upload and dowload speed).

    If you want to try it, make sure the variables used in the Lua script fit your system (mines are wlan0, cpu0, cpu1 ...).
    The option to choose the shape to draw is written in the conkyrc.

    Well, now, if you are rash, you can try to draw your own shape. I will try to explain how with this simple example
    Image :

    All the shapes are drawn with Bezier curves. Here is the code for the picture :
    Code:
    function theme_test()
        local xc,yc,r=100,100,20
        local points = {
        --    Px        Py,        Cx,        Cy,        Radius,        Start side
            {xc-2*r,    yc-r,    xc,    yc,    r,        1},        --top left
            {xc+100+2*r,    yc-r,    xc+100,    yc,    r,        1},        --top right
        }
        return points
    end
    Cx and Cy are center coordinates of the circles
    Radius are the radius of the circles
    Px and Py are the center point of the Bezier Curve

    First, the script calculate the tangeants points for each circle (0 and 1 on the picture)
    "Start side" is the side where start the next bezier curve. It is one here
    When Px,Py is above the circle, left side is always 0, right side is always 1. (And this it an absolute position, it means when Px,Py is bellow the circle, 0 is still left side but you will see it on the right because it's now upside down...)
    After that, the script calculate the intersecion points of the tangeants (I1 and I2)

    then the script draw curves with:
    (Circle1,P0), P1 ,(Circle1,P1)
    (Circle1,P1), I1 ,(Circle2,P0)
    (Circle2,P0), P2 ,(Circle2,P1)
    (Circle2,P1), I2 ,(Circle1,P0)

    Well, it's not easy to explain, I hope you understood a little bit ! It's more an (art) script than a ready-to-use widget, and it's not very readable but it was not what I was looking for! ... If you have questions, don't hesitate !

    It was fun to make it, I hope you like it
    (conkyrc and script are in the attachments)
    Attached Files Attached Files
    Last edited by wlourf; March 1st, 2010 at 11:49 PM.

  4. #194
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    @wlourf

    thats a nice idea.
    I wish I had the energy (or indeed the time) to learn how to apply shading effects to cairo graphics. I think my flowers entry for the competition would benefit greatly from a bit of extra graphical flair.

    --- well shading turned out to be pretty straightforward
    Last edited by mrpeachy; February 27th, 2010 at 08:59 PM.

  5. #195
    Join Date
    Aug 2009
    Location
    East of Atlantic
    Beans
    81
    Distro
    Ubuntu

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by andreino View Post
    hy boys
    can see the day week
    this lua for language Italian?
    thanks for the help
    http://forum.ubuntu.ru/index.php?top...8103#msg638103
    Thanks for asking! I'm french and I didn't managed to get dates in french till now.

    Here is what I've done for having dates according to my locale settings:
    It your conkyrc, in the TEXT section, write
    Code:
    ${time}
    If you want to hide this date ,
    Code:
    use_xft yes
    xftalpha 0
    default_color 000000
    It seems it works only for the black color .

    Can you check on your system if it also works and I will update the script if it's ok.
    I didn't find a better way in Lua script with os.setlocale() for example...
    @mrpeachy:
    you made an electroencephalogram and I made a pulsing heart, that's funny !
    Last edited by wlourf; February 26th, 2010 at 11:40 PM.

  6. #196
    Join Date
    Apr 2006
    Location
    Qingdao, China
    Beans
    84

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by miegiel View Post
    Code:
    ...
    TEXT
    
    ...
    default color ${color CCCCCC} color=cccccc ${color} default color
    ...
    Should work just as well. But you're right don't use a # in the hex color code.
    took the pound sign out, still not working. still showing up as black.
    Linux Registered User #457962

  7. #197
    Join Date
    Sep 2008
    Location
    Italy Varese..
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Hi boys....

    How do I do to remove the shade that I have in the conky?




    Code:
    --[[
    При сборке скрипта использованы данные из следующих скриптов
    
    Conky Widgets by londonali1010 (2009) - часы и кольца
    Conky vertical bar graph by iggykoopa - горизонтальный и вертикальный бары
    Shadowed clock by wlourf (10 jan. 2010) - стрелки часов с тенью
    calendar wheel by Wlourf (14 jan. 2010) - календарь
    
    Собрал все это Борис Кринкель <olgmen> krinkel@rambler.ru
    
    Для этого серипта требуется CONKY версии 1.7.2
    
    Для вызова этого скрипта в Conky вставьте следующие строки до TEXT (при условии, что скрипт сохранен в ~/scripts/conky_widgets.lua):
        lua_load ~/scripts/widgets.lua
        lua_draw_hook_pre widgets
    ]]
    
    require 'cairo'
    require 'imlib2'
    
    --[[ AIR CLOCK WIDGET ]]
    --[[ Виджет выводит изображение часов с объемными стрелками и тенью от стрелок.
    	Часть настроек находится в виджете
    ]]
    
    function clock(cr, x, y, s, bgc, bga, fgc, fga)
    
    -- функция перекодировки цвета
    
    	function rgb_to_r_g_b(colour,alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    
    -- назначаем толщину выводимых линий
    
    		local s_th = 2
    
    -- рисуем циферблат
    
    		local radius = s/2	
    		local m_x,m_y = x + s/2, y + s/2
    		cairo_set_line_width(cr,6)
    		cairo_arc(cr, m_x,m_y, radius, 0, math.rad(360))
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    		cairo_stroke(cr)
    
    -- прозрачный "корпус часов"
    	
    		cairo_arc(cr, m_x, m_y, radius*1.25, 0, 2*math.pi)
    		cairo_set_source_rgba(cr, 0.5, 0.5, 0.5, 0.8)
    		cairo_set_line_width(cr,1)
    		cairo_stroke(cr)
    	
    		local border_pat=cairo_pattern_create_linear(m_x, m_y - radius*1.25, m_x, m_y + radius*1.25)
    	
    		cairo_pattern_add_color_stop_rgba(border_pat,0,0,0,0,0.7)
    		cairo_pattern_add_color_stop_rgba(border_pat,0.3,1,1,1,0)
    		cairo_pattern_add_color_stop_rgba(border_pat,0.5,1,1,1,0)
    		cairo_pattern_add_color_stop_rgba(border_pat,0.7,1,1,1,0)
    		cairo_pattern_add_color_stop_rgba(border_pat,1,0,0,0,0.7)
    		cairo_set_source(cr,border_pat)
    		cairo_arc(cr, m_x, m_y, radius*1.125, 0, 2*math.pi)
    		cairo_close_path(cr)
    		cairo_set_line_width(cr, radius*0.25)
    		cairo_stroke(cr)
    
    -- вывод часовых делений
    
    		local i = 0
    		local winkel = math.rad(30)		
    		
    		for i=0,11,1 do
    		cairo_set_line_width(cr,s_th*1.5)
    		cairo_move_to(cr, m_x-math.sin(winkel*i)*radius, m_y-math.cos(winkel*i)*radius)
    		cairo_line_to(cr, m_x-math.sin(winkel*i)*(radius*0.9), m_y-math.cos(winkel*i)*(radius*0.9))
    		cairo_fill_preserve(cr)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    		cairo_stroke(cr)
    		end
    
    -- вывод минутных делений
    
    		local i = 0
    		local winkel = math.rad(6)
    
    		for i=0,59,1 do
    		cairo_set_line_width(cr,1)
    		cairo_move_to(cr, m_x-math.sin(winkel*i)*radius, m_y-math.cos(winkel*i)*radius)
    		cairo_line_to(cr, m_x-math.sin(winkel*i)*(radius*0.9), m_y-math.cos(winkel*i)*(radius*0.9))
    		cairo_stroke(cr)
    		end
    
    -- рисуем деления 3, 6, 9 и 12 часовые
    
    		cairo_set_line_width(cr,s_th/2)		-- устанавливаем толщину линий
    
    		cairo_move_to (cr, x + 0.15*s, y + 0.5*s)
    		cairo_line_to (cr, x + 0.45*s, y + 0.5*s)
    		cairo_move_to (cr, x + 0.55*s, y + 0.5*s)
    		cairo_line_to (cr, x + 0.85*s, y + 0.5*s)
    		cairo_move_to (cr, x + 0.5*s, y + 0.15*s)
    		cairo_line_to (cr, x + 0.5*s, y + 0.45*s)
    		cairo_move_to (cr, x + 0.5*s, y + 0.55*s)
    		cairo_line_to (cr, x + 0.5*s, y + 0.85*s)
    		cairo_stroke(cr)
    
    -- часовые стрелки с тенью, взято из Shadowed clock by wlourf (10 jan. 2010)
    
    		function draw_hand(a_trame,arc,arc0,arc1,lg,r,border,rgb)
    		xx = xc + clock_r*math.sin(arc)*lg
    		yy = yc - clock_r*math.cos(arc)*lg
    		x0 = xc + r*math.sin(arc0)
    		y0 = yc - r*math.cos(arc0)
    		x1 = xc + r*math.sin(arc1)
    		y1 = yc - r*math.cos(arc1)
    
    		if border ~= nil then
    		cairo_set_line_width(cr,1)
    		cairo_set_source_rgba(cr,border[1],border[2],border[3],0.5)
    		cairo_move_to (cr, x0, y0)
    		cairo_curve_to (cr, x0, y0, xx, yy, x1, y1)
    		cairo_arc(cr,xc,yc,r,arc1-math.pi/2,arc0-math.pi/2)
    		cairo_stroke(cr)
    		end
    
    -- рисуем тень
    
    		cairo_move_to (cr, x0, y0)
    		cairo_curve_to (cr, x0, y0, xx+shadow_xoffset, yy+shadow_yoffset, x1, y1)
    		cairo_arc(cr,xc,yc,r,arc1-math.pi/2,arc0-math.pi/2)
    		pat = cairo_pattern_create_radial (xc, yc, 0, xc, yc, clock_r)
    		cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, shadow_opacity)
    		cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 0)
    		cairo_set_source (cr, pat)
    		cairo_fill (cr)
    
    -- рисуем стрелки
    
    		cairo_move_to (cr, x0, y0)
    		cairo_curve_to (cr, x0, y0, xx, yy, x1, y1)
    		cairo_arc(cr,xc,yc,r,arc1-math.pi/2,arc0-math.pi/2)
    		pat = cairo_pattern_create_radial (xc, yc, clock_r/10, xc, yc, clock_r*lg)
    		cairo_pattern_add_color_stop_rgba (pat,0, rgb[1], rgb[2], rgb[3], 1)
    		cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1)
    		cairo_set_source (cr, pat)
    		cairo_fill (cr)
    		cairo_pattern_destroy (pat)
    		end
    
    -- Здесь вводятся основные данные
    
    -- радиус часов в пикселях, задаем половину диаметра часов
    
    		clock_r=s/2
    
    -- координаты центра часов
    
    		xc = x+s/2
    		yc = y+s/2
    
    -- координаты источника света относительно центра часов, 0 - источник света над центром
    -- может быть положительным, источник света выше центра, или отрицательным
    
    		shadow_xoffset=70
    		shadow_yoffset=70
    
    -- прозрачность тени, значения от 0 до 1
    
    		shadow_opacity=0.5
    
    -- Выводить секундную стрелку, Да - true, Нет - false.
    -- При выводе секундной стрелки update_interval в .conkyrc должен быть менее 1 сек.
    
    		show_seconds=true
    
    -- Выводить ось стрелок в центре часов, Да - true, Нет - false.
    
    		show_dot = true
    
    -- размеры стрелок, первая цифра ширина, вторая - длина
    
    		rh,lgh=3,1.2	-- часовая стрелка
    		rm,lgm=2,1.75	-- минутная стрелка
    		rs,lgs=1,1.9	-- секундная стрелка
    
    -- забираем данные из ОС
    
    		local hours=os.date("%I")
    		local mins=os.date("%M")
    		local secs=os.date("%S")
    
    -- расчет угла движения стрелок
    
    		gamma = math.pi/2-math.atan(rs/(clock_r*lgs))
    		secs_arc=(2*math.pi/60)*secs
    		secs_arc0=secs_arc-gamma
    		secs_arc1=secs_arc+gamma
    
    		gamma = math.pi/2-math.atan(rm/(clock_r*lgm))
    		mins_arc=(2*math.pi/60)*mins + secs_arc/60
    		mins_arc0=mins_arc-gamma
    		mins_arc1=mins_arc+gamma
    
    		gamma = math.pi/2-math.atan(rh/(clock_r*lgh))
    		hours_arc=(2*math.pi/12)*hours+mins_arc/12
    		hours_arc0=hours_arc-gamma
    		hours_arc1=hours_arc+gamma
    
    -- вывод стрелок
    
    		draw_hand(alpha_trame,hours_arc,hours_arc0,hours_arc1,lgh,rh,{0,0,0},{1,1,1})
    		draw_hand(alpha_trame,mins_arc,mins_arc0,mins_arc1,lgm,rm,{0,0,0},{.9,.9,.9})
    		if show_seconds then
    		draw_hand(alpha_trame,secs_arc,secs_arc0,secs_arc1,lgs,rs,{0,0,0},{.8,.8,.8})
    		end
    
    -- рисуем ось стрелок
    
    		if show_dot then
    
    		lg_shadow_center=3
    		radius=math.min(rh,rm,rs)*0.75
    		if radius<1 then radius=1 end
    		ang = math.atan(shadow_yoffset/shadow_xoffset)
    
    -- тень от оси
    
    		gamma = -math.atan(1/lg_shadow_center)
    		ang0=ang-gamma
    		ang1=ang+gamma
    
    -- тень от стрелок
    
    		if shadow_xoffset<0 and shadow_yoffset>0 then
    		ang0=ang0+math.pi
    		ang1=ang1+math.pi
    		ang=ang+math.pi
    		end
    
    		if shadow_yoffset<0 and shadow_xoffset>0 then
    		ang0=ang0-math.pi/2
    		ang1=ang1-math.pi/2
    		ang=ang-math.pi/2
    		end
    
    		if shadow_yoffset<0 and shadow_xoffset<0 then
    		ang0=ang0-math.pi/2
    		ang1=ang1-math.pi/2
    		ang=ang-math.pi/2
    		end
    
    		x0 = xc + radius*math.sin(ang0)
    		y0 = yc - radius*math.cos(ang0)
    		xx = xc + radius*math.sin(ang+math.pi/2)*lg_shadow_center
    		yy = yc - radius*math.cos(ang+math.pi/2)*lg_shadow_center
    		x1 = xc - radius*math.sin(ang1)
    		y1 = yc + radius*math.cos(ang1)
    
    		cairo_move_to(cr,x0,y0)
    		cairo_curve_to(cr,x0,y0,xx,yy,x1,y1)
    		pat = cairo_pattern_create_radial (xc, yc, 0, xc, yc, radius*4)
    		cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0,0, shadow_opacity)
    		cairo_pattern_add_color_stop_rgba (pat, 1, 0,0,0, 0)
    		cairo_set_source (cr, pat)
    		cairo_fill (cr)
    
    		ang = ang-math.pi/2
    		xshad = xc + radius*math.sin(ang)*.5
    		yshad = yc - radius*math.cos(ang)*.5
    
    		local ds_pat=cairo_pattern_create_radial(xc, yc, 0, xshad, yshad, radius)
    		cairo_pattern_add_color_stop_rgba(ds_pat,0,.9,.9,.9,1)
    		cairo_pattern_add_color_stop_rgba(ds_pat,1,0,0,0,1)
    		cairo_arc(cr,xc,yc,radius,0,2*math.pi)
    		cairo_set_source(cr,ds_pat)
    		cairo_fill(cr)
    
    -- рисуем глянец на стекле
    
    		pat = cairo_pattern_create_radial (115.2, 102.4, 25.6, 102.4, 102.4, 128)
    		cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 0.1)
    		cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 0.4)
    		cairo_set_source (cr, pat)
    		cairo_arc (cr, xc, yc, s/2, 0, 2 * math.pi)
    		cairo_fill (cr)
    		cairo_pattern_destroy (pat)
    end
    
    --[[ END AIR CLOCK WIDGET ]]
    
    -- ----------------------------------------------------------------------------------
    
    --[[
    calendar wheel by Wlourf (14 jan. 2010)
    
    This script is designed to draw dates on a circular way on the left of the screen.
    Some text info can be added in the circle with the file calendar.txt (see below)
    Some parameters (colors, sizes ... ) can be adjusted (see below).
    
    As this script draw a png file only if necessary, a short update of the conky can be used.
    
    Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/calendar.lua):
    	lua_load ~/scripts/calendar.lua
    	lua_draw_hook_pre main
    	
    	
    v1.0 - 14 jan. 2010 - Original release
    v1.1 - 19 jan. 2010 - Calendar are now drawn in an PNG file and this file 
    	is called at every conky call, when day change, a new PNG file is created.
    	- An x offset can be added to "Today's block"
    	- An y offset can be added too to "Today's block"
    v1.2 - 28 jan. 2010 - Calendar can be drawn on the right side of the conky (but without text info)
    	- Calendar is drawn after the second conky refresh only
    v1.2a - 29 jan. 2010 - Minor update, picture was refresh every second instead of every day!
    ]]
    
    --require 'cairo'
    --require 'imlib2'
    
    -------------------------- parameters (part one) are set here -----------------------------------
    
    	--text file calendar (absolute path, can be "" if no file used)
    	calendar_file="/home/boris/scripts/calendar.txt"
    	--format of in this text file
    	--MMDD;N;TEXT
    	--MMDD = month day
    	--N    = 0 or 1 (1 to display same colors as week-ends)
    	--TEXT = Text to display (use * for multiline)
    
    	--some paths to images created (absolutes paths)
    	image_tmp="/tmp/img_tmp.png" --used to rotate a single date
    	image_calendar="/tmp/conky-calendar-arc.png"
    	image_dates="/tmp/conky-calendar-dates.png"
    
    	--more parameters below
    -------------------------- end of parameters (part one) -----------------------------------	
    
    
    function string:split(delimiter)
    --source for the split function : http://www.wellho.net/resources/ex.php4?item=u108/split
      local result = { }
      local from  = 1
      local delim_from, delim_to = string.find( self, delimiter, from  )
      while delim_from do
        table.insert( result, string.sub( self, from , delim_from-1 ) )
        from  = delim_to + 1
        delim_from, delim_to = string.find( self, delimiter, from  )
      end
      table.insert( result, string.sub( self, from  ) )
      return result
    end
    
    
    
    function conky_draw_calendar()
    --	if conky_window==nil then return end
    	local width=conky_window.width
    	local height=conky_window.height
    --local height = s
    --local width = s	
    	--sometimes, there is problem with init and width & height are set to 0 or 2 !!
    --	if width<3 or height<3 then return end
    	
    local cs=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height)
    	local cr=cairo_create(cs)
    	
    	-------------------------- parameters (part two) are set here -----------------------------------
    
    	
    	-- vertical center of the circle (height/2 for centered circle)
    	local yc=s/2+y
    	
    	--number of days to display before and after today (i.e. with range = 30 --> 60 days are displayed)
    	--even number between 20 and 30 for nice effect
    	local range = 11
    	
    	--not sure of the engish words so I leave then in french !	
    	--fleche (arrow) is the segment from x=0 to x=radius-xc (with xc =center of the circle) 
    	--fleche for the external circle
    	--fleche2 for the internal circle
    	--fleche2 must be < fleche
    	local fleche=125
    	local fleche2=fleche*.85
    	
    	--corde (chord) is the vertical segment (where x=0) of the external circle
    	local corde = 1.5*s--height+s/2
    			
    	--colors RGB (0-255)
    	--week day
    	local wday={150,150,150}
    	--week-end and bank holidays defined in calendar.txt
    	local eday={255,200,0}
    	--color of today
    	local dday={255,255,255}
    	
    	--vertical gradient (both circle and dates)? (true/false)
    	local vgradient=true
    	
    	--horizontal gradient for the circle? (0 to 1, 0 is the best choice for "moon like" circle )
    	local hgradient=0
    	
    	--you can change the font here
    	local font="PT Sans"
    	--font_size (of dates) must be less than delta (= heigth of a day)
    	local delta = yc/(range+0.5)
    	--the font-size has to be adjusted depending on the font used
    	local font_size=delta-1
    	
    	--information text (from calendar.txt)
    	local info_color={255,200,0}
    	--font size of text infos
    	local font_size_info=font_size
    
    	--today_xoffset is the offset for the date of today (can be positive/null/negative, in pixels)
    	local today_xoffset=5
    	
    	--today_yoffset where today will be displayed (value between -range to + range)?
    	-- 0 = center of the arc
    	-- -range =  top of the arc
    	-- +range = bottom of the arc
    	local today_yoffset=0	-- -9
    	
    	--display on right side of the screen (true/false)
    	local align_right = true
    
    	
    	-------------------------- end of the parameters, ouf -----------------------------------
    
    	--some calculations
    	--radius for external circle
    	--radius2 for internal circle
    	--delta = number of arcs in the circle
    	local radius=(corde^2+4*fleche^2)/(8*fleche)
    	local radius2=(corde^2+4*fleche2^2)/(8*fleche2)
     	local decal=2*(delta-font_size)
    	wday[1]=wday[1]/255
    	wday[2]=wday[2]/255
    	wday[3]=wday[3]/255	
    	eday[1]=eday[1]/255
    	eday[2]=eday[2]/255
    	eday[3]=eday[3]/255	
    
    	--xc =x center of external circle
    	--xc2=x center of internal circle
    	local xc = fleche - radius	
    	local xc2 = fleche2 - radius2
    	
    	if align_right then 
    		xc = width-xc-1.5*s/2
    		xc2 = width-xc2-1.5*s/2
    	end
    
    	local h_txt = height/(2*range+1)
    	
    	local t = os.date('*t') -- date in table
    	--get the date
    	local s = os.time(t) -- date in seconds
    
    	--read the calendar file
    	local file = io.open(calendar_file,"r")	
    	local tabcal={}	
    	local idx=1
    	local line,lineok="",""
    	if file ~= nil then
    		while true do
    		 	line = file:read("*l")
    		    if line == nil then break end
    			lineok = string.split(line,";")
    			if (#lineok)==3 then
    				tabcal[idx]={lineok[1],lineok[2],lineok[3]}
    				idx=idx+1
    			end
    		end
    	end	
    	io.close()
    	local angmini=math.atan((corde/2)/(radius-fleche))
    
    	local imageDates=imlib_create_image(width,height)
    	imlib_context_set_image(imageDates)
    	imlib_image_set_has_alpha(1)
    	imlib_save_image(image_dates)
    
    	for i=-range,range do
    		local s2 = s + 3600*24*(i-today_yoffset) --date diff in seconds
    
    		local wd = os.date("%w",s2)
    		local md = os.date("%m%d",s2)
    		local dt = os.date("%a. %d %b.",s2),os.date("%d",s2),os.date("%b",s2)
    
    		--percentage of vertical gradient
    		local pc = (range-math.abs(i))/range
    		if not vgradient then pc=1 end
    
    		--angle min et max of one block
    		local ang0 = angmini*(i-0.5)/range
    		local ang1 = angmini*(i+0.5)/range
    		if align_right then 
    			ang0=math.pi-ang0
    			ang1=math.pi-ang1
    		end
    		local angm = (ang0+ang1)/2
    		
    		--read the calendar.txt array
    		local flag = false
    		for idy=1,idx-1 do
    			if tabcal[idy][1] == md then
    				if (i-today_yoffset) == 0 then
    					today = tabcal[idy]
    				end
    				if tabcal[idy][2] == "1" then
    					flag = true
    				end
    				break
    			end
    		end
    
    		--colors
    		local colR,colG,colB=0,0,0
    		if wd=="6" or wd=="0" or flag == true then
    			colR,colG,colB=eday[1],eday[2],eday[3]
    		else
    			colR,colG,colB=wday[1],wday[2],wday[3]
    		end
    		
    		--offset of today 
    		local offset_x=0
    		local way = 1
    		if (i-today_yoffset)==0 then 
    			if align_right then way =-1 end
    			offset_x=today_xoffset*way 
    		end
    
    		local pat = cairo_pattern_create_radial (xc+offset_x, yc, radius,
             			xc2+offset_x,yc,radius2);
    		
    		cairo_pattern_add_color_stop_rgba (pat, 0, colR, colG, colB, pc);
    		cairo_pattern_add_color_stop_rgba (pat, 1, colR, colG, colB, hgradient);
    		
    		cairo_set_source (cr, pat);
    		--draw the portion of arc
    		if align_right then
    			x1,y1=radius*math.cos(ang0)+xc+offset_x,(radius-offset_x)*math.sin(ang0)+yc
    			x2,y2=radius*math.cos(ang1)+xc+offset_x,(radius-offset_x)*math.sin(ang1)+yc
    		else
    			x1,y1=radius*math.cos(ang0)+xc+offset_x,(radius+offset_x)*math.sin(ang0)+yc
    			x2,y2=radius*math.cos(ang1)+xc+offset_x,(radius+offset_x)*math.sin(ang1)+yc
    		end
    		cairo_move_to(cr,x1,y1)
    		cairo_line_to(cr,x2,y2)
    		cairo_line_to(cr,xc,yc)
    		cairo_fill(cr)
    		
    		--for tests
    		if (i-today_yoffset)==0 then
    
    		end
    
    		--write text info if needed, for left-side calendar only
    		local have=""
    local height = 20 -- расположение текста из calendar.txt по вертикали
    
    if today ~= nil then
    --		if (today ~= nil) and (align_right ~= true) then
    			cairo_select_font_face(cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
    			cairo_set_line_width(cr,0)
    			cairo_set_font_size(cr,font_size_info)
    			cairo_set_source_rgba (cr, info_color[1]/255, info_color[2]/255, info_color[3]/255,1);
    
    			have = string.split(today[3],"*")
    			for i=1,#have do 
    				cairo_move_to(cr,10,height+(i-#have/2)*font_size_info)
    				cairo_show_text(cr, have[i])
    				cairo_fill(cr)
    			end
    		end	
    
    		--lenght of the arc
    		local dx,dy=math.abs(x2-x1),math.abs(y2-y1)
    		local h_txt=math.sqrt(dx*dx+dy*dy)
    		local w_txt=font_size*10
    
    		--write text in another image for working (rotate) on it
    		--didn't find to work in memory only
    		local cs2=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w_txt, h_txt)
    		local cr2=cairo_create(cs2)
    		cairo_set_font_size (cr2, font_size);
    		if (i-today_yoffset)==0 then 
    			colR, colG, colB = dday[1]/255,dday[2]/255,dday[3]/255
    			pc=1
    		end
    		cairo_select_font_face(cr2, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
    
    		--write ONE date in ONE picture		
    		local txt_date = " " .. dt .. " "
    		--start the drawing date here in order to get the lenght of the text
    		--for right alignement
    		cairo_move_to(cr2,0,h_txt-decal)--+offset_x*math.atan(ang0))
    		cairo_set_source_rgba (cr2, colR, colG, colB,pc)
    		cairo_show_text(cr2, txt_date)
    
    		if align_right then
    			local xmax,ymax=cairo_get_current_point(cr2,0,0)
    			--don't use local for cs2fit cause local will be just for if .. end section
    			--and then surface will not be deleted --> memory leak
    			cs2fit = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, xmax, h_txt)
    			cr2fit = cairo_create(cs2fit)
    			
    
    			cairo_set_font_size (cr2fit, font_size);
    			cairo_select_font_face(cr2fit, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
    			cairo_move_to(cr2fit,0,h_txt -decal)
    			cairo_set_source_rgba (cr2fit, colR, colG, colB,pc)
    			cairo_show_text(cr2fit, txt_date)
    
    			cairo_stroke(cr2fit)
    			cairo_surface_write_to_png(cs2fit,image_tmp)
    			
    		else
    			cairo_stroke(cr2)
    			cairo_surface_write_to_png(cs2,image_tmp)
    		end
    	
    		--blend date image on cairo surface
    		local imageTmp = imlib_load_image(image_tmp)
    		imlib_context_set_image(imageTmp)
    
    		if align_right then
    			rot_img = imlib_create_rotated_image(angm+math.pi)
    		else
    			rot_img = imlib_create_rotated_image(angm)
    		end
    
    		imlib_context_set_image(imageTmp)
    		imlib_free_image()
    	
    		--image is now a  square
    		imlib_context_set_image(rot_img)
    		local w_img0, h_img0 = imlib_image_get_width(), imlib_image_get_height()
    		
    		---look for center of text
    		local rt=radius+w_img0/2
    		if align_right then	
    			rt=rt-offset_x
    		else
    			rt=rt+offset_x
    		end
    		local xt=rt*math.cos(angm)+xc-w_img0/2
    		local yt=rt*math.sin(angm)+yc-h_img0/2
    
    		imlib_context_set_image(imageDates)
    		imlib_blend_image_onto_image(rot_img, 1, 0, 0, w_img0, h_img0, xt,yt, w_img0, h_img0)
    		imageDates=imlib_context_get_image()
    		imlib_context_set_image(rot_img)
    		imlib_free_image()
    
    
    
    
    		if align_right then 
    			
    			cairo_destroy(cr2fit)
    			cairo_surface_destroy(cs2fit)
    		end
    	
    		cairo_destroy(cr2)
    		cairo_surface_destroy(cs2)
    
    		cairo_pattern_destroy(pat)
    	end --of loop
    
    	--write to disk images with dates only
    	imlib_context_set_image(imageDates)
    	imlib_save_image(image_dates)	
    
    	--write to disk image with arc only
    	cairo_surface_write_to_png(cs,image_calendar)
    	
    	--make final image
    	local imageCal = imlib_load_image(image_calendar)
    	imlib_context_set_image(imageCal)
    	imlib_blend_image_onto_image(imageDates, 1, 0, 0, width, height, 0,0, width, height)
    	
    	imlib_save_image(image_calendar)
    	imlib_free_image()
    
    	imlib_context_set_image(imageDates)
    	imlib_free_image()
    
    	--free memory
    	cairo_destroy(cr)
    	cairo_surface_destroy(cs)
    	
    end 
    -- ------------------------------------------------------------------------------------------
    
    function calendar()
    	--last_date is global 
    	local actual_date  = os.date("%Y%m%d") --os.date("%Y%m%d")
    	local actual_cal = imlib_load_image(image_calendar)
    	if (conky_parse('${updates}')+0) <2  then return end
    	if  last_date ~= actual_date or actual_cal == nil then
    		--print (os.date("%H%M%S"),'new picture')
    		conky_draw_calendar()
    		last_date = actual_date
    	else
    		--print (os.date("%H%M%S"),'use old picture')
    	end
    	if actual_cal == nil then
    		actual_cal = imlib_load_image(image_calendar)
    	end
    	imlib_context_set_image(actual_cal)
    	imlib_render_image_on_drawable(0,0)
    	imlib_free_image()
    	end
    end
    -- [[ END CALENDAR WIDGET ]]
    -- -----------------------------------------------------------------------------------
    --[[ PIE WIDGET ]]
    --[[
    Conky Cairo Lua scripting example
    
    Copyright (c) 2009 Brenden Matthews, all rights reserved.
    
    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.
    
    You can tweak the settings_table below to suit your preferences.  You can draw
    as many pies as you want, by simply adding more entries in the settings_table.
    
    Load this in your conkyrc like so (assuming you save this script to
    ~/cairo_pie.lua):
    
    lua_load ~/scripts/cairo-pie.lua
    lua_draw_hook_pre pie_time
    lua_draw_hook_post cairo_cleanup
    
    ]]
    
    settings_table = {
    	{
    		-- Can be one of 'top', 'top_mem', or 'top_io' (requires iostats
    		-- support in Conky).  This is the top stat we're basing our pie on.
    		name='top',
    		-- Draw a background pie? Can be true or false.
    		draw_bg=true,
    		-- Background pie colour, RGB value.
    		bg_colour=0xffffee,
    		-- Foreground pie colour, RGB value.
    		fg_colour=0xffdf00,
    		-- X and Y coordinates, relative to the centre of Conky, in pixels.
    		x=65, y=40,
    		-- Radius of our pie, in pixels.
    		radius=79,
    		-- Angle to rotate the pie, in degrees.
    		angle=90,
    		-- Reverse pie? Can be true or false.
    		reverse=false,
    		-- Shade each pie slice relative to the others.
    		shade=true,
    	},
    	{
    		name='top_mem',
    		draw_bg=false,
    		bg_colour=0x071672,
    		fg_colour=0xff8700,
    		x=65, y=40,
    		radius=79,
    		angle=90,
    		reverse=true,
    		shade=true,
    	},
    }
    
    require 'cairo'
    -- функция перекодировки цвета
    function rgb_to_r_g_b(colour, alpha)
    	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    -- сбрасываем значения
    cs, cr = nil
    --
    function draw_pie(t, pt)
    
    -- если нет окна коньков, то выходим из программы
    	if conky_window == nil then return end
    
    -- если cs равняется nil или cairo_xlib_surface_get_width(cs) не равно ширине окна коньков или cairo_xlib_surface_get_height(cs) не равно высоте окна коньков тогда
    	if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
    -- если cs существует, то сбрасываем cs и выходим
    		if cs then cairo_surface_destroy(cs) end
    -- создаем cs с параметрами окна коньков
    		cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    	end
    
    -- если cr существует, то сбрасываем cr
    	if cr then cairo_destroy(cr) end
    
    -- создаем cr с параметрами cs - параметрами окна коньков
    	cr = cairo_create(cs)
    
    -- забираем данные
    
    	local xi, yi, radius, angle, draw_bg, bg_colour, fg_colour, reverse, shade = pt['x'], pt['y'], pt['radius'], pt['angle'], pt['draw_bg'], pt['bg_colour'], pt['fg_colour'], pt['reverse'], pt['shade']
    
    -- расчитаваем место вывода диаграмм
    
    	local x, y = 0, 0	--conky_window.text_start_x, conky_window.text_start_y
    	local w, h = 350, 350	--conky_window.text_width, conky_window.text_height
    	local xc = x + w / 2. + xi
    	local yc = y + h / 2. + yi
    	local two_pi = 2 * math.pi
    
    -- выводим диаграммы
    
    	local function draw_dat_pie(start, stop, radius, colour, alpha, str)
    
    -- если направление диаграммы против часовой стрелки, тогда
    
    		if reverse then
    -- start, stop меняем на -start, -stop
    			start, stop = -start, -stop
    		end
    
    -- сохраняем параметры cr
    
    		cairo_save(cr)
    
    -- переносим центр диаграммы в расчитанную точку
    
    		cairo_translate(cr, xc, yc)
    
    -- разворачиваем диаграмму
    
    		cairo_rotate(cr, math.pi / 2 + math.rad(angle))
    
    -- делаем градиентную окраску диаграммы
    
    		pattern = cairo_pattern_create_radial(0, 0, radius * 0.95, 0, 0, radius)
    		cairo_pattern_add_color_stop_rgba(pattern, 0, rgb_to_r_g_b(colour, alpha))
    		cairo_pattern_add_color_stop_rgba(pattern, 1, 0, 0, 0, 0)
    
    -- расчитываем хорду диаграммы
    
    		local function coords()
    			local x = radius * math.cos(two_pi * start)
    			local y = radius * math.sin(two_pi * start)
    			return x, y
    		end
    
    -- начальная точка диаграммы
    
    		cairo_move_to(cr, 0, 0)
    
    -- проводим линию
    
    		cairo_line_to(cr, coords())
    
    -- если диаграмма выводится по часовой стрелке, тогда
    
    		if not reverse then
    
    -- рисуем дугу по часовой стрелке
    
    			cairo_arc(cr, 0, 0, radius, two_pi * start, two_pi * stop)
    
    -- иначе, если диаграмма выводится против часовой стрелке
    
    		else
    
    -- рисуем дугу против часовой стрелке
    
    			cairo_arc_negative(cr, 0, 0, radius, two_pi * start, two_pi * stop)
    		end
    
    -- заканчиваем вывод сектора диаграммы
    
    		cairo_line_to(cr, 0, 0)
    		cairo_close_path(cr)
    -- окрашиваем сектор
    		cairo_set_source(cr, pattern)
    		cairo_pattern_destroy(pattern)
    		cairo_fill(cr)
    		cairo_set_source(cr, pattern)
    -- ------------------------------------------------- вывод текста ---------------------
    -- если str существует, тогда
    		if str then
    -- задействуем extents
    			local extents = cairo_text_extents_t
    -- разворачиваем текст
    			cairo_rotate(cr, (start + (stop - start) / 2) * two_pi + math.pi)
    -- назначаем цвет текста - в данном случае белый
    			cairo_set_source_rgba(cr, 0, 0, 0, alpha)
    -- назначаем шрифт
    			cairo_select_font_face(cr, "PT Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
    -- назначаем размер шрифта
    			cairo_set_font_size(cr, radius * 0.10)
    -- назначаем место вывода текста
    			cairo_move_to (cr, -radius + radius * 0.075, radius * 0.03)
    -- выводим текст
    			cairo_show_text(cr, str)
    		end
    -- восстанавливаем cr
    		cairo_restore(cr)
    	end
    -- ------------------------------------ конец вывода текста ----------------------------
    
    -- если используем фон, т.е. окружность на которую выводится диаграмма, тогда загружаем данные фона
    
    	if draw_bg then	draw_dat_pie(0, 1, radius, bg_colour, 1) end
    -- сбрасываем значение p на 0
    	local p = 0
    -- загружаем в f значение 
    	local f = t[1]['value'] / 100
    
    	for i in pairs(t) do
    		local v = t[i]['value']
    		local str = string.format('%.1f %s', v, t[i]['name'])
    		v = v / 100
    -- если используем тень, тогда загружаем данные тени
    		if shade then
    			draw_dat_pie(p, p + v, radius * 0.94, fg_colour, v / p, str)
    -- иначе загружаем данные без тени
    		else
    			draw_dat_pie(p, p + v, radius * 0.94, fg_colour, 1, str)
    		end
    
    
    		p = p + v
    	end
    -- сбрасываем cr
    	cairo_destroy(cr)
    	cr = nil
    end
    
    function conky_cairo_cleanup()
    -- сбрасываем значения cs
    	cairo_surface_destroy(cs)
    	cs = nil
    end
    
    -- Compatibility: Lua-5.1
    -- thanks to Lua users wiki for this
    function split(str, pat)
    	local t = {}  -- NOTE: use {n = 0} in Lua-5.0
    	local fpat = "(.-)" .. pat
    	local last_end = 1
    	local s, e, cap = str:find(fpat, 1)
    	while s do
    		if s ~= 1 or cap ~= "" then
    			table.insert(t, cap)
    		end
    		last_end = e+1
    		s, e, cap = str:find(fpat, last_end)
    	end
    	if last_end <= #str then
    		cap = str:sub(last_end)
    		table.insert(t, cap)
    	end
    	return t
    end
    
    function tablify_top(t)
    	local ret = {}
    	for i in pairs(t) do
    		table.insert(ret, {
    			value=tonumber(string.match(t[i], '(%d+%.%d+)')), name=string.match(t[i], '%d+%.%d+ ([%w_]+)')
    		})
    	end
    	return ret
    end
    
    function conky_pie_time()
    	local function pie_me(pt)
    		local str = ''
    		local sort_key = ''
    		if pt['name'] == 'top' then
    			sort_key = 'cpu'
    		elseif pt['name'] == 'top_mem' then
    			sort_key = 'mem'
    		elseif pt['name'] == 'top_io' then
    			sort_key = 'io_perc'
    		else
    			print('Invalid top type')
    			return
    		end
    -- будем выводить 10 секторов
    		for i=1,10 do
    			str = str .. string.format('${%s %s %i} ${%s name %i}\n', pt['name'], sort_key, i, pt['name'], i)
    		end
    
    
    		str = conky_parse(str)
    		local tbl = split(str, '\n')
    		tbl = tablify_top(tbl)
    		draw_pie(tbl, pt)
    	end
    
    	for i in pairs(settings_table) do
    		pie_me(settings_table[i])
    	end
    end
    --[[ END PIE WIDGET ]]
    -- ------------------------------------------------------------------------------------
    
    --function rgb_to_r_g_b(colour,alpha)
    --  return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    --end
    
    --[[ BACKGROUND WIDGET by londonali1010 (2009)]]
    function background(cr)
      local w=conky_window.width
      local h=conky_window.height
    -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
      local corner_r=45
    -- Set the colour of your background.
      local bg_colour=0x000000
    -- Set the transparency (alpha) of your background.
      local bg_alpha=0.4
    
      cairo_move_to(cr,corner_r,0)
      cairo_line_to(cr,w-corner_r,0)
      cairo_curve_to(cr,w,0,w,0,w,corner_r)
      cairo_line_to(cr,w,h-corner_r)
      cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
      cairo_line_to(cr,corner_r,h)
      cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
      cairo_line_to(cr,0,corner_r)
      cairo_curve_to(cr,0,0,0,0,corner_r,0)
      cairo_close_path(cr)
    
      cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
      cairo_fill(cr)
    end
    --[[ END BACKGROUND WIDGET ]]
    -- ----------------------------------------------------------------------
    --[[ TEXT WIDGET ]]
    
    	function addzero100(num)
    
    		if tonumber(num) < 10 then
    		return "00" .. num
    		elseif tonumber(num) <100 then
    		return "0" .. num
    		else
    		return num
    		end
    	end
    
    	function string:split(delimiter)
    
    		local result = { }
    		local from  = 1
    		local delim_from, delim_to = string.find( self, delimiter, from  )
    		while delim_from do
    		table.insert( result, string.sub( self, from , delim_from-1 ) )
    		from  = delim_to + 1
    		delim_from, delim_to = string.find( self, delimiter, from  )
    		end
    		table.insert( result, string.sub( self, from  ) )
    		return result
    	end
    
    	function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
    
    		local inum=string.len(text)
    		range=finish
    		deg=(finish-start)/(inum-1)
    		degrads=1*(math.pi/180)
    		local textcut=string.gsub(text, ".", "%1@@@")
    		texttable=string.split(textcut, "@@@")
    		for i = 1,inum do
    			ival=i
    			interval=(degrads*(start+(deg*(i-1))))+var1
    			interval2=degrads*(start+(deg*(i-1)))
    			txs=0+radi*(math.sin(interval))
    			tys=0-radi*(math.cos(interval))
    			cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    			cairo_set_font_size (cr, fsize);
    			cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
    			cairo_move_to (cr, txs+horiz, tys+verti);
    			cairo_rotate (cr, interval2)
    			cairo_show_text (cr, (texttable[i]))
    			cairo_rotate (cr, -interval2)
    		end
    	end
    
    	function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
    
    		local inum=string.len(text)
    		deg=(start-finish)/(inum-1)
    		degrads=1*(math.pi/180)
    		local textcut=string.gsub(text, ".", "%1@@@")
    		texttable=string.split(textcut, "@@@")
    		for i = 1,inum do
    			ival=i
    			interval=(degrads*(start-(deg*(i-1))))+var1
    			interval2=degrads*(start-(deg*(i-1)))
    			txs=0+radi*(math.sin(interval))
    			tys=0-radi*(math.cos(interval))
    			cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    			cairo_set_font_size (cr, fsize);
    			cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
    			cairo_move_to (cr, txs+horiz, tys+verti);
    			cairo_rotate (cr, interval2+(180*math.pi/180))
    			cairo_show_text (cr, (texttable[i]))
    			cairo_rotate (cr, -interval2-(180*math.pi/180))
    		end
    	end
    
    	function conky_draw_text()
    
    		local updates=conky_parse('${updates}')
    		update_num=tonumber(updates)
    		if update_num > 5 then
    			if conky_window==nil then return end
    			local w=conky_window.width
    			local h=conky_window.height
    			local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    			cr=cairo_create(cs)
    
    
    
    --circlewriting variable
    cpu=tonumber(conky_parse('${CPU}'))
    --text must be in quotes
    text=("CPU " .. (addzero100(cpu)) .. "%") 
    --font name must be in quotes
    font="PT Sans"
    fontsize=12
    radius=82
    positionx=240
    positiony=215
    colorred=1
    colorgreen=0.7
    colorblue=0
    coloralpha=1
    --to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
    --eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
    start=280
    finish=350
    letterposition=0
    circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
    
    --circlewritingdown variables
    hdd=tonumber(conky_parse('${fs_used_perc /}'))
    --text must be in quotes
    text=("FILESYS " .. (addzero100(hdd)) .. "%") 
    --font name must be in quotes
    font="PT Sans"
    fontsize=12
    radius=82
    positionx=240
    positiony=215
    colorred=1
    colorgreen=0.7
    colorblue=0
    coloralpha=1
    --to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
    --eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
    start=10
    finish=80
    letterposition=0
    circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
    
    --circlewritingdown variable
    mem=tonumber(conky_parse('${memperc}'))
    --text must be in quotes
    text=("MEMORY " .. (addzero100(mem)) .. "%")
    --font name must be in quotes
    font="PT Sans"
    fontsize=12
    radius=90
    positionx=240
    positiony=215
    colorred=1
    colorgreen=0.7
    colorblue=0
    coloralpha=1
    --to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
    --eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
    start=260
    finish=190
    letterposition=0.06
    circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
    
    --circlewriting variables
    swap=tonumber(conky_parse('${swapperc}'))
    --text must be in quotes
    text=("SWAP " .. (addzero100(swap)) .. "% ") 
    --font name must be in quotes
    font="PT Sans"
    fontsize=12
    radius=90
    positionx=240
    positiony=215
    colorred=1
    colorgreen=0.7
    colorblue=0
    coloralpha=1
    --to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
    --eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
    start=170
    finish=100
    letterposition=0
    circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
    
    
    		end
    	end
    --[[ END TEXT WIDGET ]]
    -- ---------------------------------------------------------------
    --[[ EQUALIZER WIDGET
    	v1.0 by wlourf (10 Feb. 2010)
    	This widget draw a simple bar like (old) equalizers on hi-fi systems.
    	http://u-scripts.blogspot.com/
    	
    	The arguments are :
    	- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        - "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. 
        	If you would not use an argument in the Conky variable, use ''.
    	- "max" is the maximum value of the bar. If the Conky variable outputs a percentage, use 100.
    	- "nb_blocks" is the umber of block to draw
    	- "cap" id the cap of a block, possibles values are CAIRO_LINE_CAP_ROUND , CAIRO_LINE_CAP_SQUARE or CAIRO_LINE_CAP_BUTT
    	  see http://www.cairographics.org/samples/set_line_cap/
    	- "xb" and "yb" are the coordinates of the bottom left point of the bar
    	- "w" and "h" are the width and the height of a block (without caps)
    	- "space" is the space betwwen two blocks, can be null or negative
    	- "bgc" and "bga" are background colors and alpha when the block is not LIGHT OFF
    	- "fgc" and "fga" are foreground colors and alpha when the block is not LIGHT ON
    	- "alc" and "ala" are foreground colors and alpha when the block is not LIGHT ON and ALARM ON
    	- "alarm" is the value where blocks LIGHT ON are in a different color (values from 0 to 100)
    	- "led_effect" true or false : to show a block with a led effect
    	- "led_alpha" alpha of the center of the led (values from 0 to 1)
    	- "smooth" true or false : colors in the bar has a smooth effect
    	- "mid_color",mid_alpha" : colors of the center of the bar (mid_color can to be set to nil)
    	- "rotation" : angle of rotation of the bar (values are 0 to 360 degrees). 0 = vertical bar, 90 = horizontal bar
    	
    ]]
    
    function equalizer(cr, name, arg, max, nb_blocks, cap, xb, yb, w, h, space, bgc, bga, fgc, fga,alc,ala,alarm,led_effect,led_alpha,smooth,mid_color,mid_alpha,rotation)
     	local function rgb_to_r_g_b(colour, alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    local cap_round = CAIRO_LINE_CAP_ROUND
    	local cap_square = CAIRO_LINE_CAP_SQUARE
    	local cap_butt = CAIRO_LINE_CAP_BUTT	
    
    	local function setup_equalizer()
    		
    		local str = conky_parse(string.format('${%s %s}', name, arg))
    		
    		local value = tonumber(str)
    		if value == nil then value = 0 end
    if value <= 100 then max = 50 end
    		local pct = 100*value/max
    		local pcb = 100/nb_blocks
    		
    		cairo_set_line_width (cr, h)
    		cairo_set_line_cap  (cr, cap)
    		
    		local angle= rotation*math.pi/180
    		for pt = 1,nb_blocks do  
    			local light_on=false
    			--set colors
    			local col,alpha = bgc,bga
    			if pct>=(100/nb_blocks/2) then --start after an half bloc
    				if pct>=(pcb*(pt-1)) then 
    					light_on=true
    					col,alpha = fgc,fga
    					if pct>=alarm and (pcb*pt)>alarm then col,alpha = alc,ala end
    				end
    			end
    
    			--vertical points
    			local x1=xb
    			local y1=yb-pt*(h+space)
    			local radius0 = yb-y1
    	
    			local x2=xb+radius0*math.sin(angle)
    			local y2=yb-radius0*math.cos(angle)
    			
    			--line on angle
    			local a1=(y2-yb)/(x2-xb)
    			local b1=y2-a1*x2
    
    			--line perpendicular to angle
    			local a2=-1/a1
    			local b2=y2-a2*x2
    			
    			--dots on perpendicular
    			local xx0,xx1,yy0,yy1=0,0,0,0
    			if rotation == 90  or rotation == 270 then
    				xx0,xx1=x2,x2
    				yy0=yb
    				yy1=yb+w
    			else
    				xx0,xx1=x2,x2+w*math.cos(angle)
    				yy0=xx0*a2+b2
    				yy1=xx1*a2+b2
    			end
    
    			--perpendicular segment
    			cairo_move_to (cr, xx0 ,yy0)
    			cairo_line_to (cr, xx1 ,yy1)
    		
    			--colors
    			local xc,yc=(xx0+xx1)/2,(yy0+yy1)/2
    			if light_on and led_effect then
    				local pat = cairo_pattern_create_radial (xc, yc, 0, xc,yc,w/1.5)
    				cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col,led_alpha))
    				cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col,alpha))
    				cairo_set_source (cr, pat)
    				cairo_pattern_destroy(pat)
    			else
    				cairo_set_source_rgba(cr, rgb_to_r_g_b(col,alpha))
    			end 
    
    			if light_on and smooth then
    				local radius = (nb_blocks+1)*(h+space)
    				if pt==1 then 
    					xc0,yc0=xc,yc --remember the center of first block
    				end
    				cairo_move_to(cr,xc0,yc0)
    				local pat = cairo_pattern_create_radial (xc0, yc0, 0, xc0,yc0,radius)
    				cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(fgc,fga))
    				cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(alc,ala))
    				if mid_color ~=nil then
    					cairo_pattern_add_color_stop_rgba (pat, 0.5,rgb_to_r_g_b(mid_color,mid_alpha))
    				end
    				cairo_set_source (cr, pat)
    				cairo_pattern_destroy(pat)
    			end 
    		
    			cairo_stroke (cr);
    
    		end
    	end	
    	--prevent segmentatioon error
    	local updates=tonumber(conky_parse('${updates}'))
    	if updates> 3 then
    		setup_equalizer()
    	end
    end
    
    -- -------------------------------------------------------------------------------------
    	function conky_widgets()
    		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)
    	background(cr)
    	cairo_destroy(cr)
    -- ---------------------------------------
    	cr = cairo_create(cs)
    	conky_pie_time()
    	cairo_destroy(cr)
    
    --[[ Вывод часов ]]
      
    	cr = cairo_create(cs)
    	clock(cr, 165, 140, 150, 0xffffff, 1, 0x606070, 1)
    	cairo_destroy(cr)
    -- ---------------------------------------------------------------------------------
    
    	cr = cairo_create(cs)
    	calendar()
    	cairo_destroy(cr)
    
    -- -------------------------------------------------------------------
    	cr = cairo_create(cs)
    	conky_draw_text()
    	cairo_destroy(cr)
    -- ------------------------------------------------------------
    
    
    cr = cairo_create(cs)
    
    equalizer(cr, 'downspeedf', 'eth0', 1000, 10, CAIRO_LINE_CAP_ROUND, 215, 111, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)
    
    equalizer(cr, 'upspeedf', 'eth0', 100, 10, CAIRO_LINE_CAP_ROUND, 215, 317, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)
    
    	cairo_destroy(cr)
    
    
    end

  8. #198
    Join Date
    Aug 2009
    Location
    East of Atlantic
    Beans
    81
    Distro
    Ubuntu

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by degan View Post
    Hi boys....

    How do I do to remove the shade that I have in the conky?
    hi, it's very simple : don't call the background widget in the conky_widgets() function
    delete or comment theses three lines :
    Code:
        cr = cairo_create(cs)
        background(cr)
        cairo_destroy(cr)

  9. #199
    Join Date
    Sep 2008
    Location
    Italy Varese..
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    This:

    --[[ Вывод часов ]]

    cr = cairo_create(cs)
    clock(cr, 165, 140, 150, 0xffffff, 1, 0x606070, 1)
    cairo_destroy(cr)
    -- ---------------------------------------------------------------------------------

    cr = cairo_create(cs)
    calendar()
    cairo_destroy(cr)

    -- -------------------------------------------------------------------
    #cr = cairo_create(cs)
    #conky_draw_text()
    #cairo_destroy(cr)
    -- ------------------------------------------------------------


    cr = cairo_create(cs)

    equalizer(cr, 'downspeedf', 'eth0', 1000, 10, CAIRO_LINE_CAP_ROUND, 215, 111, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)

    equalizer(cr, 'upspeedf', 'eth0', 100, 10, CAIRO_LINE_CAP_ROUND, 215, 317, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)

    cairo_destroy(cr)


    end

  10. #200
    Join Date
    Feb 2008
    Location
    I'm lost ... HELP!
    Beans
    1,014
    Distro
    Xubuntu

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by HangukMiguk View Post
    took the pound sign out, still not working. still showing up as black.
    Ok, didn't want to complain about it earlier, since it looked like a easy problem. But your question is kind of off-topic in this thread. This thread is for scripts people use in combination with conky (like weather scripts, calendar scripts) and not about the .conkyrc configuration script you use with conky.

    The Post your .conkyrc files w/ screenshots mega thread is a better place to ask help.

    Ok, that's enough nagging

    Colors are working fine here. Try my test conky if you like:
    Code:
    # Info on stuff above TEXT here : http://conky.sourceforge.net/config_settings.html
    # Info on stuff below TEXT here : http://conky.sourceforge.net/variables.html
    #
    minimum_size 256 512
    maximum_width 1366
    gap_x 1
    gap_y 1
    #alignment bm
    update_interval 2.0
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    uppercase no
    own_window yes
    own_window_type normal # normal desktop override
    own_window_transparent no # yes no
    own_window_hints skip_taskbar,skip_pager # undecorated,below,above,sticky,skip_taskbar,skip_pager
    own_window_colour black
    double_buffer yes
    use_xft yes
    xftfont Radio Space Bold:size=8 # get font at http://www.dafont.com/radio-space.font
    default_color white
    text_buffer_size 1024 # The size of this buffer cannot be smaller than the default value of 256 bytes. 
    
    #${color green}1 / TRUE / YES${color}${else}${color red}0 / FALSE / NO${color}${endif}
    #no test ${font sans:size=8}^_^${font}
    
    TEXT
    ${color yellow}build_arch ${conky_build_arch}
    build_date ${conky_build_date}
    conky_version ${conky_version}${color}
    
    ${color green}start test${color}
    
    default color ${color 00CCCC} color=00CCCC ${color} default color
    
    ${color red}end test${color}
    
    ${color yellow}${kernel}
    ${machine}${if_match "${battery}" != "not present"}${if_match "${execi 60 cat /proc/acpi/battery/BAT0/state | grep charged | awk '{print $3}'}" != "charged"}
    
    ${execi 60 cat /proc/acpi/battery/BAT0/state | grep capacity: | awk '{print $3 $4}'}
    ${execi 60 cat /proc/acpi/battery/BAT0/state | grep rate: | awk '{print $3 $4}'}
    ${battery_time}${endif}${endif}${color}
    Attached Images Attached Images

Page 20 of 32 FirstFirst ... 10181920212230 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •