Pagina 182 di 400

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 13:59
da Diabolik62
finalmente c'è l'ho fatta
ho dovuto fare duel lua
a cauda di un errore nella riga 237
del lua che non riesco a risolvere
e non mi funziona il calendario
che dovrebbe stare  a fianco dell'orologio

Immagine

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 14:04
da Diabolik62
posto i conky
conky cpu
da terminale nessun errore

Codice: Seleziona tutto

# Этот текст выложен как образец, но его можно использовать для нормальной работы

# --- параметры окна ---
# эти строки необходимы для нормальной работы лучше не изменять
own_window		yes 
own_window_class	Conky 
own_window_transparent	yes 
own_window_type		override 
own_window_hints	undecorated,below,sticky,skip_taskbar,skip_pager 
# следующие параметры можно изменять
# минимальный размер
minimum_size 150 0 
# минимальная ширина
maximum_width 200 
# расположение окна
# левый верхний угол экрана 
#alignment top_left 
# левый нижний угол экрана
#alignment bottom_left 
# правый верхний угол экрана
alignment top_right 
# правый нижний угол экрана
#alignment bottom_right 
# расстояние между кромкой экрана и окном
# по горизонтали
gap_x 8 
# по вертикали
gap_y 209

# --- графика окна --- 
# если желаете выводить conky на другом фоне напишите yes
background no 
# окантовка окна, бордюр
draw_borders no
# если бордюр yes
# длина штрихов бордюра, если 0, то бордюр выводится сплошной линией
stippled_borders 1
# толщина линий бордюра 
border_width 1
# поле бордюра 

# бордюр вокруг выводимых графиков
draw_graph_borders no
# включить тень?
draw_shades yes 
# окантовка вокруг текста и выводимых объектов
draw_outline no ${downspeed wlan0} kb/s 
# Добавить пробел?  Только для встраиваемых объектов 
use_spacer right 

# --- цвет ---
# основной цвет по умолчанию 
default_color FFF8DC
# цвет тени
default_shade_color black 
# цвет окантовки
default_outline_color black
# дополнительные
color1 white
color2 yellow 
color3 red 

# --- шрифты ---
# используемые шрифты X когда Xft не используется, можно выбрать один из следующих 
#font 5x7 
#font 6x10 
#font 7x13 
#font 8x13 
#font 9x15 
#font *mintsmild.se* 
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-* 

# Используется ли Xft? 
use_xft yes 

# Шриф Xft когда Xft доступен, здесь можно ввести название и размер любого шрифта 
xftfont Liberation Sans:size=8 

# яркость шрифта при испоьзовании шрифтов Xft 
xftalpha 0.5 
# выводить весь текст прописными буквами 
uppercase no 
# использовать кодировку UTF8? ПРИМЕЧАНИЕ: требуется Xft 
override_utf8_locale yes 

# --- следующие данные необходимы для работfont Liberation Sans:size=8
# обновление в секундах не имеет смысла ставить больше 2
# при выводе времени в секундах необходимо значение 1 и менее
update_interval 1.0 
# время работы программы до её выключения
# установите 0 для работы программы без остановки
total_run_times 0
# двойная буфферизация (требуется для flicker, может не работать) 
double_buffer yes 
# вычитать буферизацию файловой системы из используемой памяти? 
no_buffers yes 
# количество cpu
cpu_avg_samples 2
# number of net samples to average 
net_avg_samples 2 
imlib_cache_size 0 
short_units yes 
pad_percents 2 
text_buffer_size 2448 
imlib_cache_size 0 
#--- LUA ---
lua_load ~/ettore_.lua
lua_draw_hook_pre widgets
TEXT
${voffset 150}
#${voffset 3}rambler.ru: ${alignr}${execpi 60 conkyEmail --servertype=POP --servername=XXXXXXXXXXX --username=XXXXXXXXX --password=XXXXXXXX --ssl | xargs ~/scripts/colorizeMAIL.sh }${color}  New e-mail
${voffset -135}${goto 20}CPU1:${goto 100}${cpu cpu1}${goto 120}%${goto 160}${execpi 6 sensors | grep 'Core 0' | cut -c 15-16 | xargs ~/Scripts/colorizecore0.sh}°C${color}
${voffset 14}${goto 20}CPU2:${goto 100}${cpu cpu2}${goto 120}%${goto 160}${execpi 6 sensors | grep 'Core 1' | cut -c 15-16 | xargs ~/Scripts/colorizecore0.sh}°C${color}
${voffset 11}${goto 20}DOWN:${goto 100}${upspeedf  wlan0}          kb/s ${goto 160}
${voffset 12}${goto 20}UP:${goto 100}${downspeedf  wlan0}          kb/s ${goto 160}  
${voffset 200}
lua cpu

Codice: Seleziona tutto

--[[
При сборке скрипта использованы данные из следующих скриптов

Conky Widgets by londonali1010 (2009), (2010) - часы, календарь
Shadowed clock by wlourf (10 jan. 2010) - стрелки часов


Собрал все это Борис Кринкель <olgmen> krinkel@rambler.ru

Для этого серипта требуется CONKY версии 1.8

Для вызова этого скрипта в Conky вставьте следующие строки до TEXT (при условии, что скрипт сохранен в папке ~/scripts/):
    lua_load ~/scripts/olgmen8.lua
    lua_draw_hook_pre widgets
]]

require 'cairo'

