Forum dan Chating untuk Pengguna Ubuntu di Indonesia Forum dan Chating untuk Pengguna Ubuntu di Indonesia
Siapa yang Online
36 terdaftar (abu_unaisah, adiinoe, antoniusgenta, apick, ArayZ9dki, B4guZ, bt5, BudaSuyasa, caredox, DBom_Net, enka, fl0w, Gondret, H3dDs, ilham2930, isul, l4ng1t, LCDku, midi, onet, oxxygen, pinguindo, pujiantoarief, rekano, renodacosta, riefTux, rizalnugraha, rockafello, saepol, santenkelapa, sipelaut, Sudoers, thrvers, tririzky, yudiarbi, zeus), 330 Tamu dan 20 Laba-Laba online.
Pengguna Terbaru
renodacosta, ArayZ9dki, B4guZ, fishlover, mahadewa
16772 Pengguna Terdaftar
Posting Terbanyak
thrvers 3643
aptfast 3606
deny26 2435
ninja 2038
Sudoers 1847
blackshirt 1793
lisnux 1779
yogieza 1779
zarkasichan 1544
Nexus 1430
Pengguna Hari Ini

buzzing_bee
Terdaftar: 29 Dec 10
Pesan: 805
Statistik Forum
16772 Pengguna
16 Forum
9408 Topik
90430 Pesan
Max Online: 441 @10 Jan 12 16:03
MediaWiki FUI
Mediawiki FUI
UbuntuGeek
Open Source Indonesia
Daftar Link2 Penting Open Source Indonesia
BlogLog Ubuntu Indonesia
BlogLog: Ringkasan Blog-Blog Ubuntu dalam Bahasa Indonesia
Halaman 8 dari 13 < 1 2 ... 6 7 8 9 10 12 13 >
Opsi Topik
Menilai Topik Ini
#35529 - 29 Aug 10 14:11 Re: Konfigurasi Conky..? **** [Re: aldicoey]
deny26 Offline
Warga

Terdaftar: 03 Jan 10
Pesan: 2435
Lokasi: ubuntu-indonesia.com
wew.... mantap tu... share disini dunkz.. biar temen2 lain bisa pakai..
_________________________
Pemula Ubuntu | Ebook Ubuntu | Indeks Instalasi Ubuntu

Top
#35556 - 29 Aug 10 18:07 Re: Konfigurasi Conky..? [Re: deny26]
k4341 Offline
Warga

Terdaftar: 23 May 10
Pesan: 281
Lokasi: Cirebon
script asli dari sini contoh punya aku
1. Buat folder ~/conky/example1/rings
2. Buat file ~/conky/example1/rings/rings.lua
3. Buat file ~/conky/example1/rings/text.lua

