Conky - Show It! Share your Conky

Not a Section for this yet, to share conky stuff so thought I’d post and hope the section gets stickied.
I’ve not installed EndeavourOS yet, but have been working on this for a few months so thought I’d post it.

I’d like to introduce Conky-Sandwich_v3

Here is an excerpt from the readme…be sure to read the whole readme file!

What is Conky-Sandwich?
It is a useless creation designed to distract you LMAO

Well, originally it started with just pictures of delicious yummy sandwiches.
On different day of month it would get a picture of a sandwich.
I couldn't stop there so I figured if can get the image, why not the recipe,
or screenshot of a webpage with the recipe so you can look it up if it looks yummy enough.

Well that expanded into getting 4 yummy images every day of the month,
and then change the image every 15 Minutes.

It goes out and screenshots a webpage and saves it as an image file for conky to resize
and display it.

Here is a shot of my desktop with Conky-Sandwich_v1

Here is the video Of Conky-Sandwich_v3

This post has been long enough, so I hope you all take my jests with stride, maybe it’s the vodka idk LMAO

Here is the conky in my dropbox, I’ll let you look, judge, tell me what you think.
although having showed the video to a few people the first thing they said was. “Does it show the whole/download recipe?”

The screenshot conversion tool will let you convert a site to pdf…so I was thinking download to a folder, or even email you the pdf?

--Conky-Sandwich - A Useless Creation by Mr Ed 2019
--A food window display for conky
--Using Archlinux-Antergos/EndeavourOS an in-between thing lol
--At this time Food network has,
--765 pages of sandwiches related recipes
--457 pages of burgers related recipes
--421 pages of pizza related recipes
--If there was 31 days in every month, conky-sandwich can display 372 yummy images
--4 per day every day of the month
requires install wkhtmltopdf for html to pdf and image, it's in the repo
2 Likes

@MrEd
First of all nice to see you here and thank you for your contribution on this. To me this is a new one.

1 Like

i love the conky-sandwich! :sandwich: This should be the only app we ship by default
//@MrEd i do edit your post to show video and downloadlink correctly, urls are detected automatic to fit what they are… no tags needed)

2 Likes

Don’t care for sandwitches, but a working GUI tool for Conky would be awesome. All I want is my system monitoring (such as CPU usage and speed, memory usage, disk usage) on my desktop. The existing ones are either ugly or don’t have all I want. :thinking:

1 Like

For anyone that likes big clocks

conky-ednix
A nixie clock by MrEd 2019
No mystical scripts done with sorcery with this one, but there was a little photoshop trickey haha
Comes with 3 backgrounds, no background, and with small setting adjustment, no shadowbox background
uses NixieOne.ttf font





Stock setting should run this on your main monitor

Download

If you prefer it with day moved, here is the code
${alignc}${voffset -162}${color6}${font Nixie One:bold:size=12}Day - ${time %j}${font}${voffset} #Day of the year

1 Like

I had something odd happen, last night.
My conky-sandwich was reloading and updating to the 17th day.
Several of my conky clocks went all wonky

actual time was 12:27am

That was wierd, but also, my sandwich didn’t load, so.
Idk if they could be related, but, found an error in food.sh
for conky-sandwich

goto the 17th day and change

wkhtmltopdf
to
wkhtmltoimage

I thought I triple checked all that stuff…ggrrrrrr

I am curious if that’s a possible side affect on clocks if cocky breaks somehow

Thankyou,
that is all :stuck_out_tongue:

1 Like

We need to have some tutorials on conky. What will it work on? What do you need to install? What can i use it for? How do we do it? Interested in stuff like this and weather and what ever. Haven’t used it don’t know anything about it. If it can be used on Cinnamon and Plasma etc.

image

1 Like

https://www.deviantart.com/custom-linux/gallery/39357745/conky-themes?

https://wiki.archlinux.org/index.php/conky

I found these on the Manjaro forum a few months ago.

## conky 

background no

# Window
own_window_argb_visual true
own_window_type desktop
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Graphics
double_buffer yes
override_utf8_locale yes
use_xft yes
xftfont NotoSans-Bold:size=14
xftalpha 1.0
update_interval 1
uppercase no
default_outline_color black
default_shade_color black
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no