--[[ END TEXT WIDGET ]]
-- ----------------------------------------------------------
--[[ GRAF ]]
function grafik(cr, x, y, w, h, name, arg, max, 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


		function draw_bar(pct)

		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)
-- рисуем прямую линию
		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
		cairo_set_line_width(cr, 1)
		cairo_move_to(cr, x, y)
		cairo_line_to(cr, w, y)
		cairo_stroke (cr)
-- выводим утолщенную линию, длина зависит от выбираемого параметра в %
		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
		cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)
		cairo_set_line_width (cr, h)
		cairo_move_to (cr, x, y)
		cairo_line_to (cr, x+ w*pct, y)
		cairo_stroke (cr)

		cairo_destroy(cr)
		cr = nil

		end

		local function setup_bars()
			local str=''
			local value=0
-- забираем параметр
			str=string.format('${%s %s}', name, arg)
			str=conky_parse(str)

			value=tonumber(str)
			if ( value == nil ) then value = 0 end

			pct=value/max
			

			draw_bar(pct)
		end

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

		if update_num>5 then
		setup_bars()
		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)
	grafik(cr, 10, 30, 200, 8, 'cpu', 'cpu1', 100, 0x000000, 1, 0xFFF8DC, 0.6)
	grafik(cr, 10, 55, 200, 8, 'cpu', 'cpu2', 100, 0x000000, 1, 0xFFF8DC, 0.6)
	grafik(cr, 10, 82, 200, 8, 'downspeedf', 'wlan0', 1000, 0x000000, 1, 0xFFF8DC, 0.6)
	grafik(cr, 10, 108, 200, 8, 'upspeedf', 'wlan0', 100, 0x000000, 1, 0xFFF8DC, 0.6)
	cairo_destroy(cr)
end


Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 14:07
da Diabolik62
conky orologio

Codice: Seleziona tutto

 # Этот текст выложен как образец, но его можно использовать для нормальной работы

# --- параметры окна ---
# эти строки необходимы для нормальной работы лучше не изменять
own_window		yes 
own_window_class	Conky 
own_window_transparent	yes 
own_window_type		override 
own_window_hints	undecorated,below,sticky,skip_taskbar,skip_pager 
# следующие параметры можно изменять
# минимальный размер
minimum_size 300 0 
# минимальная ширина
maximum_width 200 
# расположение окна
# левый верхний угол экрана 
#alignment top_left 
# левый нижний угол экрана
#alignment bottom_left 
# правый верхний угол экрана
alignment top_right 
# правый нижний угол экрана
#alignment bottom_right 
# расстояние между кромкой экрана и окном
# по горизонтали
gap_x 7 
# по вертикали
gap_y 1 

# --- графика окна --- 
# если желаете выводить conky на другом фоне напишите yes
background no 
# окантовка окна, бордюр
draw_borders no
# если бордюр yes
# длина штрихов бордюра, если 0, то бордюр выводится сплошной линией
stippled_borders 1
# толщина линий бордюра 
border_width 1
# поле бордюра 

# бордюр вокруг выводимых графиков
draw_graph_borders no
# включить тень?
draw_shades yes 
# окантовка вокруг текста и выводимых объектов
draw_outline no 
# Добавить пробел?  Только для встраиваемых объектов 
use_spacer right 

# --- цвет ---
# основной цвет по умолчанию 
default_color FFF8DC
# цвет тени
default_shade_color black 
# цвет окантовки
default_outline_color black
# дополнительные
color1 white
color2 yellow 
color3 red 

# --- шрифты ---
# используемые шрифты X когда Xft не используется, можно выбрать один из следующих 
#font 5x7 
#font 6x10 
#font 7x13 
#font 8x13 
#font 9x15 
#font *mintsmild.se* 
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-* 

# Используется ли Xft? 
use_xft yes 

# Шриф Xft когда Xft доступен, здесь можно ввести название и размер любого шрифта 
xftfont Liberation Sans:size=8 

# яркость шрифта при испоьзовании шрифтов Xft 
xftalpha 0.5 
# выводить весь текст прописными буквами 
uppercase no 
# использовать кодировку UTF8? ПРИМЕЧАНИЕ: требуется Xft 
override_utf8_locale yes 

# --- следующие данные необходимы для работfont Liberation Sans:size=8
# обновление в секундах не имеет смысла ставить больше 2
# при выводе времени в секундах необходимо значение 1 и менее
update_interval 1.0 
# время работы программы до её выключения
# установите 0 для работы программы без остановки
total_run_times 0
# двойная буфферизация (требуется для flicker, может не работать) 
double_buffer yes 
# вычитать буферизацию файловой системы из используемой памяти? 
no_buffers yes 
# количество cpu
cpu_avg_samples 2
# number of net samples to average 
net_avg_samples 2 
imlib_cache_size 0 
short_units yes 
pad_percents 2 
text_buffer_size 2048 
imlib_cache_size 0 
#--- LUA ---
lua_load ~/Scripts/olgmen8.lua
lua_draw_hook_pre widgets
TEXT
${voffset 150}sto lavorando:${goto 140}${uptime}
C UBUNTU${goto 140}${execi 60 ~/Scripts/datatime} Giorni
lua orologio

Codice: Seleziona tutto

