SEARCH

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

You are not logged in.

#7376 2014-04-16 10:18:08

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

Problem occurs in lines 167-168
Insert between them, a test lines:

print("String:", str)
print("Value:", tonumber(conky_parse(str)))

and test


Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

Be excellent to each other!

#7377 2014-04-16 12:27:39

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

Re: Conky v1.9 Thread

dk75 wrote:

Problem occurs in lines 167-168
Insert between them, a test lines:

print("String:", str)
print("Value:", tonumber(conky_parse(str)))

and test

Well that was dead on ...

Line 13:

number_of_cpus = 8 -- original 8
 16 Apr 14 | 09:00:43 ~
    $ pkill -xf "conky -c /media/5/conky/Ruuku/start_conky" &
[1] 7127
 
 16 Apr 14 | 09:00:46 ~
    $ conky -c /media/5/conky/Ruuku/start_conky &
[2] 7188
[1]   Exit 1                  pkill -xf "conky -c /media/5/conky/Ruuku/start_conky"
 
 16 Apr 14 | 09:00:53 ~
    $ Conky: forked to background, pid is 7193

Conky: desktop window (265) is root window
Conky: window type - normal
Conky: drawing to created window (0x3a00002)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
Conky: obj->data.i 4 info.cpu_count 3
Conky: attempting to use more CPUs than you have!
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu1}
Value:	6
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu2}
Value:	5
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
String:	${cpu cpu3}
Value:	7
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
conky -c /media/5/conky/Ruuku/start_conky &String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu1}
Value:	9
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu2}
Value:	11
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
String:	${cpu cpu3}
Value:	10
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
      pkill -xf "conky -c /media/5/conky/Ruuku/start_conky"  String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu1}
Value:	7
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu2}
Value:	8
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
String:	${cpu cpu3}
Value:	6
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)

[3] 7267
[2]   Done                    conky -c /media/5/conky/Ruuku/start_conky
 
 16 Apr 14 | 09:01:01 ~
    $ Conky: received SIGINT or SIGTERM to terminate. bye!

now: Line 13

number_of_cpus = 3 -- original 8

Which is what I have:

 16 Apr 14 | 09:05:40 ~
    $ conky -c /media/5/conky/Ruuku/start_conky &
[1] 9704
 
 16 Apr 14 | 09:05:41 ~
    $ Conky: forked to background, pid is 9709

Conky: desktop window (265) is root window
Conky: window type - normal
Conky: drawing to created window (0x3a00002)
Conky: drawing to double buffer
conky pkill -xf "conky -c /media/5/conky/Ruuku/start_conky"  Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:202: attempt to call global 'draw_CPU' (a nil value)

[2] 10308
Conky: received SIGINT or SIGTERM to terminate. bye!
[1]   Done                    conky -c /media/5/conky/Ruuku/start_conky
[2]+  Done                    pkill -xf "conky -c /media/5/conky/Ruuku/start_conky"
 
 16 Apr 14 | 09:05:55 ~
    $ 

Lines 200 to 207 ... with same two test lines in place

    end
  else
    draw_CPU(cr, cpu_x_start,cpu_y_start,cpu_x_step,cpu_y_step,grades, tonumber(conky_parse('${cpu cpu1}')))
  end

  draw_widget(cr, cpu_widget_x_start,cpu_widget_y_start, "CPU", 16, cpu_widget_height, cpu_widget_width)

--- Free space section ---

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

Offline

#7378 2014-04-16 16:33:10

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

Sector11 wrote:
mrpeachy wrote:

^ and off it goes, getting the top spot in the conky archive smile

But only until someone else post one  ...

Hey you two ! I've forgotten something I didn't see yet... And I want to say a big THANK to mr peachy for the archive conky idea !
Well done !
I've actualised the nasa picture of the day conky because there were changing on the website to "catch" the picture... well you may be better understand if I make a sentence with curl, lua, sed ... ? My codes traducers are Didier-T in French and Mr peachy in English big_smile
nasapic
nasa-day.sh:

#!/bin/bash
#ragamatrix'script modified#
IMG="/tmp/image_nasa.jpg"
IMGPNG="/tmp/image_nasa.png"

test=`curl -s http://www.nasa.gov/rss/dyn/image_of_the_day.rss | grep -m1 "<enclosure" | sed 's/^.*url="//' | sed 's/" len.*$//'` && wget -O $IMG $test
convert $IMG -resize 640x360 $IMGPNG

convert  $IMGPNG \
\( +clone  -alpha extract \
       -draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \
        \( +clone -flip \) -compose Multiply -composite \
        \( +clone -flop \) -compose Multiply -composite \
     \) -alpha off -compose CopyOpacity -composite $IMGPNG
     
convert $IMGPNG  -background  black  \( +clone -shadow 60x4+2+2 \) +swap -background  none   -flatten $IMGPNG

ConkyNasa:

#Display nasa picture of the day#
#=========ragamatrix's==========#

background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
double_buffer yes
no_buffers yes
text_buffer_size 1024
imlib_cache_size 0

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,skip_taskbar,skip_pager,below,sticky

border_inner_margin 1
border_outer_margin 0

minimum_size 560 380 #Taille minimum (px) ; largeur / hauteur
maximum_width 560 ##largeur

alignment br
gap_x -7
gap_y 15

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_shade_color 181818

use_xft yes
xftfont Monofur:size=12
xftalpha 1.0
uppercase no
override_utf8_locale yes
###############################
#   1h=60m=3600s              #
#   1j=24h=1440m=86400s       #
#365j=8760h=525600m=31536000s #
###############################


default_color ececec
color2 585858
color1 606060

lua_load ~/.conky/script/image.lua

TEXT
${texeci 28800 ~/.conky/script/nasa-day.sh} 
${lua conky_fDrawImage /tmp/image_nasa.png 0 0 550 370}

image.lua:

require 'cairo'
home = os.getenv ('HOME')

--Fonction d'affichage
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

cool