isi rings.lua
Klik untuk menampilkan...
Code:
require 'cairo'
function conky_main_rings()
-- START PARAMETERS HERE
rings_settings={

{
	--Ring 1 :seconds
	name="time",
	arg="%S",
	max=60,
	xc=970,
	yc=50,
	radius=40,
	thickness=10,
	sectors=60,
	gap_sectors=2,
	fill_sector=true,
	bg_colour1={{0,0x111111,0.5},{0.5,0xffffff,0}, {0.5,0x999999,1}},
	fg_colour1={{0,0X000dd0,1},{0.5,0x00d000,0.5}, {1,0xff0000,1}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	{
	--Ring 1-2 :seconds samping
	name="time",
	arg="%S",
	max=60,
	xc=820,
	yc=100,
	radius=100,
	thickness=100,
	start_angle=-10,
	end_angle=350,
	sectors=1,
	gep_sector=-1,
	bg_colour1={{0,0xffffff,1}},
	fg_colour1={{0,0Xdddfff,1}},
	},
	{
	--Ring 1-2 :seconds samping dobel
	name="time",
	arg="%S",
	max=60,
	xc=820,
	yc=100,
	radius=100,
	thickness=100,
	start_angle=1,
	end_angle=360,
	sectors=1,
	gep_sector=-1,
	bg_colour1={{1,0xdddfff,1}},
	fg_colour1={{1,0xffffff,0}},
	},
	{
	--ring 2 :cpu
	name="cpu",
	arg="",
	max=100,
	xc=970,
	yc=130,
	radius=40,
	thickness=10,
	start_angle=-90,
	end_angle=270,
	sectors=20,
	border_size=1,
	bg_colour1={{0,0x777777,0},{0.5,0xe3e3e3,1}, {1,0x777777,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
	},
--ring 2 :swap
	{
	name="swap",
	arg="",
	max=100,
	xc=910,
	yc=210,
	radius=40,
	thickness=10,
	start_angle=-90,
	end_angle=270,
	sectors=20,
	border_size=1,
	bg_colour1={{0,0x777777,0},{0.5,0xe3e3e3,1}, {1,0x777777,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
	},	
	{
	--ring 3 : memory
	name="memperc",
	arg="",
	max=100,
	xc=970,
	yc=210,
	radius=40,
	thickness=10,
	start_angle=-90,
	end_angle=270,
	sectors=20,
	border_size=1,
	bg_colour1={{0,0x777777,0},{0.5,0xe3e3e3,1}, {1,0x777777,0}},
	fg_colour1={{0,0X00ff00,0},{0.5,0xff00ff,1}, {1,0xff0000,0,5}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0,5}},
	bd_colour1={{0,0X0000ff,0},{0.5,0x0000ff,1}, {1,0x0000ff,0}},
	},

	{
	--left half ring 4 : upload speed
	name="upspeedf",
	arg="ppp0",
	max=20,
	xc=970,
	yc=290,
	radius=35,
	thickness=10,
	start_angle=-90,
	end_angle=190,
	sectors=10,
	border_size=1,
	bg_colour1={{0,0X111111,1},{0.5,0x555555,1}, {1,0x999999,0}},
	bg_colour2={{0,0Xe3e3e3,1},{0.5,0xe3e3e3,1}, {1,0xe3e3e3,0}},
	fg_colour1={{0,0X00d000,1},{0.5,0x00ff00,1}, {1,0xFF4500,0}},
	fg_colour2={{0,0XFF4500,1},{0.5,0xFF4500,1}, {1,0x00d000,0}},
	bd_colour1={{0,0Xff0000,0},{0.5,0xff0000,1}, {1,0xff0000,0}},
	},

	{
	--right half ring 5 : download speed
	name="downspeedf",
	arg="ppp0",
	max=20,
	xc=911,
	yc=291,
	radius=35,
	thickness=10,
	start_angle=89,
	end_angle=380,
	sectors=10,
	border_size=1,
	bg_colour1={{0,0X111111,1},{0.5,0x555555,1}, {1,0x999999,0}},
	bg_colour2={{0,0Xe3e3e3,1},{0.5,0xe3e3e3,1}, {1,0xe3e3e3,0}},
	fg_colour1={{0,0X00d000,1},{0.5,0x00ff00,1}, {1,0xFF4500,0}},
	fg_colour2={{0,0XFF4500,1},{0.5,0xFF4500,1}, {1,0x00d000,0}},
	bd_colour1={{0,0Xff0000,0},{0.5,0xff0000,1}, {1,0xff0000,0}},
	},
	
	{
	--ring 6 : /home
	name="fs_used_perc",
	arg="/home",
	max=100,
	xc=970,
	yc=372,
	thickness=40,
	radius=40,
	start_angle=-90,
	end_angle=270,
	sectors=100,
	gap_sectors=-1,
	bg_colour1={{0,0X0000ff,1},{0.75,0xffffff,1}, {1,0x00dd00,1}},
	bg_colour2={{0,0X0000ff,1},{0.75,0xffffff,1}, {1,0x00dd00,1}},
	fg_colour1={{0,0XFF4500,1},{0.75,0xFF4500,1}, {1,0xFFFFFF,1}},
	fg_colour2={{0,0XFFFFFF,1},{0.75,0xFFFFFF,1}, {1,0xFF4500,1}},
	},
	{
	--ring 7 : file system usage for /media/data
	name="fs_used_perc",
	arg="/media/data",
	max=100,
	xc=970,
	yc=454,
	radius=40,
	thickness=40,
	radius=40,
	start_angle=-90,
	end_angle=270,
	sectors=100,
	gap_sectors=-1,
	bg_colour1={{0,0X0000ff,1},{0.75,0xffffff,1}, {1,0x00dd00,1}},
	bg_colour2={{0,0X0000ff,1},{0.75,0xffffff,1}, {1,0x00dd00,1}},
	fg_colour1={{0,0XFF4500,1},{0.75,0xFF4500,1}, {1,0xFFFFFF,1}},
	fg_colour2={{0,0XFFFFFF,1},{0.75,0xFFFFFF,1}, {1,0xFF4500,1}},
	},	
	
	{
	--ring 8 : file system usage for /media/musik
	name="fs_used_perc",
	arg="/media/musik",
	max=100,
	xc=970,
	yc=536,
	thickness=40,
	radius=40,
	start_angle=-90,
	end_angle=270,
	sectors=100,
	gap_sectors=-1,
	bg_colour1={{0,0X0000ff,1},{0.75,0xffffff,1}, {1,0x00dd00,1}},
	bg_colour2={{0,0X0000ff,1},{0.75,0xffffff,1}, {1,0x00dd00,1}},
	fg_colour1={{0,0XFF4500,1},{0.75,0xFF4500,1}, {1,0xFFFFFF,1}},
	fg_colour2={{0,0XFFFFFF,1},{0.75,0xFFFFFF,1}, {1,0xFF4500,1}},
	},		
}
--END OF PARAMETERS HERE

--main function

	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)

	if tonumber(conky_parse('${updates}'))>3 then
		for i in pairs(rings_settings) do
			draw_ring(rings_settings[i])
		end
	end

	cairo_destroy(cr)

end




function draw_ring(t)

	local function rgba_to_r_g_b_a(tcolour)
		colour,alpha=tcolour[2],tcolour[3]
		return ((colour / 0x10000) % 0x100) / 255., 
			((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
	end
			
			
	local function calc_delta(tcol1,tcol2)
		--calculate deltas P R G B A to table_colour 1

		for x = 1, #tcol1 do
			tcol1[x].dA	= 0
			tcol1[x].dP = 0
	 		tcol1[x].dR = 0
			tcol1[x].dG = 0
			tcol1[x].dB = 0
			if tcol2~=nil and #tcol1 == #tcol2 then
				local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
				local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
				tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
		 		tcol1[x].dR = (r2-r1)/t.sectors
				tcol1[x].dG = (g2-g1)/t.sectors
				tcol1[x].dB = (b2-b1)/t.sectors
				tcol1[x].dA = (a2-a1)/t.sectors		
				
			end
		end
		
		return tcol1
	end

	--check values
	local function setup(t)
		if t.name==nil and t.arg==nil then 
			print ("No input values ... use parameters 'name'" +
				" with 'arg' or only parameter 'arg' ") 
			return
		end

		if t.max==nil then
			print ("No maximum value defined, use 'max'")
			print ("for name=" .. t.name)
			print ("with arg=" .. t.arg)
			return
		end
		if t.name==nil then t.name="" end
		if t.arg==nil then t.arg="" end

		if t.xc==nil then t.xc=conky_window.width/2 end
		if t.yc==nil then t.yc=conky_window.height/2 end
		if t.thickness ==nil then t.thickness = 10 end
		if t.radius ==nil then t.radius =conky_window.width/4 end
		if t.start_angle==nil then t.start_angle =0 end
		if t.end_angle==nil then t.end_angle=360 end
		if t.bg_colour1==nil then 
			t.bg_colour1={{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
		end
		if t.fg_colour1==nil then
			t.fg_colour1={{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
		end
		if t.bd_colour1==nil then
			t.bd_colour1={{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}
		end
		if t.sectors==nil then t.sectors=10 end
		if t.gap_sectors==nil then t.gap_sectors=1 end 
		if t.fill_sector==nil then t.fill_sector=false end
		if t.sectors==1 then t.fill_sector=false end
		if t.border_size==nil then t.border_size=0 end
		if t.cap==nil then t.cap="r" end
		--some checks
		if t.thickness>t.radius then t.thickness=t.radius*0.1 end
		t.int_radius = t.radius-t.thickness

		--check colors tables 
		for i=1, #t.bg_colour1 do 
			if #t.bg_colour1[i]~=3 then t.bg_colour1[i]={1,0xFFFFFF,0.5} end
		end
		for i=1, #t.fg_colour1 do 
			if #t.fg_colour1[i]~=3 then t.fg_colour1[i]={1,0xFF0000,1} end
		end
		for i=1, #t.bd_colour1 do 
			if #t.bd_colour1[i]~=3 then t.bd_colour1[i]={1,0xFFFF00,1} end
		end
	
		if t.bg_colour2~=nil then
			for i=1, #t.bg_colour2 do 
				if #t.bg_colour2[i]~=3 then t.bg_colour2[i]={1,0xFFFFFF,0.5} end
			end
		end
		if t.fg_colour2~=nil then
			for i=1, #t.fg_colour2 do 
				if #t.fg_colour2[i]~=3 then t.fg_colour2[i]={1,0xFF0000,1} end
			end
		end
		if t.bd_colour2~=nil then
			for i=1, #t.bd_colour2 do 
				if #t.bd_colour2[i]~=3 then t.bd_colour2[i]={1,0xFFFF00,1} end
			end
		end 	
		
		if t.start_angle>=t.end_angle then
		 local tmp_angle=t.end_angle
		 t.end_angle= t.start_angle
		 t.start_angle = tmp_angle
		 -- print ("inversed angles")
			if t.end_angle-t.start_angle>360 and t.start_angle>0 then
				t.end_angle=360+t.start_angle
				print ("reduce angles")
			end
		
			if t.end_angle+t.start_angle>360 and t.start_angle<=0 then
				t.end_angle=360+t.start_angle
				print ("reduce angles")
			end
		
			if t.int_radius<0 then t.int_radius =0 end
			if t.int_radius>t.radius then
				local tmp_radius=t.radius
				t.radius=t.int_radius
				t.int_radius=tmp_radius
				print ("inversed radius")
			end
			if t.int_radius==t.radius then
				t.int_radius=0
				print ("int radius set to 0")
			end 
		end
		
		t.fg_colour1 = calc_delta(t.fg_colour1,t.fg_colour2)
		t.bg_colour1 = calc_delta(t.bg_colour1,t.bg_colour2)
		t.bd_colour1 = calc_delta(t.bd_colour1,t.bd_colour2)
	end
	
	--initialize table
	setup(t)
	--[[grid
	h=conky_window.height
	w=conky_window.width
	cairo_set_source_rgba(cr,1,1,1,1)
	cairo_set_line_width(cr,0.5)
	cairo_move_to(cr,0,t.yc)
	cairo_line_to(cr,w,t.yc)
	cairo_stroke(cr)
	cairo_move_to(cr,t.xc,0)
	cairo_line_to(cr,t.xc,h)
	cairo_stroke(cr)
	cairo_move_to(cr,t.xc,t.yc)
	cairo_line_to(cr,t.xc+200*math.sin(math.pi/4),t.yc-200*math.cos(math.pi/4))
	cairo_stroke(cr)
	cairo_move_to(cr,0,t.yc-t.radius)
	cairo_line_to(cr,w,t.yc-t.radius)
	cairo_stroke(cr)
	cairo_move_to(cr,0,t.yc-t.int_radius)
	cairo_line_to(cr,w,t.yc-t.int_radius)
	cairo_stroke(cr)
	cairo_move_to(cr,0,t.yc-t.gap_sectors)
	cairo_line_to(cr,w,t.yc-t.gap_sectors)
	cairo_stroke(cr)
	cairo_set_source_rgba(cr,1,0,0,0.5)
	cairo_arc(cr,t.xc,t.yc,t.radius,0,2*math.pi)
	cairo_stroke(cr)
	cairo_arc(cr,t.xc,t.yc,t.int_radius,0,2*math.pi)	
	cairo_stroke(cr)	
	cairo_set_source_rgba(cr,0,1,0,1)	
	cairo_move_to(cr,t.xc+t.gap_sectors,t.yc-t.gap_sectors)
	cairo_line_to(cr,t.xc+400*math.sin(math.pi/4),t.yc-400*math.cos(math.pi/4))
	cairo_stroke(cr)
	--END GRID
	]]
	
	--initialize cairo context
	cairo_save(cr)
	cairo_translate(cr,t.xc,t.yc)
	cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND)
	cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)

	--get value
	local value = 0
	if t.name ~="" then
		value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
	else
		value = tonumber(t.arg)
	end
	if value==nil then value =0 end

	--initialize sectors
	--angle of a sector :
	angleA = ((t.end_angle-t.start_angle)/t.sectors)*math.pi/180
	--value of a sector : 
	valueA = t.max/t.sectors
	--first angle of a sector : 
	lastAngle = t.start_angle*math.pi/180


	local function draw_sector(type_arc,angle0,angle,valpc, idx)
	 
		--this function draws a portion of arc
	 	--type of arc, angle0 = strating angle, angle= angle of sector,
	 	--valpc = percentage inside the sector, idx = sctor number #
		 if type_arc=="bg" then 		--background
			 if valpc==1 then return end
		 	tcolor=t.bg_colour1
		 elseif type_arc=="fg" then	--foreground
		 	if valpc==0 then return end
		 	tcolor=t.fg_colour1
		 elseif type_arc=="bd" then	--border
		 	tcolor=t.bd_colour1
		 end 

		--angles equivalents to gap_sector
		local ext_delta=math.atan(t.gap_sectors/(2*t.radius))
		local int_delta=math.atan(t.gap_sectors/(2*t.int_radius))

		--angles of arcs
		local ext_angle=(angle-ext_delta*2)*valpc
		local int_angle=(angle-int_delta*2)*valpc

		--define colours to use for this sector
		if #tcolor==1 then 
			--plain color
			local vR,vG,vB,vA = rgba_to_r_g_b_a(tcolor[1])
			cairo_set_source_rgba(cr,vR+tcolor[1].dR*idx,
									vG+tcolor[1].dG*idx,
									vB+tcolor[1].dB*idx,
									vA+tcolor[1].dA*idx	)
		else
			--radient color
			local pat=cairo_pattern_create_radial(0,0,t.int_radius,0,0,t.radius)
			for i=1, #tcolor do
				local vP,vR,vG,vB,vA = tcolor[i][1], rgba_to_r_g_b_a(tcolor[i])
				cairo_pattern_add_color_stop_rgba (pat, 
									vP+tcolor[i].dP*idx,
									vR+tcolor[i].dR*idx,
									vG+tcolor[i].dG*idx,
									vB+tcolor[i].dB*idx,
									vA+tcolor[i].dA*idx	)
			end
			cairo_set_source (cr, pat)
			cairo_pattern_destroy(pat)
		end

		--start drawing
		 cairo_save(cr)
		--x axis is parrallel to start of sector
		cairo_rotate(cr,angle0-math.pi/2)

		local ri,re = t.int_radius ,t.radius

		--point A 
		local angle_a
	
		if t.cap == "p" then 
			angle_a = int_delta
			if t.inverse_arc and type_arc ~="bg" then
				angle_a = angle-int_angle-int_delta
			end
			if not(t.inverse_arc) and type_arc =="bg" then
				angle_a = int_delta+int_angle
			end
		else --t.cap=="r"
			angle_a = ext_delta
			if t.inverse_arc and type_arc~="bg" then
				angle_a = angle-ext_angle-ext_delta
			end
			if not(t.inverse_arc) and type_arc=="bg" then
				angle_a = ext_delta+ext_angle
			end
		end
		local ax,ay = ri*math.cos(angle_a),ri*math.sin(angle_a)


		--point B
		local angle_b = ext_delta
		if t.cap == "p" then 
			if t.inverse_arc and type_arc ~="bg" then
				angle_b = angle-ext_angle-ext_delta
			end
			if not(t.inverse_arc) and type_arc=="bg" then
				angle_b = ext_delta+ext_angle
			end
		else
			if t.inverse_arc and type_arc ~="bg" then
				angle_b = angle-ext_angle-ext_delta
			end
			if not(t.inverse_arc) and type_arc=="bg" then
				angle_b = ext_delta+ext_angle
			end
		end
		local bx,by = re*math.cos(angle_b),re*math.sin(angle_b)

		-- EXTERNAL ARC B --> C
		if t.inverse_arc then
			if type_arc=="bg" then
				b0,b1= ext_delta, angle-ext_delta-ext_angle
			else
				b0,b1= angle-ext_angle-ext_delta, angle-ext_delta
			end
		else
			if type_arc=="bg" then
				b0,b1= ext_delta+ext_angle, angle-ext_delta
			else
				b0,b1= ext_delta, ext_angle+ext_delta
			end
		end
		
		---POINT D
		local angle_c 
		if t.cap == "p" then 
			angle_d = angle-int_delta
			if t.inverse_arc and type_arc=="bg" then
				angle_d = angle-int_delta-int_angle	
			end
			if not(t.inverse_arc) and type_arc~="bg" then
				angle_d=int_delta+int_angle
			end
		else
			angle_d = angle-ext_delta
			if t.inverse_arc and type_arc=="bg" then
				angle_d =angle-ext_delta-ext_angle
			end
			if not(t.inverse_arc) and type_arc~="bg" then
				angle_d = ext_angle+ext_delta
			end
		end
		local dx,dy = ri*math.cos(angle_d),ri*math.sin(angle_d)
		
		-- INTERNAL ARC D --> A
		if t.cap=="p" then	
			if t.inverse_arc then	
				if type_arc=="bg" then
					d0,d1= angle-int_delta-int_angle,int_delta
				else
					d0,d1= angle-int_delta, angle- int_angle-int_delta
				end
			else
				if type_arc=="bg" then
					d0,d1= angle-int_delta, int_delta+int_angle
				else
					d0,d1= int_delta+int_angle, int_delta
				end
			end
		else
			if t.inverse_arc then	
				if type_arc=="bg" then	
					d0,d1= angle-ext_delta-ext_angle,ext_delta
				else
					d0,d1= angle-ext_delta, angle- ext_angle-ext_delta
				end
			else
				if type_arc=="bg" then	
					d0,d1= angle-ext_delta,ext_delta+ext_angle
				else	
					d0,d1= ext_angle+ext_delta, ext_delta
				end
			end			
		end
			
		--draw sector
		cairo_move_to(cr,ax,ay)
		cairo_line_to(cr,bx,by)
		cairo_arc(cr,0,0,re,b0,b1)
		cairo_line_to(cr,dx,dy) 
		cairo_arc_negative(cr,0,0,ri,d0,d1)
		 cairo_close_path (cr);

		--stroke or fill sector
		 if type_arc=="bd" then
		 	cairo_set_line_width(cr,t.border_size)
		 	cairo_stroke(cr)
		 else
			 cairo_fill(cr)
		 end

		 cairo_restore(cr)

	 end
	--draw sectors
	local n0,n1,n2 = 1,t.sectors,1
	if t.inverse_arc then n0,n1,n2 = t.sectors,1,-1 end
	local index = 0
	for i = n0,n1,n2 do 
		index = index +1
		local valueZ=1
		local cstA, cstB = (i-1),i
		if t.inverse_arc then cstA,cstB = (t.sectors-i), (t.sectors-i+1) end
		
		if value>valueA *cstA and value<valueA*cstB then
			if not t.fill_sector then
				valueZ = (value-valueA*cstA)/valueA
			end
		else
			if value<valueA*cstB then valueZ=0 end
		end
		
		local start_angle= lastAngle+(i-1)*angleA
		if t.foreground ~= false then 
			draw_sector("fg",start_angle,angleA,valueZ, index)
		end
		if t.background ~= false then 
			draw_sector("bg",start_angle,angleA,valueZ, i)
		end
		if t.border_size>0 then draw_sector("bd",start_angle,angleA,1, i) end
	end

	cairo_restore(cr)
end


--[[END OF RING-SECTORS WIDGET]]


function axis(ctx,alpha)
	cairo_set_line_width(ctx,1)
	cairo_set_source_rgba(ctx,1,0,0,alpha)
	cairo_move_to(ctx,0,0)
	cairo_line_to(ctx,150,0)
	cairo_stroke(ctx)
	cairo_set_source_rgba(ctx,0,1,0,alpha)
	cairo_move_to(ctx,0,0)
	cairo_line_to(ctx,0,150)
	cairo_stroke(ctx)
end	

isi text.lua
Klik untuk menampilkan...
Code:
require 'cairo'

function conky_draw_text()
	--BEGIN OF PARAMETRES
text_settings={

	{
	text="DELVA",
	font_name="Retro Rock Poster",
	font_size=35,
	h_align="c",
	x=823,
	y=55,
	colour={{1,0Xffffff,1}},
	},
	{
	text="LINUX",
	font_name="Retro Rock Poster",
	font_size=20,
	h_align="c",
	x=823,
	y=87,
	colour={{1,0X00dd00,1}},
	},
	{
	text="BERUSAHA SEBELUM MENYERAH",
	font_name="Japan",
	font_size=11,
	h_align="c",
	x=818,
	y=100,
	colour={{1,0Xff0000,1}},
	},
	{
	text=conky_parse("${time %H:%M}"),
	font_name="Arial",
	font_size=40,
	h_align="c",
	x=785,
	y=145,
	bold="true",
	colour={{1,0x0000ff,1}},
	},
	{
	text=conky_parse("${time %A, %d %B %Y}"),
	font_name="Japan",
	font_size=11,
	h_align="c",
	x=823,
	y=160,
	colour={{1,0x0000,1}},
	},
	{
	text=conky_parse("${addr ppp0}"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=823,
	y=186,
	colour={{1,0xff0000,1}},
	},
	{
	text=conky_parse("${sysname} - ${machine}"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=823,
	y=220,
	colour={{0,0x0000ff,0.5},{0.5,0xff0000,1},{1,0x0000ff,0.5}},
	},
	{
	text=conky_parse("${kernel}"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=823,
	y=235,
	colour={{0,0xff0000,1},{0.5,0x00dd00,0.5},{1,0xffff00,1}},
	},

	{
	text=conky_parse("Proses : ${processes}   Runing : ${running_processes}"),
	font_name="Japan",
	font_size=12,
	h_align="l",
	x=750,
	y=570,
	colour={{0,0Xff000,1},{0.5,0xffffff,1}, {1,0xffff44444444-900,0.75}},
	},
	{
	text=conky_parse("CPU : ${freq} MHz"),
	font_name="Japan",
	font_size=12,
	h_align="l",
	x=750,
	y=260,
	colour={{0,0x0000ff,0.5},{0.5,0xff0000,1},{1,0x0000ff,0.5}},
	},
	{
	text=conky_parse("RAM : ${memmax}"),
	font_name="Japan",
	font_size=12,
	h_align="l",
	x=750,
	y=275,
	colour={{0,0x0000ff,0.5},{0.5,0xff0000,1},{1,0x0000ff,0.5}},
	},
	{
	text=conky_parse("Swap : ${swapmax}"),
	font_name="Japan",
	font_size=12,
	h_align="l",
	x=750,
	y=290,
	colour={{0,0x0000ff,0.5},{0.5,0xff0000,1},{1,0x0000ff,0.5}},
	},

	{
	text="NAME",
	font_name="Japan",
	font_size=12,
	h_align="l",
	bold="true",
	x=750,
	y=588,
	colour={{1,0xff0000,1}},
	},
	{
	text=conky_parse("${top name 1}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=600,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 2}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=610,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 3}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=620,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 4}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=630,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 5}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=640,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 6}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=650,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 7}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=660,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 8}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=670,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 9}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=680,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top name 10}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=750,
	y=690,
	colour={{1,0xffffff,1}},
	},
	{
	text="PID",
	font_name="Japan",
	font_size=12,
	h_align="l",
	bold="true",
	x=860,
	y=588,
	colour={{1,0xff0000,1}},
	},
	{
	text=conky_parse("${top pid 1}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=600,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 2}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=610,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 3}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=620,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 4}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=630,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 5}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=640,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 6}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=650,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 7}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=660,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 8}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=670,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 9}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=680,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top pid 10}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=855,
	y=690,
	colour={{1,0xffffff,1}},
	},

	{
	text="CPU%",
	font_name="Japan",
	font_size=12,
	h_align="l",
	bold="true",
	x=900,
	y=588,
	colour={{1,0xff0000,1}},
	},
	{
	text=conky_parse("${top cpu 1}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=600,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 2}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=610,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 3}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=620,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 4}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=630,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 5}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=640,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 6}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=650,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 7}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=660,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 8}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=670,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 9}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=680,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top cpu 10}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=900,
	y=690,
	colour={{1,0xffffff,1}},
	},
	{
	text="MEM%",
	font_name="Japan",
	font_size=12,
	h_align="l",
	bold="true",
	x=950,
	y=588,
	colour={{1,0xff0000,1}},
	},
	{
	text=conky_parse("${top mem 1}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=600,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 2}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=610,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 3}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=620,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 4}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=630,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 5}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=640,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 6}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=650,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 7}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=660,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 8}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=670,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 9}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=680,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${top mem 10}"),
	font_name="Japan",
	font_size=11,
	h_align="l",
	x=950,
	y=690,
	colour={{1,0xffffff,1}},
	},
-- end desain samping kiri
	{
	text=conky_parse("${time %H:%M}"),
	font_name="Japan",
	font_size=18,
	h_align="c",
	bold=true,
	x=970,
	y=55,
	colour={{0.2,0Xfe4500,0.5},{0.5,0xffffff,1},{1,0xfe4500,0.5}},
	},		
	{
	text="cpu",
	font_name="Japan",
	font_size=18,
	h_align="c",
	bold=true,
	x=970,
	y=122,
	colour={{0,0Xfe0000,0.5},{0.5,0xfe0000,1}, {1,0xfe0000,0.5}},
	},
	{
	text=conky_parse("$cpu %"),
	font_name="Japan",
	font_size=14,
	h_align="c",
	x=970,
	y=150,
	colour={{0,0X333333,0.5},{0.5,0x333333,1}, {1,0x333333,0.5}},
	},

	{
	text="mem",
	font_name="Japan",
	font_size=18,
	h_align="c",
	bold=true,
	x=970,
	y=205,
	colour={{0,0Xfe0000,0.5},{0.5,0xfe0000,1}, {1,0xfe0000,0.5}},
	},
	{
	text=conky_parse("$memperc %"),
	font_name="Japan",
	font_size=14,
	h_align="c",
	x=970,
	y=230,
	colour={{0,0X333333,0.5},{0.5,0x333333,1}, {1,0x333333,0.5}},
	},

	{
	text="swap",
	font_name="Japan",
	font_size=18,
	h_align="c",
	x=907,
	y=205,
	colour={{0,0Xfe0000,0.5},{0.5,0xfe0000,1}, {1,0xfe0000,0.5}},
	},
	{
	text=conky_parse("$swapperc %"),
	font_name="Japan",
	font_size=14,
	h_align="c",
	x=910,
	y=230,
	colour={{0,0X333333,0.5},{0.5,0x333333,1}, {1,0x333333,0.5}},
	},				
	{
	text="up",
	font_name="Japan",
	font_size=16,
	h_align="c",
	bold=true,
	x=970,
	y=300,
	colour={{0,0Xfe0000,0.5},{0.5,0xfe0000,1}, {1,0xfe0000,0.5}},
	},	
		
	{
	text=conky_parse("${upspeedf ppp0}"),
	font_name="Japan",
	font_size=14,
	h_align="c",
	bold=true,
	x=970,
	y=285,
	colour={{0,0X00d000,0.5},{0.5,0x00d000,1}, {1,0x00d000,0.5}},
	},
	{
	text="down",
	font_name="Japan",
	font_size=16,
	h_align="c",
	bold=false,
	x=912,
	y=285,
	colour={{0,0Xfe0000,0.5},{0.5,0xfe0000,1}, {1,0xfe0000,0.5}},
	},
	{
	text=conky_parse("${downspeedf ppp0}"),
	font_name="Japan",
	font_size=14,
	h_align="c",
	bold=true,
	x=911,
	y=305,
	colour={{0,0X00d000,0.5},{0.5,0x00d000,1}, {1,0x00d000,0.5}},
	},		
	{
	text="Home",
	font_name="Japan",
	font_size=15,
	h_align="c",
	bold=true,
	x=970,
	y=360,
	colour={{0,0Xfffff,0.5},{0.5,0xffffff,1}, {1,0xffffff,0.5}},
	},	
		
	{
	text=conky_parse("${fs_used_perc /home} Mib"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=970,
	y=381,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${fs_free_perc /home} Mib"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=970,
	y=394,
	colour={{1,0xffffff,1}},
	},
	{
	text="Data",
	font_name="Japan",
	font_size=15,
	h_align="c",
	bold=true,
	x=970,
	y=443,
	colour={{0,0Xfffff,0.5},{0.5,0xffffff,1}, {1,0xffffff,0.5}},
	},	
	{
	text=conky_parse("${fs_used_perc /media/data} Mib"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=970,
	y=462,
	colour={{1,0xffffff,1}},
	},
	{
	text=conky_parse("${fs_free_perc /media/data} Mib"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=970,
	y=475,
	colour={{1,0xffffff,1}},
	},				
	{
	text="Musik",
	font_name="Japan",
	font_size=15,
	h_align="c",
	bold=true,
	x=970,
	y=526,
	colour={{0,0Xfffff,0.5},{0.5,0xffffff,1}, {1,0xffffff,0.5}},
	},
	{
	text=conky_parse("${fs_used_perc /media/musik} Mib"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=970,
	y=543,
	colour={{1,0xffffff,1}},
	},	
	{
	text=conky_parse("${fs_free_perc} Mib"),
	font_name="Japan",
	font_size=12,
	h_align="c",
	x=970,
	y=556,
	colour={{1,0xffffff,1}},
	},
	{
	text="BACALAH SHOLWAT NABI",
	font_name="Japan",
	font_size=12,
	h_align="c",
	bold=true,
	x=835,
	y=450,
	colour={{0,0X00dd00,1},{0.5,0xffffff,1}, {1,0xff0000,0.75}},
	},
	{
	text="7.000 KALI UNTUK",
	font_name="Japan",
	font_size=12,
	h_align="c",
	bold=true,
	x=835,
	y=465,
	colour={{0,0Xff000,1},{0.5,0xffffff,1}, {1,0xff0000,0.75}},
	},
	{
	text="MENEBUS KITA DARI",
	font_name="Japan",
	font_size=12,
	h_align="c",
	bold=true,
	x=835,
	y=480,
	colour={{0,0Xff000,1},{0.5,0xffffff,1}, {1,0xff0000,0.75}},
	},
	{
	text="NERAKA",
	font_name="Screamo",
	font_size=40,
	h_align="c",
	x=835,
	y=517,
	colour={{1,0Xff0000,1}},
	},
		}
	
 
           
    
    
--------------END OF PARAMETERES----------------
    if conky_window == nil then return end
    if tonumber(conky_parse("$updates"))<3 then return end
       
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)

    for i,v in pairs(text_settings) do    
        cr = cairo_create (cs)
        display_text(v)
        cairo_destroy(cr)
    end
    
    cairo_surface_destroy(cs)
    


end

function rgb_to_r_g_b2(tcolour)
    colour,alpha=tcolour[2],tcolour[3]
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function display_text(t)

    local function set_pattern()
        --this function set the pattern
        if #t.colour==1 then 
            cairo_set_source_rgba(cr,rgb_to_r_g_b2(t.colour[1]))
        else
            local pat
            
            if t.radial==nil then
                local pts=linear_orientation(t,te)
                pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
            else
                pat = cairo_pattern_create_radial (t.radial[1],t.radial[2],t.radial[3],t.radial[4],t.radial[5],t.radial[6])
            end
        
            for i=1, #t.colour do
                cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgb_to_r_g_b2(t.colour[i]))
            end
            cairo_set_source (cr, pat)
        end
    end
    
    --set default values if needed
    if t.text==nil then t.text="Conky is good for you !" end
    if t.x==nil then t.x = conky_window.width/2 end
    if t.y==nil then t.y = conky_window.height/2 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,1}} end
    if t.font_name==nil then t.font_name="Free Sans" end
    if t.font_size==nil then t.font_size=14 end
    if t.angle==nil then t.angle=0 end
    if t.italic==nil then t.italic=false end
    if t.oblique==nil then t.oblique=false end
    if t.bold==nil then t.bold=false end
    if t.radial ~= nil then
        if #t.radial~=6 then 
            print ("error in radial table")
            t.radial=nil 
        end
    end
    if t.orientation==nil then t.orientation="ww" end
    if t.h_align==nil then t.h_align="l" end
    if t.v_align==nil then t.v_align="b" end    
    if t.reflection_alpha == nil then t.reflection_alpha=0 end
    if t.reflection_length == nil then t.reflection_length=1 end
    if t.reflection_scale == nil then t.reflection_scale=1 end
    if t.skew_x==nil then t.skew_x=0 end
    if t.skew_y==nil then t.skew_y=0 end    
    cairo_translate(cr,t.x,t.y)
    cairo_rotate(cr,t.angle*math.pi/180)
    cairo_save(cr)       
     
 

    local slant = CAIRO_FONT_SLANT_NORMAL
    local weight =CAIRO_FONT_WEIGHT_NORMAL
    if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
    if t.oblique then slant = CAIRO_FONT_SLANT_OBLIQUE end
    if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end
    
    cairo_select_font_face(cr, t.font_name, slant,weight)
 
    for i=1, #t.colour do    
        if #t.colour[i]~=3 then 
            print ("error in color table")
            t.colour[i]={1,0xFFFFFF,1} 
        end
    end

    local matrix0 = cairo_matrix_t:create()
    skew_x,skew_y=t.skew_x/t.font_size,t.skew_y/t.font_size
    cairo_matrix_init (matrix0, 1,skew_y,skew_x,1,0,0)
    cairo_transform(cr,matrix0)
    cairo_set_font_size(cr,t.font_size)
    te=cairo_text_extents_t:create()
    cairo_text_extents (cr,t.text,te)
    
    set_pattern()


            
    mx,my=0,0
    
    if t.h_align=="c" then
        mx=-te.width/2
    elseif t.h_align=="r" then
        mx=-te.width
    end
    if t.v_align=="m" then
        my=-te.height/2-te.y_bearing
    elseif t.v_align=="t" then
        my=-te.y_bearing
    end
    cairo_move_to(cr,mx,my)
    
    cairo_show_text(cr,t.text)

     
        
        
   if t.reflection_alpha ~= 0 then 
        local matrix1 = cairo_matrix_t:create()
        cairo_set_font_size(cr,t.font_size)

        cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(te.height+te.y_bearing+my)*(1+t.reflection_scale))
        cairo_set_font_size(cr,t.font_size)
        te=cairo_text_extents_t:create()
        cairo_text_extents (cr,t.text,te)
        
                
        cairo_transform(cr,matrix1)
        set_pattern()
        cairo_move_to(cr,mx,my)
        cairo_show_text(cr,t.text)

        local pat2 = cairo_pattern_create_linear (0,
                                        (te.y_bearing+te.height+my),
                                        0,
                                        te.y_bearing+my)
        cairo_pattern_add_color_stop_rgba (pat2, 0,1,0,0,1-t.reflection_alpha)
        cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)    
        
        
        cairo_set_line_width(cr,1)
        dy=te.x_bearing
        if dy<0 then dy=dy*(-1) end
        cairo_rectangle(cr,mx+te.x_bearing,te.y_bearing+te.height+my,te.width+dy,-te.height*1.05)
        cairo_clip_preserve(cr)
        cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
        --cairo_stroke(cr)
        cairo_mask(cr,pat2)
        cairo_pattern_destroy(pat2)
        cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
    end
    
end


function linear_orientation(t,te)
    local w,h=te.width,te.height
    local xb,yb=te.x_bearing,te.y_bearing
    
    if t.h_align=="c" then
        xb=xb-w/2
    elseif t.h_align=="r" then
        xb=xb-w
       end    
    if t.v_align=="m" then
        yb=-h/2
    elseif t.v_align=="t" then
        yb=0
       end    
       
    if t.orientation=="nn" then
        p={xb+w/2,yb,xb+w/2,yb+h}
    elseif t.orientation=="ne" then
        p={xb+w,yb,xb,yb+h}
    elseif t.orientation=="ww" then
        p={xb,h/2,xb+w,h/2}
    elseif vorientation=="se" then
        p={xb+w,yb+h,xb,yb}
    elseif t.orientation=="ss" then
        p={xb+w/2,yb+h,xb+w/2,yb}
    elseif vorientation=="ee" then
        p={xb+w,h/2,xb,h/2}        
    elseif t.orientation=="sw" then
        p={xb,yb+h,xb+w,yb}
    elseif t.orientation=="nw" then
        p={xb,yb,xb+w,yb+h}
    end
    return p
end
_________________________
Berusaha sampai darah mendidih sebelum menyerah.
Darah mendidih = kamus klasik berbicara.
9.04 --->> 10.10

Top
#35557 - 29 Aug 10 19:03 Re: Konfigurasi Conky..? [Re: k4341]
aldicoey Offline
Warga

Terdaftar: 23 Jun 10
Pesan: 247
Lokasi: bangkalan
ini btuh font paan kak??
_________________________
my laptop is my inspiration ...

Top
#35559 - 29 Aug 10 19:42 Re: Konfigurasi Conky..? [Re: aldicoey]
k4341 Offline
Warga

Terdaftar: 23 May 10
Pesan: 281
Lokasi: Cirebon
ma'af ada yang lupa... setting conky.conf
isinya conky.conf
Klik untuk menampilkan...
Code:
# -- 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
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048
imlib_cache_size 0

own_window_type desktop
#own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
#own_window yes
#own_window_transparent no
#own_window_argb_visual yes
#own_window_title rings + text widgets

border_inner_margin 1
border_outer_margin 0

minimum_size 100
maximum_width 200

alignment top_right
gep_x 10
gep_y 10 

# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# -- Lua load -- #
lua_load ~/conky/rings/example1/rings.lua
lua_load ~/conky/rings/example1/text.lua
lua_draw_hook_pre main_rings
lua_draw_hook_post draw_text
TEXT

font nya bisa di kreasi sendiri dan disini aku pake retroRockPoster.ttf Screamo.ttf Arial.ttf dari freefonts.com

bisa suport lua kalu perintah conky -v keluar
Klik untuk menampilkan...
Code:
diana@diana-desktop:~$ conky -v
Conky 1.8.0 compiled Fri Apr 23 10:38:37 UTC 2010 for Linux 2.6.24-27-server (i686)

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

 X11:
  * Xdamage extension
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual

 Music detection:
  * MPD
  * MOC

 General:
  * math
  * hddtemp
  * portmon
  * Curl
  * RSS
  * Weather (METAR)
  * Weather (XOAP)
  * wireless
  * support for IBM/Lenovo notebooks
  * nvidia
  * eve-online
  * config-output
  * Imlib2
  * ALSA mixer support
  * apcupsd
  * iostats
  * ncurses
  * Lua

  Lua bindings:
   * Cairo
   * Iml


diEdit oleh k4341 (29 Aug 10 19:50)
_________________________
Berusaha sampai darah mendidih sebelum menyerah.
Darah mendidih = kamus klasik berbicara.
9.04 --->> 10.10

Top
#35600 - 29 Aug 10 23:09 Re: Konfigurasi Conky..? [Re: k4341]
aldicoey Offline
Warga

Terdaftar: 23 Jun 10
Pesan: 247
Lokasi: bangkalan
yg conky.conf tu .conkyrc y???
conky yg biasa??? pa perlu bwt lagi???
_________________________
my laptop is my inspiration ...

Top
#35602 - 29 Aug 10 23:26 Re: Konfigurasi Conky..? [Re: aldicoey]
etc Offline
Warga

Terdaftar: 05 Apr 10
Pesan: 506
Lokasi: Indonesia
klo saya conky.conf, di lucid saya gk ada .conkyrc nya di /home
jadi saya coba aja edit conky.conf..ternyata bisa hehe grin
_________________________




Top
#35604 - 29 Aug 10 23:50 Re: Konfigurasi Conky..? [Re: etc]
aldicoey Offline
Warga

Terdaftar: 23 Jun 10
Pesan: 247
Lokasi: bangkalan
lah . . . brusan dcoba kok mlah shortcut kedip2???
_________________________
my laptop is my inspiration ...

Top
#35613 - 30 Aug 10 00:38 Re: Konfigurasi Conky..? [Re: aldicoey]
deny26 Offline
Warga

Terdaftar: 03 Jan 10
Pesan: 2435
Lokasi: ubuntu-indonesia.com
conky.conf ataupun conkyrc sama bro,, yang penting conky mengenali configurasinya.. pas load conky kan sekaligus memetakan mana file config conky yang dijalankan..
_________________________
Pemula Ubuntu | Ebook Ubuntu | Indeks Instalasi Ubuntu

Top
#35628 - 30 Aug 10 05:01 Re: Konfigurasi Conky..? [Re: deny26]
aldicoey Offline
Warga

Terdaftar: 23 Jun 10
Pesan: 247
Lokasi: bangkalan
hmm ... kok stelah ngelakuin ini shortcut d desktopq kedip2???
hilang ada hilang ada ...
_________________________
my laptop is my inspiration ...

Top
#35759 - 31 Aug 10 01:10 Re: Konfigurasi Conky..? [Re: aldicoey]
ninja Moderator Offline
Warga

Terdaftar: 27 Jan 10
Pesan: 2038
Lokasi: Tangerang, Banten, indonesia
wah...
semakin mantep-manyep kreasinya neh...
lanjutkan bro smile
_________________________
My Blog | Twitter |
Optimalisasi & Desktop Efek


Top
#35787 - 31 Aug 10 08:11 Re: Konfigurasi Conky..? [Re: k4341]
alief Offline
Warga

Terdaftar: 03 Jul 10
Pesan: 54
Lokasi: gunung bayan, kaltim
gan, folder example1 itu di dalam folder conky yang mana ya?
_________________________
Belajar untuk kehidupan yang lebih baik.

Blog : http://nuralief.web.id | http://lintasbatas.org

fb ane facebook.com/ndaroini

Top
#35864 - 01 Sep 10 00:59 Re: Konfigurasi Conky..? [Re: alief]
k4341 Offline
Warga

Terdaftar: 23 May 10
Pesan: 281
Lokasi: Cirebon
Kutip: alief
gan, folder example1 itu di dalam folder conky yang mana ya?

ke folder conky di home user, Langsung contoh /home/k4341/conky/example1/rings/rings.lua
tapi bisa di sederhanakan dengan
1. Taruh file conky.conf, rings.lua dan text.lua ke folder /home/k4341/conky.
2. edit conky.conf bagian lua_load ~/conky/example1/rings/rings.lua
lua_load ~/conky/example1/rings/text.lua
menjadi lua_load ~/conky/rings.lua
lua_load ~/conky/text.lua

3. cd /etc/conky
4. buat link sudo ln -s /home/k4341/conky/conky.conf

Kalau punyaku, Berhubung lua memakan banyak kerja cpu, jadi aku buat 2 conky 1.conky+lua 2.conky_biasa "tanpa lua"
Klik untuk menampilkan...
Code:
di folder /home/k4341/conky ada 4 file: conky.conf, conky_biasa, rings.lua dan text.lua

1.untuk autoload dibuat script sudo nano /usr/sbin/conkystart
Klik untuk menampilkan...
Code:
#!/bin/bash
sleep 25s && cflav

dan untuk startupnya sudah ada yang ngebahas.
2.buat file cflav di /usr/local/bin sudo gedit /usr/local/bin/cflav
isinya
Klik untuk menampilkan...
Code:
#!/bin/bash
killall conky
ans=$(zenity  --title "Conky" --width="200" --height="110" --list  --text  "Pilihan Conky" --radiolist  --column "Select" --column "configuration file" FALSE "conky lua" FALSE "conky biasa"); echo $ans

if [ $? -eq 1 ] ; then
exit 1
fi 

case $ans in

"conky lua") conky -c ~/conky/conky.conf&;;

"conky biasa") conky -c ~/conky/conky_biasa &;;

esac

dengan script ini setiap startup conky meminta pilihan antara conky+lua dan conky biasa, atau di tengah perjalanan kita bisa mengganti dari conky+lua ke conky+biasa atau sebaliknya, dengan perintah cflav.
Note: kalo masih ga jalan coba tambah permisi** perintah
sudo chmod a+x /usr/local/bin/cflav
sudo chmod a+x /usr/sbin/conkystart


diEdit oleh k4341 (01 Sep 10 01:19)
_________________________
Berusaha sampai darah mendidih sebelum menyerah.
Darah mendidih = kamus klasik berbicara.
9.04 --->> 10.10

Top
#35911 - 01 Sep 10 16:25 Re: Konfigurasi Conky..? [Re: k4341]
alief Offline
Warga

Terdaftar: 03 Jul 10
Pesan: 54
Lokasi: gunung bayan, kaltim
kalo nampilin modem kayak apa ya gan?
_________________________
Belajar untuk kehidupan yang lebih baik.

Blog : http://nuralief.web.id | http://lintasbatas.org

fb ane facebook.com/ndaroini

Top
#35912 - 01 Sep 10 16:36 Re: Konfigurasi Conky..? [Re: alief]
aptfast Offline
Warga

Terdaftar: 04 Jan 10
Pesan: 3606
Lokasi: Jakarta, Indonesia
Kutip: alief
kalo nampilin modem kayak apa ya gan?


bro alief, bisa nambah command-2 berikut

${color white}PPP - ${addr ppp0}$color
Up: ${upspeedf ppp0} k/s ${alignr}Down: ${downspeedf ppp0} k/s
${alignr}${upspeedgraph ppp0 25,127 000000 00ff00} ${downspeedgraph ppp0 25,127 000000 ff0000} $color
Total: Total: ${totalup ppp0} ${alignr}${totaldown ppp0}
_________________________
Cara mengatasi problem ACPI/DSDT di notebook Toshiba L510-Core I3
http://ubuntu-indonesia.com/forums/ubbthreads.php/topics/44612/1

"HP Mini 210-1000 w/ LINUXMINT KDE 12 (LISA)"

Top
#35923 - 01 Sep 10 18:11 Re: Konfigurasi Conky..? [Re: aptfast]
alief Offline
Warga

Terdaftar: 03 Jul 10
Pesan: 54
Lokasi: gunung bayan, kaltim
Kutip: aptfast
Kutip: alief
kalo nampilin modem kayak apa ya gan?


bro alief, bisa nambah command-2 berikut

${color white}PPP - ${addr ppp0}$color
Up: ${upspeedf ppp0} k/s ${alignr}Down: ${downspeedf ppp0} k/s
${alignr}${upspeedgraph ppp0 25,127 000000 00ff00} ${downspeedgraph ppp0 25,127 000000 ff0000} $color
Total: Total: ${totalup ppp0} ${alignr}${totaldown ppp0}


makasih deh kaka......
_________________________
Belajar untuk kehidupan yang lebih baik.

Blog : http://nuralief.web.id | http://lintasbatas.org

fb ane facebook.com/ndaroini

Top
#36875 - 14 Sep 10 15:28 Re: Konfigurasi Conky..? [Re: alief]
zerocode Offline
Warga

Terdaftar: 22 Jun 10
Pesan: 97
Lokasi: Pekanbaru,Riau,INDONESIA,BUMI
ada yang bisa ngasih yang udah komplit ga ama nubi
_________________________
kemana prompt ane ada yang maling ne!

Top
#36877 - 14 Sep 10 15:57 Re: Konfigurasi Conky..? [Re: zerocode]
aptfast Offline
Warga

Terdaftar: 04 Jan 10
Pesan: 3606
Lokasi: Jakarta, Indonesia
Kutip: Reidan87
ada yang bisa ngasih yang udah komplit ga ama nubi


bro Reidan87, dibaca dulu ya dari awal...
pasti ngatri... laugh
_________________________
Cara mengatasi problem ACPI/DSDT di notebook Toshiba L510-Core I3
http://ubuntu-indonesia.com/forums/ubbthreads.php/topics/44612/1

"HP Mini 210-1000 w/ LINUXMINT KDE 12 (LISA)"

Top
#38210 - 28 Sep 10 23:41 Re: Konfigurasi Conky..? [Re: aptfast]
pingsut Offline
Warga

Terdaftar: 16 May 10
Pesan: 584
Lokasi: Yogyakarta
conky saya saat ini....


grin
_________________________
Adobe Photoshop CS7 Full Crack | CorelDRAW X9 Full Crack laugh
E-book FUI | E-book Bikin Desain Kaos | Blog Isengku
Log Belajar Online di IRC
Gabung di IRC #ubuntu-indonesia @irc.freenode.net yuk...

Top
#38218 - 29 Sep 10 00:17 Re: Konfigurasi Conky..? [Re: pingsut]
yogieza Offline
Warga

Terdaftar: 17 Feb 10
Pesan: 1779
Lokasi: Kebumen, Indonesia
Kutip: pingsut
conky saya saat ini....


grin

bagi konfigurasinya dong bang grin
_________________________
Lenovo G450 + Debian Squeeze + Sabily Badr + ZTE AC2726

Top
#38221 - 29 Sep 10 00:49 Re: Konfigurasi Conky..? [Re: yogieza]
pingsut Offline
Warga

Terdaftar: 16 May 10
Pesan: 584
Lokasi: Yogyakarta
Kutip: yogieza
Kutip: pingsut
conky saya saat ini....


grin

bagi konfigurasinya dong bang grin

download di mari aja bang...
silahkan di edit suka2... abang grin
_________________________
Adobe Photoshop CS7 Full Crack | CorelDRAW X9 Full Crack laugh
E-book FUI | E-book Bikin Desain Kaos | Blog Isengku
Log Belajar Online di IRC
Gabung di IRC #ubuntu-indonesia @irc.freenode.net yuk...

Top
Halaman 8 dari 13 < 1 2 ... 6 7 8 9 10 12 13 >


Moderator:  ninja 
Download Ebook FUI
Ebook FUI
Uneg-Uneg Pengguna


Ubuntu 11.10 Oneiric
Versi Ubuntu terbaru segera hadir!
Ubuntu-Indonesia.com
di Facebook
Kamus Dwibahasa