--[[
При сборке скрипта использованы данные из следующих скриптов

Conky Widgets by londonali1010 (2009), (2010) - часы, календарь
Shadowed clock by wlourf (10 jan. 2010) - стрелки часов


Собрал все это Борис Кринкель <olgmen> krinkel@rambler.ru

Для этого серипта требуется CONKY версии 1.8

Для вызова этого скрипта в Conky вставьте следующие строки до TEXT (при условии, что скрипт сохранен в папке ~/scripts/):
    lua_load ~/scripts/olgmen8.lua
    lua_draw_hook_pre widgets
]]

require 'cairo'

--[[ 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,3)
		cairo_arc(cr, m_x,m_y, radius, 0, math.rad(360))
		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
		cairo_fill_preserve(cr)
		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
		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.8), m_y-math.cos(winkel*i)*(radius*0.8))
		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

		end

end

--[[ END AIR CLOCK WIDGET ]]
-- ------------------------------------------------------------------
--[[ Календарь ]]

function calpage(cr, x, y, w, h, bgc, fgc, alpha)

-- функция перекодировки цвета

	local function rgb_to_r_g_b(colour, alpha)
		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
	end
	x0, y0 = x - w/2, y - h/2

	local function set_font_sizes()
		day_size = 1000.0
		date_size = 1000.0
		month_size = 1000.0
		
		local extents = cairo_text_extents_t:create()
		cairo_select_font_face(cr, "PT Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
		cairo_set_font_size(cr, day_size)
		cairo_text_extents(cr, day, extents)
		local wt = math.abs(extents.width)
		local ht = math.abs(extents.y_bearing)
		local scale_w = 0.8*w / wt
		local scale_h = 0.08*h / ht
		local scale
		if scale_w < scale_h then scale = scale_w else scale = scale_h end
		day_size = scale * day_size

		cairo_set_font_size(cr, date_size)
		cairo_text_extents(cr, date, extents)
		wt = math.abs(extents.width)
		ht = math.abs(extents.y_bearing)
		scale_w = 0.6*w / wt
		scale_h = 0.6*h / ht
		if scale_w < scale_h then scale = scale_w else scale = scale_h end
		date_size = scale * date_size

		cairo_set_font_size(cr, month_size)
		cairo_text_extents(cr, month, extents)
		wt = math.abs(extents.width)
		ht = math.abs(extents.y_bearing)
		scale_w = 0.8*w / wt
		scale_h = 0.08*h / ht
		if scale_w < scale_h then scale = scale_w else scale = scale_h end
		month_size = scale * month_size
			
		return day_size, date_size, month_size
	end
	local function draw_text()
		local extents = cairo_text_extents_t:create()
		cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, alpha))

		cairo_set_font_size(cr, day_size)
		cairo_text_extents(cr, day, extents)
		cairo_move_to(cr, x0 + w/2 - extents.x_advance/2, y0 + 0.2*h)
		cairo_show_text(cr, day)

		cairo_set_font_size(cr, date_size)
		cairo_text_extents(cr, date, extents)
		cairo_move_to(cr, x0 + w/2 - extents.x_advance/2, y0 + 0.5*h - extents.y_bearing/2)
		cairo_show_text(cr, date)

		cairo_set_font_size(cr, month_size)
		cairo_text_extents(cr, month, extents)
		cairo_move_to(cr, x0 + w/2 - extents.x_advance/2, y0 + 0.9*h)
		cairo_show_text(cr, month)
	end

-- руссификация

		day = os.date("%u")

		if day == "1" then day = "ПОНЕДЕЛЬНИК"
		elseif day == "2" then day = "ВТОРНИК"
		elseif day == "3" then day = "СРЕДА"
		elseif day == "4" then day = "ЧЕТВЕРГ"
		elseif day == "5" then day = "ПЯТНИЦА"
		elseif day == "6" then day = "СУББОТА"
		elseif day == "7" then day ="ВОСКРЕСЕНЬЕ"
		end

		date = os.date("%d")

		month = os.date("%m")

		if month == "01" then month = "ЯНВАРЯ"
		elseif month == "02" then month = "ФЕВРАЛЯ"
		elseif month == "03" then month = "МАРТА"
		elseif month == "04" then month = "АПРЕЛЯ"
		elseif month == "05" then month = "МАЯ"
		elseif month == "06" then month = "ИЮНЯ"
		elseif month == "07" then month = "ИЮЛЯ"
		elseif month == "08" then month = "АВГУСТА"
		elseif month == "09" then month = "СЕНТЯБРЯ"
		elseif month == "10" then month = "ОКТЯБРЯ"
		elseif month == "11" then month = "НОЯБРЯ"
		elseif month == "12" then month = "ДЕКАБРЯ"
		end

		day_size, date_size, month_size = set_font_sizes()
		draw_text(day_size, date_size, month_size)

end