text_buffer_size 1028 # 256 is minimum
no_buffers yes
short_units yes
pad_percents 2
#top_name_width 10

# Layout
alignment tl
gap_x 30
gap_y 30

minimum_size 300 5
maximum_width 400

#color0 1a5adb
#color1 1a5adb
#color2 2f2f2f
color0 9a9a9a
color1 dddddd
#color2 2f2f2f

TEXT

$alignc ${color1}EndeavourOS
$alignc ${color1}${execi 10000 awk -F= '/TION/ {print $2}' /etc/lsb-release |sed 's/"//g'}${color0}
$alignc ${color1}${execi 10000 awk -F= '/EASE=/ {printf $2" "} /NAME/ {print $2}' /etc/lsb-release}${color0}
$alignc ${color1}${kernel}${color0}

$alignc Time
${color1}${time %A} ${alignr}${time %B %e}${color0}
Current Time ${color1}${alignr}${time %l:%M %p}${color0}
Uptime ${color1}${alignr}${uptime_short}${color0}
Julian ${color1}${alignr}${time %j}${color0}
 
$alignc CPU: ${color1}${hwmon 1 temp 1}°C ${color0}
CPU1: ${color1}${cpu cpu1}%${alignr}${color0}${cpubar cpu1 14,70}${color0}
CPU2: ${color1}${cpu cpu2}%${alignr}${color0}${cpubar cpu2 14,70}${color0}
  
$alignc RAM
$alignc ${color1}${mem} / ${memfree} / ${memmax} ${color0}
  
$alignc HDD
$alignc ${color1}${fs_used /} / ${fs_free /} / ${fs_size /} ${color0}
#  |   |__${color0}${fs_used /mnt/sda3} / ${fs_free /mnt/sda3} / ${fs_size /mnt/sda3} $alignr${fs_used_perc /mnt/sda3}%${color0}
  
$alignc PROCESSES
${color1}${top_mem name 1}${alignr}${top mem 1}%${color0}
${color1}${top_mem name 2}${alignr}${top mem 2}%${color0}
${color1}${top_mem name 3}${alignr}${top mem 3}%${color0}
${color1}${top_mem name 4}${alignr}${top mem 4}%${color0}
${color1}${top_mem name 5}${alignr}${top mem 5}%${color0}
${color1}${top_mem name 6}${alignr}${top mem 6}%${color0}
${color1}${top_mem name 7}${alignr}${top mem 7}%${color0}
${color1}${top_mem name 8}${alignr}${top mem 8}%${color0}
${color1}${top_mem name 9}${alignr}${top mem 9}%${color0}
#${color1}${top_mem name 10}${alignr}${top mem 10}%${color0}
  
#$alignc DISK I/O
#${color0}Read: ${color1}${diskio_read /dev/sda1}${alignr}${color0}${diskiograph_read 14,70}${color0}
#${color0}Write: ${color1}${diskio_write /dev/sda1}${alignr}${color0}${diskiograph_write 14,70}${color0}
#    
$alignc NETWORK
DL: ${color1}${downspeed enp1s6}/s${alignr}${color0}${downspeedgraph enp1s6 14,70}${color0}
UL: ${color1}${upspeed enp1s6}/s${alignr}${color0}${upspeedgraph enp1s6 14,70}${color0}

The guages: cpu, cpu, ram, upspeed, downspeed
~ I like them because I can monitor what’s happening when I’m surfing.

gauges-shot

guages conky

############# -- Conky settings -- by giancarlo64 --#
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

minimum_size 150 26
maximum_width 200 
alignment tl
gap_x 110
gap_y 2

own_window yes
own_window_argb_visual true
own_window_transparent yes
own_window_type desktop
#own_window_class Conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

border_inner_margin 0
border_outer_margin 0

# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# -- Lua load -- #
lua_load /home/keith/.conky/gauges.lua
lua_draw_hook_post draw_panel

TEXT

gauges.lua

--[[SILVER_CONKY v1.0 by Giancarlo64 24 Sett. 2012

http://giancarlo64.deviantart.com

]]
require 'cairo'


	
local graphs={}