Last edited by ragamatrix (2014-04-16 17:30:42)

Offline

#7379 2014-04-16 20:08:03

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

Re: Conky v1.9 Thread

@ ragamatrix

I agree with you, mrpeachy came up with a very good idea with that.

NASA Pic - NICE!!!  I'll have to steal that too! I've got a {cough cough} few of yours here.  big_smile

Last edited by Sector11 (2014-04-16 20:08:44)


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

Offline

#7380 2014-04-17 01:46:25

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

Sector11 wrote:
dk75 wrote:

Problem occurs in lines 167-168
Insert between them, a test lines:

print("String:", str)
print("Value:", tonumber(conky_parse(str)))

and test

Well that was dead on ...

then use this "CPU" section instead:

	 --- CPU section ---
	 cairo_close_path(cr)
	 cairo_set_font_size (cr, 10);
	 
	 counter = 1
	 if number_of_cpus > 1 then
	 	if (number_of_cpus / 2) <= 4 then
	 		for j=0, 1 do
	 			for i=0, (math.ceil(number_of_cpus/2)-1) do
	 				if counter > number_of_cpus then break end
	 				str = '${cpu cpu' .. tostring(counter) .. '}'
	 				draw_vertical_bars_3d(cr, cpu_x_start+cpu_x_step*4*(i),cpu_y_start+(keep_y+50)*(j),cpu_x_step,cpu_y_step,grades, tonumber(conky_parse(str)))
	 				cairo_move_to(cr, cpu_x_start+cpu_x_step*4*(i)-3, cpu_y_start+(keep_y+50)*(j)+(keep_y+15))
	 				cairo_show_text(cr, conky_parse(str) .. "%")
	 				counter = counter+1
	 			end
	 		end
	 	else
	 		draw_CPU(cr, cpu_x_start,cpu_y_start,cpu_x_step,cpu_y_step,grades, tonumber(conky_parse('${cpu cpu0}')))
	 	end
	 end
	 
	 draw_widget(cr, cpu_widget_x_start,cpu_widget_y_start, "CPU", 16, cpu_widget_height, cpu_widget_width)

Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

#7381 2014-04-17 03:39:35

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

Re: Conky v1.9 Thread

I'm beginning top think this just isn't worth it.

    $ conky -c /media/5/conky/Ruuku/start_conky &
[1] 13458
 
 17 Apr 14 | 00:32:50 ~
    $ Conky: forked to background, pid is 13463

Conky: desktop window (265) is root window
Conky: window type - normal
Conky: drawing to created window (0x3800002)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
Conky: i2c failed to parse arguments
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:55: attempt to perform arithmetic on local 'conky_value' (a nil value)
Conky: i2c failed to parse arguments
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:55: attempt to perform arithmetic on local 'conky_value' (a nil value)
Conky: i2c failed to parse arguments
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:55: attempt to perform arithmetic on local 'conky_value' (a nil value)
Conky: i2c failed to parse arguments
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:55: attempt to perform arithmetic on local 'conky_value' (a nil value)

Here's my "/media/5/conky/Ruuku/lua_widgets.lua"

-- 2014-02-17 by xeXpanderx
require 'cairo'
------------------------- CONFIGURATION  ----------------------------------
------------------------- Transparency, from 0 to 1 -------------------------
transp = 0.5
------------------------- CPU config -------------------------
cpu_x_step = 10
cpu_y_step = 8
grades = 8
number_of_cpus = 3 -- original 8 ## see line 200 original '${cpu cpu1}'
cpu_x_start = 60
cpu_y_start = 60
cpu_widget_x_start = 15
cpu_widget_y_start = 0
cpu_widget_width = 190
cpu_widget_height = 285
------------------------- Free space -------------------------
free_space_widget_x_start = 15
free_space_widget_y_start = 330
free_space_widget_width = 190
free_space_widget_height = 240
free_space_x_start = 120
free_space_y_start = 430
free_space_radius = 50
------------------------- Temperatures -------------------------
temperatures_widget_x_start = 15
temperatures_widget_y_start = 615
temperatures_widget_width = 190
temperatures_widget_height = 265
temperatures_x_start = 120
temperatures_y_start = 620
------------------------- Heavy code --------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
--------------------------------------------------------------------------------------------------------------------------

keep_y = 0

function horizontal_bar (cr, start_x,start_y, conky_value)
	cairo_set_operator(cr,CAIRO_OPERATOR_SOURCE)
	cairo_set_line_width (cr, 1);

	local percent_per_block = 100.0 / 20.0
	local step= 0
	local number_of_charged_blocks = math.floor((conky_value/percent_per_block)+0.5)

	cairo_stroke(cr)
	for i=1,20 do
	  cairo_rectangle (cr, start_x+step, start_y, 5, 20);
	  cairo_close_path(cr)
	  if i <= number_of_charged_blocks then
	    cairo_set_source_rgba(cr, 0,0,0,transp)
	    cairo_fill(cr)
	  else
	    cairo_set_source_rgba(cr, 0,0,0,transp-0.3)
	    cairo_fill(cr)
	  end
	  step = step + 8
	end
	cairo_set_source_rgba(cr, 0,0,0,transp)
end

function draw_circles(cr, x_start,y_start,radius, angle_1, angle_2, free_perc, angle_step)
	 cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
	 local number_of_circles = 360 / angle_step
	 local angle_start = 90
	 cairo_set_line_width(cr, 1)
	 local percent_per_circle = 100.0 / number_of_circles
	 local number_of_nonfree_circles = math.floor(((100.0 - tonumber(free_perc)) / percent_per_circle)+0.5)
	 cairo_set_source_rgba(cr, 0,0,0,transp)

	for i=1,number_of_circles do
	  cairo_arc(cr,x_start+(radius*math.cos(angle_start*(math.pi/180.0))),y_start-(radius+5)+radius-(radius*math.sin(angle_start*(math.pi/180.0))),4,angle1,angle2)
	  if i <= number_of_nonfree_circles then
	    cairo_set_source_rgba(cr, 0,0,0,transp)
	    cairo_fill(cr)
	  else
	    cairo_set_source_rgba(cr, 0,0,0,transp-0.3)
	    cairo_fill(cr)
	  end
	  angle_start = angle_start - angle_step
	end
	cairo_set_source_rgba(cr, 0,0,0,transp)