--[[ END Календарь ]]
-- ---------------------------
--[[ Вывод текста из файла calendar.txt ]]
-- -------------------------------------------------------------------------------------
function calendar_text(cr, x, y, font, font_size, 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

--[[ Виджет выводит сообщения внесенные в текстовый файл calendar.txt расположенный в папке ~/scripts

формат текстового файла
	MMDD;N;TEXT

	MMDD = месяц день
	N    = 0 или 1 (1 вывод текста тем же цветом, что и праздники)
	TEXT = выводимый текст (используйте * для переноса слов на следующую строку)

	Часть настроек находится в виджете
]]

		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

-- путь к файлу с записями праздников и необходимых дат, путь должен быть полным
-- если не используете, оставьте пустое место между ""

		calendar_file="/home/ettore/scripts/calendar.txt"

-- забираем дату из таблицы

		t = os.date('*t')

-- поиск записи в файле calendar.txt

		file = io.open(calendar_file,"r")
		tabcal={}
		idx=1
		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

-- расчет данных для календаря

		local i = 0

		flag = false
		for idy=1,idx-1 do
			if tabcal[idy][1] == os.date("%m%d") then
				if i == 0 then
					today = tabcal[idy]
				end
				if tabcal[idy][2] == "1" then
					flag = true
				end
				break
			end
			
		end


-- вывод текста из файла calendar.txt, если имеется

		have=""
		if today ~= nil 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)

			if flag == true then cairo_set_source_rgba (cr, 1, 0, 0, 1)
-- если выводим отмеченное "1" сообщение, то цвет красный
				else
-- иначе цвет основной
				cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
				end
			have = string.split(today[3],"*")
			for i=1,#have do 
				cairo_move_to(cr, x, y+(i-#have/2)*font_size)
				cairo_show_text(cr, have[i])
				cairo_fill(cr)
			end
		end	
	
end
--[[ END TEXT WIDGET ]]
-- ----------------------------------------------------------
--[[ GRAF ]]
function grafik(cr, x, y, w, h, name, arg, max, 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


		function draw_bar(pct)

		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)
-- рисуем прямую линию
		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
		cairo_set_line_width(cr, 1)
		cairo_move_to(cr, x, y)
		cairo_line_to(cr, w, y)
		cairo_stroke (cr)
-- выводим утолщенную линию, длина зависит от выбираемого параметра в %
		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
		cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)
		cairo_set_line_width (cr, h)
		cairo_move_to (cr, x, y)
		cairo_line_to (cr, x+ w*pct, y)
		cairo_stroke (cr)

		cairo_destroy(cr)
		cr = nil

		end

		local function setup_bars()
			local str=''
			local value=0
-- забираем параметр
			str=string.format('${%s %s}', name, arg)
			str=conky_parse(str)

			value=tonumber(str)
			if ( value == nil ) then value = 0 end

			pct=value/max
			

			draw_bar(pct)
		end

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

		if update_num>5 then
		setup_bars()
		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)
	clock(cr, 10, 15, 90, 0x000000, 1, 0xFFF8DC, 1)
	cairo_destroy(cr)

--calpage(xc, yc, size, bgc, fgc, alpha)
	cr = cairo_create(cs)
	calpage(cr, 155, 60, 100, 100, 0x000000, 0xFFF8DC, 1)
	cairo_destroy(cr)

-- вывод текста из файла calendar.txt
	cr = cairo_create(cs)
	calendar_text(cr, 10, 130, "PT Sans", 14, 0xffffff, 0.6, 0xFFF8DC, 1)
	cairo_destroy(cr)
-- вывод бара
	cr = cairo_create(cs)
	grafik(cr, 10, 245, 200, 8, 'cpu', 'cpu1', 100, 0x000000, 1, 0xFFF8DC, 0.6)
	grafik(cr, 10, 270, 200, 8, 'cpu', 'cpu2', 100, 0x000000, 1, 0xFFF8DC, 0.6)
	grafik(cr, 10, 295, 200, 8, 'downspeedf', 'eth0', 1000, 0x000000, 1, 0xFFF8DC, 0.6)
	grafik(cr, 10, 320, 200, 8, 'upspeedf', 'eth0', 100, 0x000000, 1, 0xFFF8DC, 0.6)
	cairo_destroy(cr)
end
script datatime

Codice: Seleziona tutto

#!/usr/bin/python
import datetime
diff = datetime.datetime.today() - datetime.datetime (2009, 8, 6)
print diff.days,

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 14:37
da alecive
Daniellino93 ha scritto: Ciao a tutti...

quante volte vi è successo di dover scrivere, nel vostro conky, il sistema operativo, la versione del S.O  o il codice di architettura che usa il processore del vostro pc ?

Ecco a voi delle variabili che faranno , da ora in poi, tutto il lavoro al posto vostro.

Senza dover cambiare qualcosa nel conky dopo aver aggiornato il sistema alla prossima versione.

Le 3 variabili:

Variabile Sistema Operativo:

Codice: Seleziona tutto

${pre_exec lsb_release -is}
Variabile versione S.O:

Codice: Seleziona tutto

${pre_exec lsb_release -rs}
Variabile codice architettura processore:

Codice: Seleziona tutto

${pre_exec uname -m}
che è sta roba? cosa fa di preciso il comando pre_exec?

EDIT: perfetto l'ho scoperto..fa esatatmente quello che volevo facesse! mi serviva giusto giusto un comando per eseguire uno script una volta sola... :D

@Daniellino: questo si poteva fare anche prima , con il comando ${exec } ( o execi, excecp, execpi)..solo che consuma più memoria rispetto ai classici comandi del conky (quelli per tirarti fuori le variabili del so ecc), perchè avvia un processo ulteriore e consuma quindi più memoria..

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 14:57
da Diabolik62
fantastico anche
questo di lua

Immagine


anche questo ottimo

http://itmages.ru/image/view/25624/800df0d6
idem
http://itmages.ru/image/view/19654/f03c6e

;D
Immagine

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 16:18
da Diabolik62
altro conky
di olgmen
questo me lo tengo x un po
;D