function conky_draw_panel()


	local  bar_settings={
		x=0,y=0,
        height=60, 	 width=340,
        corners={{"circle",20}, {"circle",20}, {"circle",20}}, 
        colour={ {0     	,0x112e44,0},
               {0.5	,0xffffff,0},
                {1     	,0x112e44,0}
	                },
	    
		}
	
	main_colour={{0    	,0xffffff,0.7},
                {0.50	,0xffffff,0.7},
                {0.80  	,0xffffff,0.7}
                }
	
    local widgets_settings={
		
		--cpu circle
		{
		name="cpu",		arg="cpu1",        max=100,  
		xw=14 ,  
		yw=15,
		xt=39,
                yt=38,
		font_size=12, bold=false, 
		angle=0,
		h_align="c",
		v_align="m",
                radius=32,
--              thickness=5,
		colour=main_colour,
		start=0,
		inverse=false
		},
		{
		name="cpu",		arg="cpu2",        max=100,  
		xw=44 ,
		yw=15,
		xt=250,	yt=38,
		font_size=12,		bold=false,
		v_align="m",
                start=0,
                radius=32,
--              thickness=5,
		colour=main_colour,
		},
		{
		name="memperc",		arg="",        max=100,  
		xw=74 ,
		yw=15,
		xt=250,	yt=38,
		font_size=12,		bold=false,
		v_align="m",
                start=0,
                radius=32,
--              thickness=5,
		colour=main_colour,
		},
		{
		name="downspeedf",		arg="enp1s6",        max=100,  
		xw=104 ,
		yw=15,
		xt=250,	yt=38,
		font_size=12,		bold=false,
		v_align="m",
                start=0,
                radius=32,
--              thickness=5,
		colour=main_colour,
		},
		{
		name="upspeedf",		arg="enp1s6",        max=100,  
		xw=134 ,
		yw=15,
		xt=250,	yt=38,
		font_size=12,		bold=false,
		v_align="m",
                start=0,
                radius=32,
--              thickness=5,
		colour=main_colour,
		},
				
		}	
--END EXAMPLE 1}}    
    
   



    
--------------END OF PARAMETERS----------------

    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)
	if bar_settings.x == nil then bar_settings.x=0 end
	if bar_settings.y == nil then bar_settings.y=0 end

	display_background(cs,bar_settings)
	
    for i,v in pairs(widgets_settings) do  
		v.number=i
		if v.style=="graph" and graphs[i] == nil then
			graphs[i]={}
			print ("setup graph " .. tostring(i) .. " at update :" .. conky_parse("$updates"))
			if v.width== nil then v.width=100 end
			for x=1, v.width do graphs[i][x]=0 end
		end
		--graphs[i][1]=0
        cr = cairo_create (cs)
        cairo_translate(cr,bar_settings.x,bar_settings.y)
        display_widget(v,bar_settings)
        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 set_pattern(t,pts)
	--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 = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
		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
    
function display_background(cs,b)

    
    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   

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

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


   --check values and set default values
    if b.height == nil then b.height = conky_window.height end   
    if b.width == nil then b.width = conky_window.width end   
   
    b.w,b.h = b.width,b.height
    if b.w == nil then b.w = conky_window.width end
    if b.h == nil then b.h = conky_window.height end
    if b.colour==nil then b.colour={{0     	,0xffffff,1},
                --{0.5	,0xeeeeee,1},
                --{1     	,0xaaaaaa,1}
                } end

	if b.corners == nil then b.corners={ {"line",0} } end
		local t_corners = {}
		local t_corners = table.copy(b.corners)
		--don't use t_corners=b.corners otherwise b.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],b.width,0}
		t_corners[3]={t_corners[3][1],t_corners[3][2],b.width,b.height}    
		t_corners[4]={t_corners[4][1],t_corners[4][2],0,b.height}    	
	



    for i=1, #b.colour do    
        if #b.colour[i]~=3 then 
            print ("error in background color table")
            bar.colour[i]={1,0xFFFFFF,1} 
        end
    end	
	cr = cairo_create (cs)
    set_pattern(b,{b.x,b.y,b.x,b.x+b.height})
	
	--cairo_rectangle(cr,b.x,b.y,b.width,b.height)
	cairo_translate(cr, b.x, b.y)
	local tc=t_corners
    cairo_move_to(cr,tc[1][2],0)
    cairo_line_to(cr,b.w-tc[2][2],0)
    draw_corner(2,tc[2])
    cairo_line_to(cr,b.w,b.h-tc[3][2])
    draw_corner(3,tc[3])
    cairo_line_to(cr,tc[4][2],b.h)
    draw_corner(4,tc[4])
    cairo_line_to(cr,0,tc[1][2])
    draw_corner(1,tc[1])
    
	cairo_fill(cr)
	cairo_destroy(cr)