end

function draw_widget(cr, x,y, str_conky, font_size, height, width)
	cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  	cairo_set_line_width (cr, 3);
	cairo_set_operator(cr,CAIRO_OPERATOR_SOURCE)
	cairo_set_source_rgba(cr, 0,0,0,transp-0.3)
	cairo_move_to (cr, x+10, y+27)
	cairo_arc(cr,x+10,y+27,5,0,2*math.pi)
	cairo_move_to (cr, x+10, y+27)
	cairo_rel_line_to (cr, width, 0)
	cairo_rel_line_to (cr, 8, 8)
	cairo_rel_line_to (cr, 0, height)
	cairo_rel_line_to (cr, -8, 8)
	cairo_rel_line_to (cr, -width, 0)
	cairo_stroke (cr);
	cairo_close_path(cr)
	cairo_arc(cr,x+10,y+height+16+27,5,0,2*math.pi)
	cairo_stroke(cr)

	cairo_move_to (cr, x+15, y+22)
	cairo_set_source_rgba(cr, 0,0,0,transp)
	cairo_set_font_size (cr, font_size);
	cairo_show_text (cr, str_conky)
	cairo_set_source_rgba(cr, 0,0,0,transp)
end

function draw_vertical_bars_3d(cr, x_start,y_start,x_step,y_step,grades, current_value)
	cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
	cairo_set_operator(cr,CAIRO_OPERATOR_SOURCE)
	cairo_set_source_rgba(cr, 0,0,0,transp)
	cairo_move_to(cr,x_start,y_start)
	cairo_rel_line_to(cr,-x_step,-y_step)
	cairo_rel_line_to(cr,x_step-x_step,y_step)
	cairo_rel_line_to(cr, x_step,y_step)
	cairo_rel_line_to(cr, x_step-x_step,-y_step)
	cairo_rel_line_to(cr, x_step,-y_step)
	cairo_rel_line_to(cr, x_step-x_step,y_step)
	cairo_rel_line_to(cr, -x_step,y_step)
	cairo_close_path(cr)

	if math.floor((current_value/(100.0/grades))+0.5) < grades then
	  cairo_stroke(cr)
	else
	  cairo_fill(cr)
	end

	cairo_move_to(cr, x_start+x_step,y_start-y_step)
	cairo_rel_line_to(cr, -x_step, -y_step)
	cairo_rel_line_to(cr, -x_step, y_step)
	cairo_stroke(cr)

	for i=1,(grades-1) do
	  cairo_move_to(cr, x_start+x_step,y_start+y_step*1.5*(i-1))
	  cairo_rel_line_to(cr, -x_step*0.25,y_step*0.25)
	  cairo_rel_line_to(cr, x_step*0.25,y_step*0.25)
	  cairo_stroke(cr)
	  cairo_move_to(cr, x_start-x_step*0.75,y_start+y_step*0.25+y_step*1.5*(i-1))
	  cairo_rel_line_to(cr, -x_step*0.25,y_step*0.25)
	  cairo_stroke(cr)
	  cairo_move_to(cr, x_start, y_start+y_step*1.5*i)
	  keep_y = (y_start+y_step*1.5*i+y_step) - y_start
	  cairo_rel_line_to(cr, -x_step, -y_step)
	  cairo_rel_line_to(cr, x_step-x_step, y_step)
	  cairo_rel_line_to(cr,x_step,y_step)
	  cairo_rel_line_to(cr,x_step,-y_step)
	  cairo_rel_line_to(cr,x_step-x_step,-y_step)
	  cairo_rel_line_to(cr,-x_step,y_step)
	  cairo_rel_line_to(cr,x_step-x_step,y_step)
	  cairo_close_path(cr)
	  if math.floor((current_value/(100.0/grades))+0.5) >= (grades-i) then
	    cairo_fill(cr)
	  else
	    cairo_stroke(cr)
	  end

	end
end

function draw_function(cr)
  local w,h=conky_window.width,conky_window.height
  cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND)
  cairo_set_line_width(cr, 1)
  cairo_set_source_rgba(cr, 0,0,0,transp)
  cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);


--[[ --- Original CPU section ---
  cairo_close_path(cr)
  cairo_set_font_size (cr, 10);

  counter = 1
  if number_of_cpus > 1 and number_of_cpus % 2 == 0 thenpkill -xf "conky -c /media/5/conky/Ruuku/start_conky" &
    if (number_of_cpus / 2) <= 4 then
      for j=1, 2 do
	for i=1, (number_of_cpus/2) do
	  str = '${cpu cpu' .. tostring(counter) .. '}'
	  draw_vertical_bars_3d(cr, cpu_x_start+cpu_x_step*4*(i-1),cpu_y_start+(keep_y+50)*(j-1),cpu_x_step,cpu_y_step,grades, tonumber(conky_parse(str)))
	  cairo_move_to(cr, cpu_x_start+cpu_x_step*4*(i-1)-3, cpu_y_start+(keep_y+50)*(j-1)+(keep_y+15))
	  cairo_show_text(cr, conky_parse(str) .. "%")
	  counter = counter+1
	end
      end
    end
  else
    draw_CPU(cr, cpu_x_start,cpu_y_start,cpu_x_step,cpu_y_step,grades, tonumber(conky_parse('${cpu cpu1}')))
  end

  draw_widget(cr, cpu_widget_x_start,cpu_widget_y_start, "CPU", 16, cpu_widget_height, cpu_widget_width)
  ]]

	 --- CPU section by dk75 ---
	 cairo_close_path(cr)
	 cairo_set_font_size (cr, 10);

	 counter = 1
	 if number_of_cpus > 1 then
	 	if (number_of_cpus / 2) <= 4 then
	 		for j=0, 1 do
	 			for i=0, (math.ceil(number_of_cpus/2)-1) do
	 				if counter > number_of_cpus then break end
	 				str = '${cpu cpu' .. tostring(counter) .. '}'
	 				draw_vertical_bars_3d(cr, cpu_x_start+cpu_x_step*4*(i),cpu_y_start+(keep_y+50)*(j),cpu_x_step,cpu_y_step,grades, tonumber(conky_parse(str)))
	 				cairo_move_to(cr, cpu_x_start+cpu_x_step*4*(i)-3, cpu_y_start+(keep_y+50)*(j)+(keep_y+15))
	 				cairo_show_text(cr, conky_parse(str) .. "%")
	 				counter = counter+1
	 			end
	 		end
	 	else
	 		draw_CPU(cr, cpu_x_start,cpu_y_start,cpu_x_step,cpu_y_step,grades, tonumber(conky_parse('${cpu cpu0}')))
	 	end
	 end

	 draw_widget(cr, cpu_widget_x_start,cpu_widget_y_start, "CPU", 16, cpu_widget_height, cpu_widget_width)