Immagine

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 18:31
da deegan
Di questo maledetto .lua, che ormai non mi fà più dormire la notte.  (z) a mè interesserebbe visualizzare solo i 2 che vi ho segnato... (yes)

Immagine

Poi quando lo lancio, mi esce sempre in formato desktop, anche se modifico questa stringa:

Codice: Seleziona tutto

own_window_type desktop
Vi posto il tutto!!!!!!

.conkyrc

Codice: Seleziona tutto

# -- Conky settings -- #
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

# -- Window specifications -- #

own_window yes
#own_window_type desktop
#own_window_transparent yes
#own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_title equalizer widget

border_inner_margin 0
border_outer_margin 0

minimum_size 800 750

alignment tm
gap_x 10
gap_y 0

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=24
xftalpha 0.8

uppercase no

default_color FFFFFF


# -- Lua Load -- #
lua_load ~/Scrivania/bargraph.lua
lua_draw_hook_pre main

TEXT
bargraph.lua

Codice: Seleziona tutto

require 'cairo'

--[[ BARGRAPH WIDGET
	v1.3 by wlourf (03 march 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'...
	  or you can set it to "" if you want to display a numeric value with arg=numeric_value
    - "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, or the center of the circle if radius>0
	- "w" and "h" are the width and the height of a block (without caps), w has no effect for "circle" bar
	- "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
	- "radius" : draw the bar on a circle (it's no more a circle, radius = 0 to keep bars)
	- "angle_bar"  : if radius>0 angle_bar is the angle of the bar
v1.0 (10 Feb. 2010) original release
v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value	
v1.2 (28 Feb. 2010) just renamed the widget to bargraph
v1.3 (03 March 2010) added parameters radius & angle_bar to draw the bar in a circular way
]]


function bar_graph(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,radius, angle_bar)
 	local function rgb_to_r_g_b(colour, alpha)
		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
	end

	local function setup_bar_graph()

		local value = 0
		if name ~="" then
			local str = conky_parse(string.format('${%s %s}', name, arg))
			value = tonumber(str)
		else
			value = arg
		end
		if value==nil then value =0 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_rot= rotation*math.pi/180
		local alpha_bar = (angle_bar*math.pi/180)/2
		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_rot)
			local y2=yb-radius0*math.cos(angle_rot)
			
			--line on angle_rot
			local a1=(y2-yb)/(x2-xb)
			local b1=y2-a1*x2

			--line perpendicular to angle_rot
			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_rot)
				yy0=xx0*a2+b2
				yy1=xx1*a2+b2
			end

			local xc,yc
			--perpendicular segment
			if alpha_bar == 0 then
				cairo_move_to (cr, xx0 ,yy0)
				cairo_line_to (cr, xx1 ,yy1)
				xc,yc=(xx0+xx1)/2,(yy0+yy1)/2
			else			
				cairo_arc( cr,
					xb,
					yb,
					radius+(h+space)*(pt)-h/2,
					( -alpha_bar -math.pi/2+angle_rot) ,
					( alpha_bar -math.pi/2+angle_rot) 
				)
				xc=xb+	(radius+(h+space)*(pt))*math.sin(angle_rot)
				yc=yb-	(radius+(h+space)*(pt))*math.cos(angle_rot)			
			end
		
			--colors
			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 segmentation error
	local updates=tonumber(conky_parse('${updates}'))
	if updates> 3 then
		setup_bar_graph()
	end	
end




function conky_main()
	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)

	local x0,y0 = conky_window.width/2, conky_window.height/2
	local blocks = 20
	local cap_round = CAIRO_LINE_CAP_ROUND
	local cap_square = CAIRO_LINE_CAP_SQUARE
	local cap_butt = CAIRO_LINE_CAP_BUTT
	local w,h=20,10
	local s=2
	local bgc,bga = 0x00CC66, 0.5
	local fgc,fga = 0x66FF00, 1
	local alc,ala = 0x00CCFF, 1
	local mid_color,mid_alpha = 0xFFFF00, 1.0
	local led_effect, led_alpha = true ,  1.0
	local alarm = 80
	local smooth = true
	local angle_rot = 45
	local radius=0
	local angle_bar=0

--reminder : the order of the parameters:
--(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,radius,angle_bar)	

--rotating bar in the middle (does not rotate as a second hand, this is just an example)
	if var==nil then var =0 end
	var=var+1
	angle=var
	radius=25
	angle_bar=45
	bar_graph('time', '%S',	60,	blocks, cap_square, x0, y0/2, w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)

--two horizontal lines on the top
	w,h=10,10
	x0,y0=05,05
	s=1
	angle_bar=0	
	angle_rot=90
	
	bar_graph('fs_used_perc', '/home',	100,	70, cap_butt, x0, y0, w,h,s,0x6600FF,bga, 0x6600ff,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)
	bar_graph('fs_used_perc', '/',	100,	70, cap_round, x0, y0+25, 0,10,1,0x6600FF,bga, 0x6600ff,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,100,radius,angle_bar)

--basic example : bottom left
	x0,y0 = 10,conky_window.height-10
	blocks = 20
	w,h=25,10
	s=2
	bgc,bga = 0x009933, 0.3
	fgc,fga = 0x66FF00, 1
	alc,ala = 0xFF0000, 1
	
	led_effect, led_alpha = false ,  1.0
	alarm = 80
	smooth = false
	angle_rot = 0	

	bar_graph('time', '%S',	60,	blocks, cap_butt, x0, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)
	