end    


function display_text(t,b,te)
	
   -- if t.clear then
	--	cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
	--else
	--	set_pattern(t,{0,0,0,b.height})
	--end
	
	cairo_save(cr)
    cairo_translate(cr,t.xt,t.yt)
    cairo_rotate(cr,t.angle*math.pi/180)
            
    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)
    cairo_stroke(cr)
	cairo_restore(cr)

end



function display_widget(t,bar)
    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
    
    --set default values if needed
    if t.style == nil then t.style = "circle" end
    if t.style ~= "text" then    
		if t.name==nil and t.arg==nil then 
			print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ") 
			return
		end
		if t.max==nil then
			print ("No maximum value defined, use 'max'")
			return
		end
	end
    if t.name==nil then t.name="" end
	if t.arg==nil then t.arg="" end

    if t.text==nil then t.text="" end
    if t.xt==nil then t.xt = bar.width/2 end
    if t.yt==nil then t.yt = bar.height/2 end
    
    if t.angle==nil then t.angle=0 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,1}} end
    if t.font_name==nil then t.font_name="Free Sans" end
    if t.font_size==nil then t.font_size=14 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.radius == nil then t.radius = 90 end
    --if t.radius > 100 then t.radius = 100 end
	if t.start==nil then t.start = 0 end
	if t.inverse==nil then t.inverse=false end
	if t.hand==nil then t.hand=0 end
	if t.thickness== nil then t.thickness = 2 end
	if t.draw_border==nil then t.draw_border=true end
	
	if t.width== nil then t.width = 100 end
	if t.height==nil then t.height=10 end
	if t.t_align== nil then t.t_align = "l" end
	if t.b_align== nil then t.b_align = "l" 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.style=="text" and t.yt==nil then t.yt = conky_window.height/2 end
	
	if t.style=="bar" then
		if t.xw == nil then t.xw = bar.width/2 end
		if t.yw == nil then t.yw = bar.height*0.52 end
        if t.width == nil then t.width = 100 end
        if t.height == nil then t.height = 10 end
    end
    
    if t.style=="circle" then
		if t.yw == nil then t.yw = bar.height/2 end
		if t.xw == nil then t.xw = bar.width/2 end
	end
    
    if t.style=="graph" then
		if t.xw == nil then t.xw = bar.width/2 end
		if t.yw == nil then t.yw = bar.height*0.52 end
		if t.auto_scale== nil then t.auto_scale=false end
		if t.fill_graph== nil then t.fill_graph=false end
	end
	if t.xw == nil then t.xw = t.xt end
    if t.yw == nil then t.yw = t.yt end
	if t.yt == nil then t.yt = t.yw 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    

    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


	
    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

    cairo_select_font_face(cr, t.font_name, slant,weight)
    cairo_set_font_size(cr,t.font_size)
    local te=cairo_text_extents_t:create()
    tolua.takeownership(te) 
    t.text=conky_parse(t.text)
    cairo_text_extents (cr,t.text,te)
    
    if t.clear then
		cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
	else
		--set_pattern(t,{bar.height/2,0,-bar.height/2,0})
		set_pattern(t,{0,0,0,bar.height})
	end
	
	if t.style=="circle" then 
		display_circle(t,bar,te)
	elseif t.style=="bar" then
		display_bar(t,bar,te)
	elseif t.style == "text" then
		display_text(t,bar, te)
	elseif t.style=="graph" then
		display_graph(t,bar, te)
	end
	
end