--- Free space section ---
  draw_widget(cr, free_space_widget_x_start,free_space_widget_y_start, "Free space", 16, free_space_widget_height, free_space_widget_width)
  angle1 = 0.0  * (math.pi/180.0);
  angle2 = 360.0 * (math.pi/180.0);
  free_hd1 = conky_parse("${fs_free_perc /}")
  free_hd2 = conky_parse("${fs_free_perc /home}")

  draw_circles(cr, free_space_x_start,free_space_y_start,free_space_radius, angle_1, angle_2, free_hd1, 10)
  draw_circles(cr, free_space_x_start,free_space_y_start+120,free_space_radius, angle_1, angle_2, free_hd2, 10)
  cairo_set_source_rgba(cr, 0,0,0,transp)
  cairo_move_to (cr, free_space_x_start-20, free_space_y_start);
  cairo_show_text(cr, "R: " .. free_hd1 .. "%")
  cairo_move_to (cr,free_space_x_start-20, free_space_y_start+120);
  cairo_show_text(cr, "H: " .. free_hd2 .. "%")



--- Temperatures ---
  cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
  draw_widget(cr, temperatures_widget_x_start,temperatures_widget_y_start, "Temperatures", 16, temperatures_widget_height, temperatures_widget_width)
  cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  cairo_set_font_size (cr, 10);
  tmp = conky_parse("${platform f71882fg.2560 temp 1")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+60, tonumber(tmp))
  cairo_close_path(cr)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+50)
  --cairo_show_text(cr, "CPU 0: " .. tmp .. "\194\176C")
  cairo_show_text(cr, "CPU")

  tmp = conky_parse("${platform f71882fg.2560 temp 2}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+110, tmp)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+100)
  cairo_show_text(cr, "M/B")

  tmp = conky_parse("${hddtemp /dev/sda}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+160, tmp)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+150)
  cairo_show_text(cr, "HDD")

  tmp = conky_parse("${nvidia temp}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+210, tmp)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+200)
  cairo_show_text(cr, "GPU")

--[[  tmp = conky_parse("${exec nvidia-smi | grep 'GeForce' -A 1 | tail -n 1 | awk '{print $3}' | cut -b1,2}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+260, tmp)
  cairo_move_to(cr, temperatures_x_start-25, temperatures_y_start+250)
  cairo_show_text(cr, "Nvidia GPU") ]]
end

function conky_start_widgets()
	local function draw_conky_function(cr)
		local str=''
		local value=0
		draw_function(cr)
	end
	-- Check that Conky has been running for at least 5s

	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)

	local cr=cairo_create(cs)

	local updates=conky_parse('${updates}')
	update_num=tonumber(updates)

	if update_num>5 then
		draw_conky_function(cr)
	end
	cairo_surface_destroy(cs)
	cairo_destroy(cr)
end

Thanks dk75

Last edited by Sector11 (2014-04-17 03:40:08)


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

Offline

#7382 2014-04-17 09:30:15

wagmic1
#! CrunchBanger
Registered: 2013-11-15
Posts: 119

Re: Conky v1.9 Thread

hi crunchers i will post my conky config seen in this topic
1397695967.png

conky on the right

##############################################
#  Settings  Par wagmic 
##############################################
# Use Xft?
use_xft yes
xftfont pseudo apl:size=7,5
xftalpha 1
text_buffer_size 2048

# 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_class Conky
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
#minimum_size 700 500
#maximum_width 500 0

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
#border_margin 8

# border width
border_width 0

# Graphics settings #
draw_graph_borders no

# Default colors and also border colors
default_color D3E6E6
default_shade_color 394456
default_outline_color 010203
#own_window_colour 151515

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

gap_x 33
gap_y 33

# Subtract file system buffers from used memory?
no_buffers yes

uppercase no

cpu_avg_samples 1

net_avg_samples 2


# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

TEXT
${alignc}${nodename} on ${kernel}
${voffset -6}${hr}
-UpTime${goto 95}${uptime}
${voffset -3}${hr}
-Processor${goto 95}${cpu cpu0}%
	${cpugraph cpu0 50,230 D3E6E6 FF8800 -t -l}
-Memory${goto 95}${memperc} %
	${memgraph 50,230 D3E6E6 FF8800 2000 -t -l} 
-I/O${goto 95}${diskio}/s${alignr}${texeci 60 /usr/sbin/hddtemp /dev/sda -n}°C
	${diskiograph 50,230 D3E6E6 FF8800 -t -l}

-Home${goto 95}${fs_used_perc /home} %${alignr}${fs_used /home}/${fs_size /home}
	${fs_bar 7,230 /home}
-Akira${goto 95}${fs_used_perc /media/akira} %${alignr}${fs_used /media/akira}/${fs_size /media/akira}
	${fs_bar 7,230 /media/akira}	
${voffset -3}${hr}
-Mb${goto 95}${acpitemp}°C
${voffset -3}${hr}
-bat${goto 95}${exec acpi -b | grep "Battery 0" | awk '{ print $4}'}${alignr}${exec acpi -b | grep "Battery 0" | awk '{ print $5}'}
	${battery_bar 7,230 BAT1}
${voffset -3}${hr}
-Process ${goto 95}Mem
1 :${top_mem name 1} ${goto 90}${top_mem mem 1}%   \
${alignr} total ${memmax}
2 :${top_mem name 2} ${goto 90}${top_mem mem 2}%   \
${alignr} free ${memfree}
3 :${top_mem name 3} ${goto 90}${top_mem mem 3}%   \
${alignr} easyfree ${memeasyfree}
4 :${top_mem name 4} ${goto 90}${top_mem mem 4}%   \
${alignr} Swap ${swap}
${voffset -3}${hr}${if_running mocp}
-Artist${alignc}${exec mocp -Q %artist} 
-Album${alignc}${exec mocp -Q %song}
-duree${alignc}${exec mocp -Q %ct}/${exec mocp -Q %tt}
${voffset -3}${hr}${endif}

wifi conky in the middel

# librement inspiré de Conky Google Now style #
# Par wagmic #
# Conky settings #
background no
update_interval 1
double_buffer yes
no_buffers yes

# Window specifications #
own_window_class Conky
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

minimum_size 250

# Alignment #
alignment tm
gap_x 18
gap_y 43

border_inner_margin 15
border_outer_margin 0

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

# Text settings #
use_xft yes
xftalpha 0
xftfont Open Sans Light:size=7

override_utf8_locale yes

imlib_cache_size 0

# Color scheme #
default_color D3E6E6

#minimum_size 120 250
maximum_width 250 100

TEXT
${goto 35}Gmail:${goto 150}${texeci 1800 perl ~/scripts/gmail.pl n} - ${texeci 1800 perl ~/scripts/gmail2.pl n} message(s)
${if_existing /proc/net/route wlan0}${goto 35}${wireless_essid wlan0}${goto 150}${wireless_link_qual_perc wlan0}%
${goto 35}Gateway:${goto 150}$gw_ip
${goto 35}Ip:${goto 150}${addr wlan0}
${goto 35}Ip public:${goto 150}${execi 1800 wget -q -O - http://ip.tupeux.com | tail }
${goto 35}Mac:${goto 150}${exec ifconfig -a | grep HWaddr | grep wlan0 | cut -c 39-55}
${goto 35}Up:${upspeed wlan0}${goto 150}Down:${downspeed wlan0}
${upspeedgraph wlan0 50,120 FFFFF0 FF8800 -t -l}${alignr}${downspeedgraph wlan0 50,120 FF8800 FFFFF0-t -l}
${alignc}Sent:${totalup wlan0}${alignr}Received:${totaldown wlan0}
${else}${if_existing /proc/net/route wlan2}${goto 35}${wireless_essid wlan2}${goto 150}${wireless_link_qual_perc wlan2}%
${goto 35}Gateway:${goto 150}$gw_ip
${goto 35}Ip:${goto 150}${addr wlan2}
${goto 35}Ip public:${goto 150}${execi 1800 wget -q -O - http://ip.tupeux.com | tail }
${goto 35}Mac:${goto 150}${exec ifconfig -a | grep HWaddr | grep wlan2 | cut -c 39-55}
${goto 35}Up:${upspeed wlan2}${goto 150}Down:${downspeed wlan2}
${upspeedgraph wlan2 50,120 FFFFF0 FF8800 -t -l}${alignr}${downspeedgraph wlan2 50,120 FF8800 FFFFF0-t -l}
${alignc}Sent:${totalup wlan2}${alignr}Received:${totaldown wlan2}
${else}${if_existing /proc/net/route eth0}
Up:${upspeed eth0}${alignr}Down:${downspeed eth0}
${upspeedgraph eth0 50,120 FF8800 FF8800}${alignr}${downspeedgraph eth0 50,120 FF8800 FF8800}
Sent:${totalup eth0}${alignr}Received:${totaldown eth0}
${else}${if_existing /proc/net/route wlan2}${goto 85}${wireless_essid wlan2}${alignr}${wireless_link_qual_perc wlan2}%
Up:${upspeed wlan2}${alignr}Down:${downspeed wlan2}
${upspeedgraph wlan2 50,120 FF8800 FF8800}${alignr}${downspeedgraph wlan2 50,120 FF8800 FF8800}
Sent:${totalup wlan2}${alignr}Received:${totaldown wlan2}
${else}${if_existing /proc/net/route ppp0}
Up:${upspeed ppp0}${alignr}Down:${downspeed ppp0}
${upspeedgraph ppp0 50,120 FF8800 FF8800}${alignr}${downspeedgraph ppp0 50,120 FF8800 FF8800}
Sent:${totalup ppp0}${alignr}Received:${totaldown ppp0}
${else}
Network disconnected
${color6}Connect to a network to see statistics
${voffset 50}
${endif}${endif}${endif}${endif}

conky lua clock and weather

##############################################
#  Settings Par wagmic #
##############################################
# Use Xft?
use_xft yes
xftfont pseudo apl:size=7
xftalpha 1
text_buffer_size 2048

# 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_class Conky
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 200 200
#maximum_width 500 0

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
#border_margin 8

# border width
border_width 1

# Default colors and also border colors
default_color 141414
default_shade_color 394456
default_outline_color 010203
#own_window_colour 151515

# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

gap_x 33
gap_y 33

# Subtract file system buffers from used memory?
no_buffers yes

uppercase no

cpu_avg_samples 1

net_avg_samples 2


# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

# -- Lua Load -- #
lua_load ./.rings.lua
lua_draw_hook_pre rings
TEXT
${color6}${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=12850467&u=c" -o ~/.cache/weather.xml}${font Open Sans Light:size=7}${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${alignr}T : ${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} °
${font Open Sans Light:size=7}${voffset 180}V : ${color6}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${alignr}H : ${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} %

.ring.lua

-- setting par wagmic

settings_table = {
	{
		name='time',
		arg='%I',
		max=12,
		bg_colour=0xFFFFF0,
		bg_alpha=0.05,
		fg_colour=0xFF8800,
		fg_alpha=0.3,
		x=105, y=105,
		radius=40,
		thickness=80,
		start_angle=0,
		end_angle=360
	},
	{
		name='time',
		arg='%M.%S',
		max=60,
		bg_colour=0xFFFFF0,
		bg_alpha=0.02,
		fg_colour=0xFF8800,
		fg_alpha=0.5,
		x=105, y=105,
		radius=30,
		thickness=60,
		start_angle=0,
		end_angle=360
	},
	{
		name='time',
		arg='%S',
		max=60,
		bg_colour=0xFFFFF0,
		bg_alpha=0.01,
		fg_colour=0xFF8800,
		fg_alpha=0.7,
		x=105, y=105,
		radius=20,
		thickness=40,
		start_angle=0,
		end_angle=360
	},
	
}



require 'cairo'

function rgb_to_r_g_b(colour,alpha)
	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function draw_ring(cr,t,pt)
	local w,h=conky_window.width,conky_window.height

	local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
	local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

	local angle_0=sa*(2*math.pi/360)-math.pi/2
	local angle_f=ea*(2*math.pi/360)-math.pi/2
	local t_arc=t*(angle_f-angle_0)

	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
	cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
	cairo_set_line_width(cr,ring_w)
	cairo_stroke(cr)

	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
	cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
	cairo_stroke(cr)
end


function conky_rings()
	local function setup_rings(cr,pt)
		local str=''
		local value=0

		str=string.format('${%s %s}',pt['name'],pt['arg'])
		str=conky_parse(str)

		value=tonumber(str)
		if value == nil then value = 0 end
		pct=value/pt['max']

		draw_ring(cr,pct,pt)
	end

	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)

	local cr=cairo_create(cs)	

	local updates=conky_parse('${updates}')
	update_num=tonumber(updates)

	if update_num>5 then
		for i in pairs(settings_table) do
			setup_rings(cr,settings_table[i])
		end
	end
end

That s all folks


I need to learn how to speak/write English big_smile
latest Firefox on #! handylinux

Offline

#7383 2014-04-17 15:36:03

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

Re: Conky v1.9 Thread

wagmic1 wrote:

hi crunchers i will post my conky config seen in this topic

That s all folks

That's not all ... that's nice!


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

Offline

#7384 2014-04-17 18:23:14

wagmic1
#! CrunchBanger
Registered: 2013-11-15
Posts: 119

Re: Conky v1.9 Thread

Choukrane khouilla S11


I need to learn how to speak/write English big_smile
latest Firefox on #! handylinux

Offline

#7385 2014-04-17 18:50:51

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

Re: Conky v1.9 Thread

wagmic1 wrote:

Choukrane khouilla S11

Which means?  sad

BTW, if you want to get rid of the 'boxed look' in your conkys ... in your in your compton.config file add /edit this section:

## Remove Shadow from CONKY WINDOW ##
# tip from falldown
# use wininfo to determine window name -OR- in the conky:
#		own_window_class window-name
# Then just simply use:
#		shadow-exclude = "i:e:window-name";
# Use brackets and comma for more then one window
#		shadow-exclude = ["i:e:window-name","i:e:S11","i:e:test"];
############## try this #################
shadow-exclude = ["i:e:Conky","i:e:interactiveconky","i:e:click_log"];

This should work for you:

shadow-exclude = "i:e:Conky";

2014_04_17_15_54_07_1920x1080_Sector11.jpg«- this | to this -» 2014_04_17_15_54_48_1920x1080_Sector11.jpg

Last edited by Sector11 (2014-04-17 19:59:43)


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

Offline

#7386 2014-04-17 19:50:26

wagmic1
#! CrunchBanger
Registered: 2013-11-15
Posts: 119

Re: Conky v1.9 Thread

Choukrane khouilla S11 : thanks my brother S11 i m french but il lve in casablanca morocco smile

Thanks for the tip   just a correction

shadow-exclude = "i:e:Conky";

I need to learn how to speak/write English big_smile
latest Firefox on #! handylinux

Offline

#7387 2014-04-17 19:59:22

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

Re: Conky v1.9 Thread

wagmic1 wrote:

Choukrane khouilla S11 : thanks my brother S11 i m french but il lve in casablanca morocco smile

Thanks for the tip   just a correction

shadow-exclude = "i:e:Conky";

Oh - you're welcome.  Oops, I forgot the " that a big  :8


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

Offline

#7388 2014-04-21 13:54:51

The-Valk
New Member
Registered: 2014-04-21
Posts: 9

Re: Conky v1.9 Thread

I've been searching everywhere for an answer to this conky problem and this seems to be where a few conky gurus hang out.
This thread is huge and although I have searched a fair bit of it, I still haven't fixed my problem.
I have a conky script that I have been using successfully for years on various Ubuntu incarnations, the latest being Mint 16.
I am now trying to get it to work on the latest Ubuntu LTS 14.04 and whilst some works OK, most fails silently.
Here is the relevant code.

TEXT

#---------------------------------Network Details------------------------

${image ~/.conky/images/network-wired.png -s 48x48}${voffset -16}${offset 100}Network Information

${alignc}Local IP (${addr eth0})
${voffset 12}Down: ${downspeed eth0} k/s ${alignr}Up: ${upspeed eth0} k/s
${color2}${downspeedgraph eth0 20,130 ff0000 0000ff} ${alignr}${upspeedgraph eth0 20,130 0000ff ff0000}${color orange}
Total: ${totaldown eth0} ${alignr}Total: ${totalup eth0}
${voffset 16}Nameservers:${offset 8}${nameserver}${alignr}${nameserver}
${voffset 8}Connect in: ${tcp_portmon 1 32767 count}${offset 20}Connect out: ${tcp_portmon 32768 61000 count}${alignr}Total: ${tcp_portmon 1 65535 count}
${color orange}${voffset 8}Inbound Connect ${alignr} Local Service/Port
${color}${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${color orange}Outbound Connection ${alignr} Remote Service/Port
${color}${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
${tcp_portmon 32768 61000 rhost 6} ${alignr} ${tcp_portmon 32768 61000 rservice 6}
${tcp_portmon 32768 61000 rhost 7} ${alignr} ${tcp_portmon 32768 61000 rservice 7}
${tcp_portmon 32768 61000 rhost 8} ${alignr} ${tcp_portmon 32768 61000 rservice 8}
${tcp_portmon 32768 61000 rhost 9} ${alignr} ${tcp_portmon 32768 61000 rservice 9}
${tcp_portmon 32768 61000 rhost 10} ${alignr} ${tcp_portmon 32768 61000 rservice 10}

Local IP is OK showing that the eth0 adapter is used.
The portmon works OK.
nameserver shows 127.0.1.1
upspeed and downspeed, totalup and totaldown all produce 0B
Any help would be useful.

Offline

#7389 2014-04-21 14:49:16

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

Re: Conky v1.9 Thread

The-Valk wrote:

I've been searching everywhere for an answer to this conky problem and this seems to be where a few conky gurus hang out.
{snip}
Local IP is OK showing that the eth0 adapter is used.
The portmon works OK.
nameserver shows 127.0.1.1
upspeed and downspeed, totalup and totaldown all produce 0B
Any help would be useful.

Your code looked OK, and since you use it on other distros it would seem that it is.  However just to be sure I tested it here.  It runs perfect.
2014_04_21_11_34_03_300x832_Sector11.jpg

So that leaves: Ubuntu 14.04
What conky do you have installed?
conky-all?  What version?

 21 Apr 14 | 11:42:46 ~
    $ aptitude search conky
p   conky
i   conky-all
p   conky-all-dbg
p   conky-cli
p   conky-cli-dbg
p   conky-std
p   conky-std-dbg
i   conkyemail
i   conkymisc

The " i " tells you it is installed

aptitude show conky-all
Package: conky-all                       
State: installed
Automatically installed: no
Version: 1.9.0-4
Priority: optional
Section: contrib/utils
Maintainer: Vincent Cheng <vcheng@debian.org>
{snip}

Or if you prefer:

conky -v

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

Offline

#7390 2014-04-21 15:04:29

The-Valk
New Member
Registered: 2014-04-21
Posts: 9

Re: Conky v1.9 Thread

Sector11 wrote:
The-Valk wrote:

I've been searching everywhere for an answer to this conky problem and this seems to be where a few conky gurus hang out.
{snip}
Local IP is OK showing that the eth0 adapter is used.
The portmon works OK.
nameserver shows 127.0.1.1
upspeed and downspeed, totalup and totaldown all produce 0B
Any help would be useful.

Your code looked OK, and since you use it on other distros it would seem that it is.  However just to be sure I tested it here.  It runs perfect.
http://s20.postimg.org/ps2iw9rih/2014_04_21_11_34_03_300x832_Sector11.jpg

So that leaves: Ubuntu 14.04
What conky do you have installed?
/code]

Conky 1.9.0 compiled Wed Feb 19 18:40:50 UTC 2014 for Linux 3.2.0-54-generic (x86_64)

It seems that Ubuntu have changed something in their last iteration.

Thanks for checking my code.
The kernel version is 3.13.0-24-generic on x86_64 if that makes a difference?

Offline

#7391 2014-04-21 15:34:45

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

Re: Conky v1.9 Thread

The-Valk wrote:

Conky 1.9.0 compiled Wed Feb 19 18:40:50 UTC 2014 for Linux 3.2.0-54-generic (x86_64)

It seems that Ubuntu have changed something in their last iteration.

Thanks for checking my code.
The kernel version is 3.13.0-24-generic on x86_64 if that makes a difference?

You're welcome.  I doubt the kernel is the problem.
Like I said if it works here, and on Mint and older Ubuntu's then it has to be something in 14.04.

Have you tried the conky thread on the Ubuntu forums?


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

Offline

#7392 2014-04-21 15:46:09

The-Valk
New Member
Registered: 2014-04-21
Posts: 9

Re: Conky v1.9 Thread

Sector11 wrote:

Have you tried the conky thread on the Ubuntu forums?

Wow, that is indeed a long thread.
I did search the Ubuntu forums but for some reason that thread failed to show.
I'll give it a go.

Many thanks for you help

Offline

#7393 2014-04-21 17:19:22

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Conky v1.9 Thread

@The-Valk

in a terminal run:

ifconfig -a

and verify that your internet interface is still eth0 in the version of Ubuntu you're running. I know that systemd can change them, I don't know about Ubuntu's boot manager - upstart or whatever they call it.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#7394 2014-04-21 17:33:10

The-Valk
New Member
Registered: 2014-04-21
Posts: 9

Re: Conky v1.9 Thread

PackRat wrote:

@The-Valk

in a terminal run:

ifconfig -a

and verify that your internet interface is still eth0 in the version of Ubuntu you're running. I know that systemd can change them, I don't know about Ubuntu's boot manager - upstart or whatever they call it.

ubuntu-2014@Ubuntu-2014:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet addr:192.168.0.2  Bcast:192.168.255.255  Mask:255.255.0.0
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:18 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:172907 errors:0 dropped:0 overruns:0 frame:0
          TX packets:172907 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:15619293 (15.6 MB)  TX bytes:15619293 (15.6 MB)

Sensitive stuff obscured

Offline

#7395 2014-04-21 17:52:58

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

Re: Conky v1.9 Thread

PackRat wrote:

in a terminal run:

ifconfig -a

and verify that your internet interface is still eth0 in the version of Ubuntu you're running. I know that systemd can change them, I don't know about Ubuntu's boot manager - upstart or whatever they call it.

Totally forgot about that.  When I was using Ubuntu is seemed every 6 months when I installed the update my system would switch from eth0 to eth1 to eth0 to ...

Good catch .. although it doesn't look to be the case.  sad


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

Offline

#7396 2014-04-21 18:01:44

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

Re: Conky v1.9 Thread

may be barking up the wrong tree, but try ${gw_iface} in conky to see if the interface is getting its name changes to something else

Offline

#7397 2014-04-21 19:01:53

The-Valk
New Member
Registered: 2014-04-21
Posts: 9

Re: Conky v1.9 Thread

mrpeachy wrote:

may be barking up the wrong tree, but try ${gw_iface} in conky to see if the interface is getting its name changes to something else

Thanks.
Tried that and the result is eth0.

Offline

#7398 2014-04-21 19:30:59

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Conky v1.9 Thread

The-Valk wrote:

Local IP is OK showing that the eth0 adapter is used.
The portmon works OK.
nameserver shows 127.0.1.1
upspeed and downspeed, totalup and totaldown all produce 0B
Any help would be useful.

Sorry, I didn't catch this little bit at the end indicating that eth0 is actually being used.

Check the units being used in the configuration above TEXT. May be a matter of scale so values aren't registering.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#7399 2014-04-21 19:54:01

The-Valk
New Member
Registered: 2014-04-21
Posts: 9

Re: Conky v1.9 Thread

PackRat wrote:
The-Valk wrote:

Local IP is OK showing that the eth0 adapter is used.
The portmon works OK.
nameserver shows 127.0.1.1
upspeed and downspeed, totalup and totaldown all produce 0B
Any help would be useful.

Sorry, I didn't catch this little bit at the end indicating that eth0 is actually being used.

Check the units being used in the configuration above TEXT. May be a matter of scale so values aren't registering.

Here's the rest of the script.

# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.

# Text alignment, other possible values are commented
alignment bottom_right

#Set Background
background no

draw_borders yes

# border width
border_width 1

# border margins

# Stippled borders?
#stippled_borders 3

# Default colors and also border colors, grey90 == #e5e5e5
default_color grey
color1 218BD4
color2 218BD4

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

#Gap between borders of screen and text
gap_x 10
gap_y 10

# Minimum size of text area
minimum_size 300 5

#Maxmum width of window
maximum_width 300

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
no_buffers yes


# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent no

# Update interval in seconds
update_interval 2.0

# fiddle with window
use_spacer right

# set to yes if you want all text to be in uppercase
uppercase no

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes

# Shows the maximum value in scaled graphs.
show_graph_scale no

# Shows the time range covered by a graph.
show_graph_range no

# Image cache size for IMLIB2

# stuff after 'TEXT' will be formatted on screen


TEXT

Thanks for all the help.
This is a great forum.

Offline

Be excellent to each other!

#7400 2014-04-21 23:08:04

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

Re: Conky v1.9 Thread

I replace what was above TEXT in my test conky with what you posted:

# conky -c /media/5/conky/The-Valk.conky &
# pkill -xf "conky -c /media/5/conky/The-Valk.conky" &

# Text alignment, other possible values are commented
alignment bottom_right

#Set Background
background no

draw_borders yes

# border width
border_width 1

# border margins

# Stippled borders?
#stippled_borders 3

# Default colors and also border colors, grey90 == #e5e5e5
default_color grey
color1 218BD4
color2 218BD4

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

#Gap between borders of screen and text
gap_x 10
gap_y 10

# Minimum size of text area
minimum_size 300 5

#Maxmum width of window
maximum_width 300

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
no_buffers yes

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent no

# Update interval in seconds
update_interval 2.0

# fiddle with window
use_spacer right

# set to yes if you want all text to be in uppercase
uppercase no

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes

# Shows the maximum value in scaled graphs.
show_graph_scale no

# Shows the time range covered by a graph.
show_graph_range no

# Image cache size for IMLIB2

# stuff after 'TEXT' will be formatted on screen

TEXT
${time %T}${alignr}${time %x}
${alignc}Network Information

${alignc}Local IP (${addr eth0})
${voffset 12}Down: ${downspeed eth0} k/s ${alignr}Up: ${upspeed eth0} k/s
${color2}${downspeedgraph eth0 20,130 ff0000 0000ff} ${alignr}${upspeedgraph eth0 20,130 0000ff ff0000}${color orange}
Total: ${totaldown eth0} ${alignr}Total: ${totalup eth0}
${voffset 16}Nameservers:${offset 8}${nameserver 0}${alignr}${nameserver 1}
${voffset 8}Connect in: ${tcp_portmon 1 32767 count}${offset 20}Connect out: ${tcp_portmon 32768 61000 count}${alignr}Total: ${tcp_portmon 1 65535 count}
${color orange}${voffset 8}Inbound Connect ${alignr} Local Service/Port
${color}${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${color orange}Outbound Connection ${alignr} Remote Service/Port
${color}${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
${tcp_portmon 32768 61000 rhost 6} ${alignr} ${tcp_portmon 32768 61000 rservice 6}
${tcp_portmon 32768 61000 rhost 7} ${alignr} ${tcp_portmon 32768 61000 rservice 7}
${tcp_portmon 32768 61000 rhost 8} ${alignr} ${tcp_portmon 32768 61000 rservice 8}
${tcp_portmon 32768 61000 rhost 9} ${alignr} ${tcp_portmon 32768 61000 rservice 9}
${tcp_portmon 32768 61000 rhost 10} ${alignr} ${tcp_portmon 32768 61000 rservice 10}

Again, it's still working.
2014_04_21_20_05_42_1920x1080_Sector11.jpg
Is this what you expect it to look like?


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

Offline

Board footer

Powered by FluxBB

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

Debian Logo