--inverse example : (on top of the previous)
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+25, 240, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,180,radius,angle_bar)
--no "off-block" and shorter : bottom, second from left
	blocks = 15
	bgc,bga = 0x009933, 0
	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+40, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)

--"led effect" example : bottom, 3rd from left
	bgc,bga = 0x009933, 0.3
	fgc,fga = 0x66FF00, 0
	alc,ala = 0xFF0000, 0
	led_effect, led_alpha = true ,  1.0
	 blocks = 20
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+80, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)

--smooth colors example (4th)
	smooth = true
	mid_color,mid_alpha = nil, 0.5
	fgc,fga = 0x66FF00, 1
	alc,ala = 0xFF0000, 1
	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+120, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)	

--smooth example with additional color in the middle (blue) :  5th
	mid_color,mid_alpha = 0x0000FF, 1
	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+160, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)	
	
--another smooth with no colors at beginning :6 th
	fgc,fga = 0x66FF00, 0
	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+200, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)
	
--rounded cap for the lines : 7th
	bgc,bga = 0x009933, 0.3
	fgc,fga = 0x66FF00, 1
	alc,ala = 0xFF0000, 1
	smooth = false	
	
	bar_graph('time', '%S',	60,	blocks, cap_round, x0+240, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)
	
--continuous bar (space =0) : 8th
	mid_color,mid_alpha = 0xFFFF00, 1
	s=0
	smooth = true
	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+280, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)	
	
--continuous bar (but space = -1) : 9th
	mid_color,mid_alpha = 0xFFFF00, 1
	s=-1
	smooth = true
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+320, y0, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)	

--and three rotations
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+360, y0-h, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,30,radius,angle_bar)	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+400, y0-h, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,60,radius,angle_bar)	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+460, y0-h, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,90,radius,angle_bar)
	
--rounded, no space (2nd in the middle)
	s=0
	bar_graph('time', '%S',	60,	blocks, cap_round, x0+50, y0-300, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)

--rounded, space=2, led effect (3rd in the middle) an angle effect
	led_effect = true
	smooth = false
	bgc,bga = 0x009933, 0.2
	fgc,fga = 0xffff00,0
	alc,ala = 0x00ffff, 0
	led_effect, led_alpha = true ,  1.0	
	s=2
	angle_bar=10
	radius=5
	bar_graph('time', '%S',	60,	blocks, cap_round, x0+100, y0-350, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)

--the big horizontal bars in the middle
	led_effect, led_alpha = true ,  1.0	
	s=0
	h=55
	w=40
	alarm=50
	bga=0
	blocks=12
	--two widget needed to draw first bar
	bar_graph('time', '%S',	60,	blocks, cap_round, x0+110, y0-450, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,90,0,0)
	smooth =true
	bar_graph('time', '%S',	60,	blocks, cap_round, x0+110, y0-450, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,90,0,0)
	--local angle_bar=20
	--second widget, round balls
	smooth =false
	bar_graph('time', '%S',	60,	blocks, cap_round, x0+110, y0-350, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,90,0,0)	
--[[		
	]]
	
--the half circle on right bottom made with two widgets
	bgc,bga = 0x009933, 0.3
	fgc,fga = 0x66FF00, 1
	alc,ala = 0xFF0000, 1
	smooth = false	
	h=5
	x=1
	blocks=20
	radius=30
	angle_bar=90
	angle_rot=45
	alarm=80
	led_effect=false
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+600, y0-150, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)
	
	bgc,bga = 0x66FF00, 1
	fgc,fga = 0x009933, 0.3
	alc,ala = 0xFF0000, 1	
	angle_rot=135
	
	bar_graph('time', '%S',	60,	blocks, cap_butt, x0+600, y0-150, 	w,h,s,bgc,bga, fgc,fga, alc,ala, alarm, led_effect, led_alpha,smooth,mid_color,mid_alpha,angle_rot,radius,angle_bar)	
	cairo_destroy(cr)
	cairo_surface_destroy(cs)
		

end

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 18:53
da MrMars
Mi aiutate a far occupare meno spazio a un piccolo conky?
Vi posto codice e schermata:

Codice: Seleziona tutto

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
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 yes
own_window_class Conky
own_window_transparent yes
#own_window_type override
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 250 0
maximum_width 300

# 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 5

# border width
border_width 1

# Default colors and also border colors
default_color white
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
alignment middle_right
#alignment middle_left
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 1350
gap_y -420


# Subtract file system buffers from used memory?
no_buffers yes

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

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
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

RETE ${hr 2}
${if_existing /proc/net/route eth0}
${voffset 4}${font PizzaDude Bullets:size=16}O${font}   Up: ${upspeed eth0} kb/s ${alignr}${voffset -6}${font PizzaDude Bullets:size=16}N${font}   Upload: ${totalup eth0}      }
${voffset 4}${font PizzaDude Bullets:size=16}U${font}   Down: ${downspeed eth0} kb/s ${alignr}${voffset -6}${font PizzaDude Bullets:size=16}T${font}   Download: ${totaldown eth0}  }
${voffset 4}${font PizzaDude Bullets:size=16}a${font}   Local Ip: ${alignr}${addr eth0}