function get_value(t)
	local value = 0

	if t.name ~="" then
		value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
		--$to_bytes doesn't work when value has a decimal point,
		--https://garage.maemo.org/plugins/ggit/browse.php/?p=monky;a=commitdiff;h=174c256c81a027a2ea406f5f37dc036fac0a524b;hp=d75e2db5ed3fc788fb8514121f67316ac3e5f29f
		--http://sourceforge.net/tracker/index.php?func=detail&aid=3000865&group_id=143975&atid=757310
		--conky bug?
		--value = (conky_parse(string.format('${%s %s}', t.name, t.arg)))
		--if string.match(value,"%w") then
		--	value = conky_parse(string.format('${to_bytes %s}',value))
		--end
	else
		value = tonumber(t.arg)
	end

	if value==nil then value =0 end
	return value
end


function display_circle(t,b,te)
	
	if t.text ~= "" then  display_text(t,b,te) end

	cairo_save(cr)
    cairo_translate(cr,t.xw,t.yw)
    cairo_rotate(cr,-math.pi/2)
	    
	local r = b.height*t.radius/200
	cairo_set_line_width(cr,t.thickness)

	if t.xw == nil then
		t.xw = r+te.height+t.thickness
	else
		t.xw= t.xw-t.xt
	end	
	
	if t.draw_border then
		cairo_arc(cr,0,0,r,0,2*math.pi)
		cairo_stroke(cr)
	end

	local pct = get_value(t)/t.max	

	cairo_move_to(cr,0,0)

	cairo_rotate(cr,t.start*math.pi/180)
	if t.hand >0 then
		cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
		if t.inverse then
			cairo_rotate(cr,-2*math.pi*pct)
		else
			cairo_rotate(cr,-2*math.pi*(1-pct))
		end
		cairo_line_to(cr,t.hand*r/100,0)
		cairo_stroke(cr)
	else
		if t.inverse then
			cairo_arc_negative(cr,0,0,r,0,-2*math.pi*pct)
			else
			cairo_arc(cr,0,0,r,0,-2*math.pi*(1-pct))
		end
	end
	cairo_fill(cr)
	cairo_restore(cr)    
end

function display_bar(t,b,te)
	if t.text ~= "" then 	display_text(t,b,te) end

    cairo_translate(cr,t.xw,t.yw)
    cairo_save(cr)       

	cairo_set_line_width(cr,t.thickness)
	if t.draw_border then
		cairo_rectangle(cr,0,0,t.width,t.height)
		cairo_stroke(cr)
	end
	local pct = get_value(t)/t.max			
	cairo_move_to(cr,0,0)

	if t.inverse then
		cairo_rectangle(cr,t.width*(1-pct),0,t.width-t.width*(1-pct),t.height)
	else
		cairo_rectangle(cr,0,0,t.width*pct,t.height)
	end

	cairo_fill(cr)
	cairo_restore(cr)    
   
end

function display_graph(t,b,te)
	if t.text ~= "" then 	display_text(t,b,te) end 

    cairo_translate(cr,t.xw,t.yw)
    cairo_save(cr)  
 
	cairo_set_line_width(cr,t.thickness)
	if t.draw_border then
		cairo_rectangle(cr,0,0,t.width,t.height)
		cairo_stroke(cr)
	end
	
	local pct = get_value(t)/t.max	
	
	for i=2,t.width do 
		graphs[t.number][i-1]=graphs[t.number][i]
	end
	graphs[t.number][t.width]=get_value(t)

	local automax=0
	if t.auto_scale then 
		for i=1,t.width do 
			automax = math.max (automax,graphs[t.number][i])
		end
	else
		automax=t.max
	end

	for i=1,t.width do 
		if t.inverse then
			cairo_line_to(cr, i, (automax-graphs[t.number][t.width-i+1])/automax*t.height)
		else
			cairo_line_to(cr, i, (automax-graphs[t.number][i])/automax*t.height)
		end
	end	
	if t.fill_graph then
		cairo_line_to(cr,t.width,t.height)
		cairo_line_to(cr,0,t.height)
		cairo_close_path(cr)
		cairo_fill(cr)
	else
		cairo_stroke(cr)
	end

	cairo_restore(cr)    
   
end

3 Likes

Cowen Conky

clock%20shot

I found it here on Deviantart.

2 Likes