${else}${if_existing /proc/net/route eth1}
${voffset -6}${font PizzaDude Bullets:size=16}O${font}   Up: ${upspeed eth1} kb/s ${alignr}${upspeedgraph eth1 10,60 3465A4 729FCF}
${voffset 4}${font PizzaDude Bullets:size=16}U${font}   Down: ${downspeed eth1} kb/s ${alignr}${downspeedgraph eth1 10,60 3465A4 729FCF}
${voffset 4}${font PizzaDude Bullets:size=16}N${font}   Upload: ${alignr}${totalup eth1}
${voffset 4}${font PizzaDude Bullets:size=16}T${font}   Download: ${alignr}${totaldown eth1}
${voffset 4}${font PizzaDude Bullets:size=16}a${font}   Local Ip: ${alignr}${addr eth1}
${endif}${else}
${font PizzaDude Bullets:size=16}4${font}   Network Unavailable
${endif}

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 19:05
da alecive
@deegan
cancellali tutti e fattene uno tuo direttametne..fai molto prima
oppure cancellali uno ad uno e guarda qual è! no?

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 19:13
da MrMars
@deegan:

--rounded caps for the line 7th
QUESTO E' QUELLO IN BASSO.

--rounded, space=2, led effect (3rd in the middle) an angle effect
QUESTO E' QUELLO A CONO.

appena trovo quello in alto edito questo post.

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 19:49
da MrMars
EDIT: niente, ho radicalmente cambiato tutto :)

Re: Posta il tuo .conkyrc & png

Inviato: venerdì 2 aprile 2010, 19:55
da Diabolik62
x vedere il conky
normale

Codice: Seleziona tutto

# -- Conky settings -- #
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

# -- Window specifications -- #

own_window yes
#own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_title with lua

border_inner_margin 0
border_outer_margin 0

minimum_size 200 300

alignment tm
gap_x 10
gap_y 0

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=12
xftalpha 0.8

uppercase no

default_color FFFFFF


# -- Lua Load -- #
# SET THE PATH TO THE SCRIPT HERE
#lua_load ~/scripts/equa1.1c/equalizer.lua
#lua_draw_hook_pre main3



# -- Lua Load -- #
lua_load ~/Scrivania/bargraph.lua
lua_draw_hook_pre main

TEXT
;D

Immagine

Re: Posta il tuo .conkyrc & png

Inviato: sabato 3 aprile 2010, 0:56
da deegan
Ragazzi, che vita!!!!!!!!!    ;D

Non ancora finito!!!  (nono)

Immagine

Re: Posta il tuo .conkyrc & png

Inviato: sabato 3 aprile 2010, 1:29
da Diabolik62
;D ;D

Immagine
e sotto metto le graph barre
ma mangiano un casino di cpu
quelle
quale preferisci deegan

Immagine

Re: Posta il tuo .conkyrc & png

Inviato: sabato 3 aprile 2010, 12:45
da MrMars
Diabolik62 ha scritto: ;D ;D
e sotto metto le graph barre
ma mangiano un casino di cpu quelle
Ah ah praticamente metti le barre per vedere quanta cpu ti consuma per disegnare le barre  (rotfl) (rotfl) (rotfl)
troppo forte!

Re: Posta il tuo .conkyrc & png

Inviato: sabato 3 aprile 2010, 12:51
da alecive
più che cpu, il lua consuma ram.. se tieni un conky con dei lua per un paio d'ore consecutive, ti arriva a consumare anche 150 mb!
In pratica il consumo di ram aumenta nel tempo..infatti non li uso più i lua, sono poco utilizzabili

Re: Posta il tuo .conkyrc & png

Inviato: sabato 3 aprile 2010, 14:34
da Diabolik62
domanda
ho aggiornato
il conky-all alla 1.80 rc ora nbon vedo più i mie vecchi
meteo.template
il terminale mi da

Codice: Seleziona tutto

Conky: desktop window (20000c9) is subwindow of root window (13c)
Conky: drawing to desktop window
Conky: drawing to double buffer
Segmentation fault
è possibile tornare alla precedente
versione  >:(
con che comandi :'( ;D
mi quoto risolto

Re: Posta il tuo .conkyrc & png

Inviato: domenica 4 aprile 2010, 1:56
da deegan

Re: Posta il tuo .conkyrc & png

Inviato: domenica 4 aprile 2010, 12:49
da Diabolik62
(nono)

mi riferivo a quella vesione di conky
questo non funge

provalo

Codice: Seleziona tutto

${goto 10}${color8}${font ConkyWeather:size=55}[--datatype=WF]${font}${color}
${voffset -70}${goto 90}${color2}${font Zekton:size=20}[--datatype=DW --shortweekday --startday=0]:${color6} [--datatype=HT]
${goto 90}${voffset -10}${font Zekton:bold:size=9}${color2}Sensación térmica: ${color6}[--datatype=LT --night]${font}
${goto 90}${color2}Mín: ${color6}[--startday=0 --datatype=LT --night] ${color2}Máx: ${color9}[--startday=0 --datatype=HT --night]
${goto 10}${voffset 10}${font Zekton:bold:size=11} ${color7}[--datatype=CC]${color}${font}
${goto 10}${voffset 3}${color7}Visibilidad:${color8} [--datatype=VI]
${goto 10}${voffset 3}${color7}P. de R.: ${color8}[--datatype=DP]${color}
${goto 10}${voffset 3}${color7}Presión: ${color8}[--datatype=BR] - [--datatype=BD]${color}
${goto 10}${voffset 3}${color7}Humedad: ${color8}[--datatype=HM]  ${color7}UV: ${color8}[--datatype=UI] - ${color8}[--datatype=UT]
${goto 15}${voffset 5}${color8}${font SunNMoon:size=50}n${font}${goto 70}${voffset -38}${font Arrows:size 20}${color3}b${color8}${font}[--datatype=SR]
${goto 75}${color0}Luz: [--datatype=DL]
${goto 70}${font Arrows:size 20}${color1}h${color8}${font}[--datatype=SS]${color}
${goto 170}${voffset -50}${font moon phases:size=40}[--datatype=MF]${font}
${goto 15}${font DejaVu Sans Mono:bold:size=7}W:[--datatype=LU] -=- C:[--datatype=LF]${font}
${goto 280}${voffset -250}${font ConkyWindN:size=60}${color8}[--datatype=BS]${font}
${goto 280}${voffset 5}${color7}(${color8}[--datatype=WA]°${color7}) ${color8}[--datatype=WD]
${goto 315}${voffset 5}${color8}[--datatype=WS]
${voffset -100}${goto 380}${color2}[--datatype=DW --shortweekday --startday=1]:${color1}[--datatype=HT --hideunits --hidedegreesymbol --startday=1]${color}/${color7}[--datatype=LT --hideunits --hidedegreesymbol --startday=1]${goto 480}${color2}[--datatype=DW --shortweekday --startday=2]:${color1}[--datatype=HT --hideunits --hidedegreesymbol --startday=2]${color}/${color7}[--datatype=LT --hideunits --hidedegreesymbol --startday=2]${goto 580}${color2}[--datatype=DW --shortweekday --startday=3]:${color1}[--datatype=HT --hideunits --hidedegreesymbol --startday=3]${color}/${color7}[--datatype=LT --hideunits --hidedegreesymbol --startday=3]
${goto 380}${color8}${font ConkyWeather:size=30}[--datatype=WF --startday=1]${goto 480}[--datatype=WF --startday=2]${goto 580}[--datatype=WF --startday=3]${font}${color}
${goto 380}${color7}Sole:${color3}[--datatype=SR --startday=1]${goto 480}${color7}Sole:${color3}[--datatype=SR --startday=2]${goto 580}${color7}Sole:${color3}[--datatype=SR --startday=3]
${goto 380}${color7}   :${color1}[--datatype=SS --startday=1]${color}${goto 480}${color7}   :${color1}[--datatype=SS --startday=2]${color}${goto 580}${color7}   :${color1}[--datatype=SS --startday=3]${color}
${goto 380}${color7}Luce:${color8}[--datatype=DL --startday=1]${color}${goto 480}${color7}Luce:${color8}[--datatype=DL --startday=2]${color}${goto 580}${color7}Luce:${color8}[--datatype=DL --startday=3]${color}
${voffset 10}${color8}${goto 280}${cpubar cpu3 1,370}${color}
${voffset 10}${goto 280}${color2}[--datatype=DW --shortweekday --startday=4]:${color1}[--datatype=HT --hideunits --hidedegreesymbol --startday=4]${color}/${color7}[--datatype=LT --hideunits --hidedegreesymbol --startday=4]${goto 380}${color2}[--datatype=DW --shortweekday --startday=5]:${color1}[--datatype=HT --hideunits --hidedegreesymbol --startday=5]${color}/${color7}[--datatype=LT --hideunits --hidedegreesymbol --startday=5]${goto 480}${color2}[--datatype=DW --shortweekday --startday=6]:${color1}[--datatype=HT --hideunits --hidedegreesymbol --startday=6]${color}/${color7}[--datatype=LT --hideunits --hidedegreesymbol --startday=6]${goto 580}${color2}[--datatype=DW --shortweekday --startday=7]:${color1}[--datatype=HT --hideunits --hidedegreesymbol --startday=7]${color}/${color7}[--datatype=LT --hideunits --hidedegreesymbol --startday=7]
${goto 280}${color8}${font ConkyWeather:size=30}${goto 280}[--datatype=WF --startday=4]${goto 380}[--datatype=WF --startday=5]${goto 480}[--datatype=WF --startday=6]${goto 580}[--datatype=WF --startday=7]${font}${color}
${goto 280}${color7}Sole:${color3}[--datatype=SR --startday=4]${goto 380}${color7}Sol:${color3}[--datatype=SR --startday=5]${goto 480}${color7}Sole:${color3}[--datatype=SR --startday=6]${goto 580}${color7}Sole:${color3}[--datatype=SR --startday=7]
${goto 280}${color7}   :${color1}[--datatype=SS --startday=4]${color}${goto 380}${color7}   :${color1}[--datatype=SS --startday=5]${color}${goto 480}${color7}   :${color1}[--datatype=SS --startday=6]${color}${goto 580}${color7}   :${color1}[--datatype=SS --startday=7]${color}
${goto 280}${color7}Luce:${color8}[--datatype=DL --startday=4]${color}${goto 380}${color7}Luce:${color8}[--datatype=DL --startday=5]${color}${goto 480}${color7}Luce:${color8}[--datatype=DL --startday=6]${color}${goto 580}${color7}Lue:${color8}[--datatype=DL --startday=7]${color}

Re: Posta il tuo .conkyrc & png

Inviato: martedì 6 aprile 2010, 14:29
da deegan
Ho appena finito il conky per ArchLinux, che ve ne pare... ;)

Immagine