Bem-vindo: Dom, 27 de Setembro 2020, 16:09 Pesquisa avançada

Partilhe aqui configurações do Conky!!

Apresente aqui temas que gostou, skins de programas, ícones, wallpapers, conky's, etc. Ou seja, tudo o que possa alterar de estético no seu Ubuntu, apresente aqui. Em caso de dúvidas de personalização ou se quiser mostrá-la ao mundo, utilize esta secção!

Re: Partilhe a configuração do seu Conky!!

Mensagempor zardos666 » Sáb, 23 de Julho 2011, 12:43

rrack, em relaçao ao teu 3º post

Penso que te enganaste no start_conky.sh

Código: Selecionar todos
conky -c ~/.conkycolors/conkyrc2&


penso que o nome do ficheiro é conkyrc, como deste em cima :P

Mas tenho uma duvida, é a primeira vez que uso este tipo de configurações, fui sempre adepto de configuraçoes simples, em relação aos graficos, preciso de instalar alguma coisa para aparecerem? É que nao me estao a aparecer :/

Obrigado :P

zardos666
 
Mensagens: 28
Registrado em: 10 Junho, 2011

Re: Partilhe a configuração do seu Conky!!

Mensagempor zardos666 » Sáb, 23 de Julho 2011, 13:05

Já descubri o problema :P

O conkyrc procurava 2 ficheiros

Código: Selecionar todos
lua_load ~/.conkycolors/combined.lua
lua_load ~/.conkycolors/bargraph.lua


e a minha pasta tinha outro nome :P
está muito bom mesmo :D

zardos666
 
Mensagens: 28
Registrado em: 10 Junho, 2011

Re: Partilhe a configuração do seu Conky!!

Mensagempor Roger Braga » Seg, 25 de Julho 2011, 16:47

Conky Modificado

Imagem


Imagem

conkyrc
Spoiler:
# 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
background yes

# Create own window instead of using desktop (required in nautilus)
own_window yes
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 325 250
#maximum_width 325

# 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

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 39

# 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 1
# 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
${image ~/.Conky1/bionic/pix/hdd_pix.png -p 0,10 -s 127x74}
${voffset 0}${goto 150}${color white}${font Astron Boy Gothic:size=10}Home: ${fs_bar 7,100 /media/}
${voffset 0}${goto 150}used: ${fs_used /}
${voffset 0}${goto 150}FREE: ${fs_free /}
${voffset 0}${goto 150}SIZE: ${fs_size /}
${image ~/.Conky1/bionic/pix/usbkey.png -p 0,110 -s 127x74}
${voffset 15}${goto 150}${color white}${font Astron Boy Gothic:size=10}Root: ${fs_bar 7,100 /media/}
${voffset 0}${goto 150}used: ${fs_used /}
${voffset 0}${goto 150}FREE: ${fs_free /}
${voffset 0}${goto 150}SIZE: ${fs_size /}


conkyrc1
Spoiler:
# — Conky settings — #

background yes

update_interval 1
total_run_times 0
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

temperature_unit celcius

# — Window specifications — #

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

border_inner_margin 0
border_outer_margin 0

minimum_size 270 930
maximum_width 270

alignment bottom_right

gap_x 0
gap_y 75


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

# — Text settings — #
use_xft yes
xftfont hooge 05_54:size=6
xftalpha 0.1

default_color FFFFFF
default_gauge_size 47 25

uppercase no
use_spacer right

color0 white
color1 orange
color2 green

# — Lua Load — #

lua_load ~/.Conky1/bionic/scripts/rings.lua
lua_draw_hook_pre main_rings

TEXT
${image ~/.Conky1/bionic/pix/bg.png -p 0,0 -s 270x930}
${voffset 45}${font DejaVuSans-Bold:size=13}${goto 20}Cpu1:${cpu cpu1}%
${voffset 25}${goto 160}Cpu2:${cpu cpu2}%
${voffset 165}${goto 160}${font DejaVuSans-Bold:size=12}${memperc}%
${voffset 45}${goto 170}IN:
${goto 174}${downspeed eth0}
${voffset 1}${goto 170}OUT:
${goto 176}${upspeed eth0}
${voffset 301}${goto 85}${time %D :%H:%M:%S}
${image ~/.Conky1/bionic/pix/bra.png -p 128,776 -s 65x65}


rings.lua
Spoiler:
--[[ RINGS with SECTORS widget
v1.0 by wlourf (08.08.2010)
this widget draws a ring with differents effects
http://u-scripts.blogspot.com/2010/08/r ... dgets.html

To call the script in a conky, use, before TEXT
lua_load /path/to/the/script/rings.lua
lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT


Parameters are :
3 parameters are mandatory
name - the name of the conky variable to display,
for example for {$cpu cpu0}, just write name="cpu"
arg - the argument of the above variable,
for example for {$cpu cpu0}, just write arg="cpu0"
arg can be a numerical value if name=""
max - the maximum value the above variable can reach,
for example for {$cpu cpu0}, just write max=100

Optional parameters:
xc,yc - coordinates of the center of the ring,
default = middle of the conky window
radius - external radius of the ring, in pixels,
default = quarter of the width of the conky window
thickness - thickness of the ring, in pixels, default = 10 pixels
start_angle - starting angle of the ring, in degrees, value can be negative,
default = 0 degree
end_angle - ending angle of the ring, in degrees,
value must be greater than start_angle, default = 360 degrees
sectors - number of sectors in the ring, default = 10
gap_sectors - gap between two sectors, in pixels, default = 1 pixel
cap - the way to close a sector, available values are
"p" for parallel , default value
"r" for radial (follow the radius)
inverse_arc - if set to true, arc will be anticlockwise, default=false
border_size - size of the border, in pixels, default = 0 pixel i.e. no border
fill_sector - if set to true, each sector will be completely filled,
default=false, this parameter is inoperate if sectors=1
background - if set to false, background will not be drawn, default=true
foreground - if set to false, foreground will not be drawn, default=true

Colours tables below are defined into braces :
{position in the gradient (0 to 1), colour in hexadecimal, alpha (0 to 1)}
example for a single colour table :
{{0,0xFFAA00,1}} position parameter doesn't matter
example for a two-colours table :
{{0,0xFFAA00,1},{1,0x00AA00,1}} or {{0.5,0xFFAA00,1},{1,0x00AA00,1}}
example for a three-colours table :
{{0,0xFFAA00,1},{0.5,0xFF0000,1},{1,0x00AA00,1}}

bg_colour1 - colour table for background,
default = {{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
fg_colour1 - colour table for foreground,
default = {{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
bd_colour1 - colour table for border,
default = {{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}

Seconds tables for radials gradients :
bg_colour2 - second colour table for background, default = no second colour
fg_colour2 - second colour table for foreground, default = no second colour
bd_colour2 - second colour table for border, default = no second colour

v1.0 (08 Aug. 2010) original release

]]


require 'cairo'
function conky_main_rings()
-- START PARAMETERS HERE
rings_settings={
{
name="time",
arg="%S",
max=60,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x00FF00,0.6}},
},
{
name="time",
arg="%M.%S",
max=60,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=24,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFFFF00,0.6}},
},
{
name="time",
arg="%I.%M",
max=12,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=18,
sectors=6,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFF0000,0.6}},
},
{

--ring 1-1 :cpu
name="cpu",
arg="cpu1",
max=100,
xc=82,
yc=145,
start_angle=180,
end_angle=-180,
thickness=5,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xD7DB3,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
--ring 1-2 :cpu
name="cpu",
arg="cpu2",
max=100,
xc=82,
yc=145,
start_angle=180,
end_angle=-180,
thickness=5,
radius=25,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x49A835,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
name="memperc",
arg="",
max=100,
xc=175,
yc=297,
start_angle=180,
end_angle=-180,
thickness=7,
radius=30,
sectors=10,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x00FF00,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
--ring 4-1 : download speed
name="downspeedf",
arg="eth0",
max=700,
xc=187,
yc=548,
start_angle=180,
end_angle=-180,
thickness=17,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x0000ff,0.6}},
fg_colour2={{0.5,0xFFFF00,0.6}},
--ring 4-2 : upload speed
},
{
name="upspeedf",
arg="eth0",
max=150,
xc=95,
yc=433,
start_angle=180,
end_angle=-180,
thickness=17,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFFFF00,0.6}},
fg_colour2={{0.5,0x0000FF,0.6}},
},
}



--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="p" 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


conky_start.sh
Spoiler:
#! /bin/bash

sleep 30
conky -c ~/.Conky1/conkyrc &
sleep 20
conky -c ~/.Conky1/conkyrc1 &
exit 0

Fazer download das imagens e colocar na pasta pix
http://imageshack.us/photo/my-images/405/67312192.png/
http://imageshack.us/photo/my-images/714/brau.png/
http://imageshack.us/photo/my-images/228/hddpix.png/
http://imageshack.us/photo/my-images/190/usbkey.png/

Obs: Verificar fontes e permissões de scripts, Conky retirado forum http://forum.ubuntu-fr.org/ Agradecimento aos integrantes do forum Fr. Post original http://forum.ubuntu-fr.org/viewtopic.php?pid=3951292
:ubuntued:
Editado pela última vez por Roger Braga em Seg, 25 de Julho 2011, 17:19, em um total de 2 vezes.

AGARB REGOR


Imagem
:ubuntued: "Somente seres humanos excepcionais e irrepreensíveis suscitam ideias generosas e ações elevadas. O conhecimento é limitado. A imaginação envolve ao mundo."
:ubuntued:
Avatar do usuário
Roger Braga
Mr. Deskmod
 
Mensagens: 755
Registrado em: 04 Julho, 2011
Localização: São Paulo, BRASIL

Re: Partilhe a configuração do seu Conky!!

Mensagempor Claudio Novais » Seg, 25 de Julho 2011, 17:08

rrack » Seg Jul 25, 2011 4:47 pm escreveu:Conky Modificado

Imagem


Imagem

conkyrc
Spoiler:
# 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
background yes

# Create own window instead of using desktop (required in nautilus)
own_window yes
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 325 250
#maximum_width 325

# 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

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 39

# 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 1
# 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
${image ~/.Conky1/bionic/pix/hdd_pix.png -p 0,10 -s 127x74}
${voffset 0}${goto 150}${color white}${font Astron Boy Gothic:size=10}Home: ${fs_bar 7,100 /media/}
${voffset 0}${goto 150}used: ${fs_used /}
${voffset 0}${goto 150}FREE: ${fs_free /}
${voffset 0}${goto 150}SIZE: ${fs_size /}
${image ~/.Conky1/bionic/pix/usbkey.png -p 0,110 -s 127x74}
${voffset 15}${goto 150}${color white}${font Astron Boy Gothic:size=10}Root: ${fs_bar 7,100 /media/}
${voffset 0}${goto 150}used: ${fs_used /}
${voffset 0}${goto 150}FREE: ${fs_free /}
${voffset 0}${goto 150}SIZE: ${fs_size /}


conkyrc1
Spoiler:
# — Conky settings — #

background yes

update_interval 1
total_run_times 0
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

temperature_unit celcius

# — Window specifications — #

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

border_inner_margin 0
border_outer_margin 0

minimum_size 270 930
maximum_width 270

alignment bottom_right

gap_x 0
gap_y 75


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

# — Text settings — #
use_xft yes
xftfont hooge 05_54:size=6
xftalpha 0.1

default_color FFFFFF
default_gauge_size 47 25

uppercase no
use_spacer right

color0 white
color1 orange
color2 green

# — Lua Load — #

lua_load ~/.Conky1/bionic/scripts/rings.lua
lua_draw_hook_pre main_rings

TEXT
${image ~/.Conky1/bionic/pix/bg.png -p 0,0 -s 270x930}
${voffset 45}${font DejaVuSans-Bold:size=13}${goto 20}Cpu1:${cpu cpu1}%
${voffset 25}${goto 160}Cpu2:${cpu cpu2}%
${voffset 165}${goto 160}${font DejaVuSans-Bold:size=12}${memperc}%
${voffset 45}${goto 170}IN:
${goto 174}${downspeed eth0}
${voffset 1}${goto 170}OUT:
${goto 176}${upspeed eth0}
${voffset 301}${goto 85}${time %D :%H:%M:%S}
${image ~/.Conky1/bionic/pix/bra.png -p 128,776 -s 65x65}


rings.lua
Spoiler:
--[[ RINGS with SECTORS widget
v1.0 by wlourf (08.08.2010)
this widget draws a ring with differents effects
http://u-scripts.blogspot.com/2010/08/r ... dgets.html

To call the script in a conky, use, before TEXT
lua_load /path/to/the/script/rings.lua
lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT


Parameters are :
3 parameters are mandatory
name - the name of the conky variable to display,
for example for {$cpu cpu0}, just write name="cpu"
arg - the argument of the above variable,
for example for {$cpu cpu0}, just write arg="cpu0"
arg can be a numerical value if name=""
max - the maximum value the above variable can reach,
for example for {$cpu cpu0}, just write max=100

Optional parameters:
xc,yc - coordinates of the center of the ring,
default = middle of the conky window
radius - external radius of the ring, in pixels,
default = quarter of the width of the conky window
thickness - thickness of the ring, in pixels, default = 10 pixels
start_angle - starting angle of the ring, in degrees, value can be negative,
default = 0 degree
end_angle - ending angle of the ring, in degrees,
value must be greater than start_angle, default = 360 degrees
sectors - number of sectors in the ring, default = 10
gap_sectors - gap between two sectors, in pixels, default = 1 pixel
cap - the way to close a sector, available values are
"p" for parallel , default value
"r" for radial (follow the radius)
inverse_arc - if set to true, arc will be anticlockwise, default=false
border_size - size of the border, in pixels, default = 0 pixel i.e. no border
fill_sector - if set to true, each sector will be completely filled,
default=false, this parameter is inoperate if sectors=1
background - if set to false, background will not be drawn, default=true
foreground - if set to false, foreground will not be drawn, default=true

Colours tables below are defined into braces :
{position in the gradient (0 to 1), colour in hexadecimal, alpha (0 to 1)}
example for a single colour table :
{{0,0xFFAA00,1}} position parameter doesn't matter
example for a two-colours table :
{{0,0xFFAA00,1},{1,0x00AA00,1}} or {{0.5,0xFFAA00,1},{1,0x00AA00,1}}
example for a three-colours table :
{{0,0xFFAA00,1},{0.5,0xFF0000,1},{1,0x00AA00,1}}

bg_colour1 - colour table for background,
default = {{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
fg_colour1 - colour table for foreground,
default = {{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
bd_colour1 - colour table for border,
default = {{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}

Seconds tables for radials gradients :
bg_colour2 - second colour table for background, default = no second colour
fg_colour2 - second colour table for foreground, default = no second colour
bd_colour2 - second colour table for border, default = no second colour

v1.0 (08 Aug. 2010) original release

]]


require 'cairo'
function conky_main_rings()
-- START PARAMETERS HERE
rings_settings={
{
name="time",
arg="%S",
max=60,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x00FF00,0.6}},
},
{
name="time",
arg="%M.%S",
max=60,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=24,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFFFF00,0.6}},
},
{
name="time",
arg="%I.%M",
max=12,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=18,
sectors=6,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFF0000,0.6}},
},
{

--ring 1-1 :cpu
name="cpu",
arg="cpu1",
max=100,
xc=82,
yc=145,
start_angle=180,
end_angle=-180,
thickness=5,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xD7DB3,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
--ring 1-2 :cpu
name="cpu",
arg="cpu2",
max=100,
xc=82,
yc=145,
start_angle=180,
end_angle=-180,
thickness=5,
radius=25,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x49A835,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
name="memperc",
arg="",
max=100,
xc=175,
yc=297,
start_angle=180,
end_angle=-180,
thickness=7,
radius=30,
sectors=10,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x00FF00,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
--ring 4-1 : download speed
name="downspeedf",
arg="eth0",
max=700,
xc=187,
yc=548,
start_angle=180,
end_angle=-180,
thickness=17,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x0000ff,0.6}},
fg_colour2={{0.5,0xFFFF00,0.6}},
--ring 4-2 : upload speed
},
{
name="upspeedf",
arg="eth0",
max=150,
xc=95,
yc=433,
start_angle=180,
end_angle=-180,
thickness=17,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFFFF00,0.6}},
fg_colour2={{0.5,0x0000FF,0.6}},
},
}



--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="p" 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


conky_start.sh
Spoiler:
#! /bin/bash

sleep 30
conky -c ~/.Conky1/conkyrc &
sleep 20
conky -c ~/.Conky1/conkyrc1 &
exit 0

Fazer download das imagens e colocar na pasta pix
http://imageshack.us/photo/my-images/405/67312192.png/
http://imageshack.us/photo/my-images/714/brau.png/
http://imageshack.us/photo/my-images/228/hddpix.png/
http://imageshack.us/photo/my-images/190/usbkey.png/
Obs: Verificar fontes e permissões de scripts, Conky retirado forum http://forum.ubuntu-fr.org/ Agradecimento aos integrantes do forum Fr. :ubuntued:


Olá Roger, este conky é mesmo muito interessante! Já agora, se houver um tópico específico onde encontrou este conky, era também importante pôr como referência! Tal como pode ver nos artigos que faço, normalmente não tenho problemas em pôr muitas referências! Acho que pôr as referências é algo que dignifica o autor do material e, por isso mesmo, acho que deve-se abusar nas referências! :D

Entretanto, Roger, estou com umas ideias de uns projetos que acho que lhe vou pedir ajuda dentro de alguns dias! ;)
Avatar do usuário
Claudio Novais
Editor do Ubuntued
 
Mensagens: 16869
Registrado em: 25 Maio, 2011

Re: Partilhe a configuração do seu Conky!!

Mensagempor Roger Braga » Seg, 25 de Julho 2011, 17:18

Claudio Novais » Seg Jul 25, 2011 2:08 pm escreveu:
rrack » Seg Jul 25, 2011 4:47 pm escreveu:Conky Modificado

Imagem


Imagem

conkyrc
Spoiler:
# 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
background yes

# Create own window instead of using desktop (required in nautilus)
own_window yes
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 325 250
#maximum_width 325

# 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

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 39

# 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 1
# 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
${image ~/.Conky1/bionic/pix/hdd_pix.png -p 0,10 -s 127x74}
${voffset 0}${goto 150}${color white}${font Astron Boy Gothic:size=10}Home: ${fs_bar 7,100 /media/}
${voffset 0}${goto 150}used: ${fs_used /}
${voffset 0}${goto 150}FREE: ${fs_free /}
${voffset 0}${goto 150}SIZE: ${fs_size /}
${image ~/.Conky1/bionic/pix/usbkey.png -p 0,110 -s 127x74}
${voffset 15}${goto 150}${color white}${font Astron Boy Gothic:size=10}Root: ${fs_bar 7,100 /media/}
${voffset 0}${goto 150}used: ${fs_used /}
${voffset 0}${goto 150}FREE: ${fs_free /}
${voffset 0}${goto 150}SIZE: ${fs_size /}


conkyrc1
Spoiler:
# — Conky settings — #

background yes

update_interval 1
total_run_times 0
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

temperature_unit celcius

# — Window specifications — #

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

border_inner_margin 0
border_outer_margin 0

minimum_size 270 930
maximum_width 270

alignment bottom_right

gap_x 0
gap_y 75


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

# — Text settings — #
use_xft yes
xftfont hooge 05_54:size=6
xftalpha 0.1

default_color FFFFFF
default_gauge_size 47 25

uppercase no
use_spacer right

color0 white
color1 orange
color2 green

# — Lua Load — #

lua_load ~/.Conky1/bionic/scripts/rings.lua
lua_draw_hook_pre main_rings

TEXT
${image ~/.Conky1/bionic/pix/bg.png -p 0,0 -s 270x930}
${voffset 45}${font DejaVuSans-Bold:size=13}${goto 20}Cpu1:${cpu cpu1}%
${voffset 25}${goto 160}Cpu2:${cpu cpu2}%
${voffset 165}${goto 160}${font DejaVuSans-Bold:size=12}${memperc}%
${voffset 45}${goto 170}IN:
${goto 174}${downspeed eth0}
${voffset 1}${goto 170}OUT:
${goto 176}${upspeed eth0}
${voffset 301}${goto 85}${time %D :%H:%M:%S}
${image ~/.Conky1/bionic/pix/bra.png -p 128,776 -s 65x65}


rings.lua
Spoiler:
--[[ RINGS with SECTORS widget
v1.0 by wlourf (08.08.2010)
this widget draws a ring with differents effects
http://u-scripts.blogspot.com/2010/08/r ... dgets.html

To call the script in a conky, use, before TEXT
lua_load /path/to/the/script/rings.lua
lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT


Parameters are :
3 parameters are mandatory
name - the name of the conky variable to display,
for example for {$cpu cpu0}, just write name="cpu"
arg - the argument of the above variable,
for example for {$cpu cpu0}, just write arg="cpu0"
arg can be a numerical value if name=""
max - the maximum value the above variable can reach,
for example for {$cpu cpu0}, just write max=100

Optional parameters:
xc,yc - coordinates of the center of the ring,
default = middle of the conky window
radius - external radius of the ring, in pixels,
default = quarter of the width of the conky window
thickness - thickness of the ring, in pixels, default = 10 pixels
start_angle - starting angle of the ring, in degrees, value can be negative,
default = 0 degree
end_angle - ending angle of the ring, in degrees,
value must be greater than start_angle, default = 360 degrees
sectors - number of sectors in the ring, default = 10
gap_sectors - gap between two sectors, in pixels, default = 1 pixel
cap - the way to close a sector, available values are
"p" for parallel , default value
"r" for radial (follow the radius)
inverse_arc - if set to true, arc will be anticlockwise, default=false
border_size - size of the border, in pixels, default = 0 pixel i.e. no border
fill_sector - if set to true, each sector will be completely filled,
default=false, this parameter is inoperate if sectors=1
background - if set to false, background will not be drawn, default=true
foreground - if set to false, foreground will not be drawn, default=true

Colours tables below are defined into braces :
{position in the gradient (0 to 1), colour in hexadecimal, alpha (0 to 1)}
example for a single colour table :
{{0,0xFFAA00,1}} position parameter doesn't matter
example for a two-colours table :
{{0,0xFFAA00,1},{1,0x00AA00,1}} or {{0.5,0xFFAA00,1},{1,0x00AA00,1}}
example for a three-colours table :
{{0,0xFFAA00,1},{0.5,0xFF0000,1},{1,0x00AA00,1}}

bg_colour1 - colour table for background,
default = {{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
fg_colour1 - colour table for foreground,
default = {{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
bd_colour1 - colour table for border,
default = {{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}

Seconds tables for radials gradients :
bg_colour2 - second colour table for background, default = no second colour
fg_colour2 - second colour table for foreground, default = no second colour
bd_colour2 - second colour table for border, default = no second colour

v1.0 (08 Aug. 2010) original release

]]


require 'cairo'
function conky_main_rings()
-- START PARAMETERS HERE
rings_settings={
{
name="time",
arg="%S",
max=60,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x00FF00,0.6}},
},
{
name="time",
arg="%M.%S",
max=60,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=24,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFFFF00,0.6}},
},
{
name="time",
arg="%I.%M",
max=12,
xc=118,
yc=676,
start_angle=0,
end_angle=360,
thickness=5,
radius=18,
sectors=6,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFF0000,0.6}},
},
{

--ring 1-1 :cpu
name="cpu",
arg="cpu1",
max=100,
xc=82,
yc=145,
start_angle=180,
end_angle=-180,
thickness=5,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xD7DB3,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
--ring 1-2 :cpu
name="cpu",
arg="cpu2",
max=100,
xc=82,
yc=145,
start_angle=180,
end_angle=-180,
thickness=5,
radius=25,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x49A835,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
name="memperc",
arg="",
max=100,
xc=175,
yc=297,
start_angle=180,
end_angle=-180,
thickness=7,
radius=30,
sectors=10,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x00FF00,0.6}},
fg_colour2={{0.5,0xFF0000,0.6}},
},
{
--ring 4-1 : download speed
name="downspeedf",
arg="eth0",
max=700,
xc=187,
yc=548,
start_angle=180,
end_angle=-180,
thickness=17,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0x0000ff,0.6}},
fg_colour2={{0.5,0xFFFF00,0.6}},
--ring 4-2 : upload speed
},
{
name="upspeedf",
arg="eth0",
max=150,
xc=95,
yc=433,
start_angle=180,
end_angle=-180,
thickness=17,
radius=30,
sectors=30,
gap_sectors=1,
bg_colour1={{0.5,0xFFFFFF,0.2}},
fg_colour1={{0.5,0xFFFF00,0.6}},
fg_colour2={{0.5,0x0000FF,0.6}},
},
}



--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="p" 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


conky_start.sh
Spoiler:
#! /bin/bash

sleep 30
conky -c ~/.Conky1/conkyrc &
sleep 20
conky -c ~/.Conky1/conkyrc1 &
exit 0

Fazer download das imagens e colocar na pasta pix
http://imageshack.us/photo/my-images/405/67312192.png/
http://imageshack.us/photo/my-images/714/brau.png/
http://imageshack.us/photo/my-images/228/hddpix.png/
http://imageshack.us/photo/my-images/190/usbkey.png/
Obs: Verificar fontes e permissões de scripts, Conky retirado forum http://forum.ubuntu-fr.org/ Agradecimento aos integrantes do forum Fr. :ubuntued:


Olá Roger, este conky é mesmo muito interessante! Já agora, se houver um tópico específico onde encontrou este conky, era também importante pôr como referência! Tal como pode ver nos artigos que faço, normalmente não tenho problemas em pôr muitas referências! Acho que pôr as referências é algo que dignifica o autor do material e, por isso mesmo, acho que deve-se abusar nas referências! :D

Entretanto, Roger, estou com umas ideias de uns projetos que acho que lhe vou pedir ajuda dentro de alguns dias! ;)

Ola claudio, assim que precisar pode pedir a vontade, estamos aqui para isso estou a disposição no que puder ajudar você.
Um abraço :yeah:

AGARB REGOR


Imagem
:ubuntued: "Somente seres humanos excepcionais e irrepreensíveis suscitam ideias generosas e ações elevadas. O conhecimento é limitado. A imaginação envolve ao mundo."
:ubuntued:
Avatar do usuário
Roger Braga
Mr. Deskmod
 
Mensagens: 755
Registrado em: 04 Julho, 2011
Localização: São Paulo, BRASIL

Re: Configurações Conky

Mensagempor ZonZor » Seg, 25 de Julho 2011, 22:42

rrack » Qui Jul 21, 2011 2:33 pm escreveu:Estou postando o conky do relógio do tema Mortal dark (citando que o conky aqui foi feito pelo usuário olgmen do ubuntu ru )
Imagen
Imagem

.conkyrc6
Spoiler:
# --- параметры окна ---
# эти строки необходимы для нормальной работы лучше не изменять
own_window yes
own_window_class desktop #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 400
# --- расположение окна
# левый верхний угол экрана
#alignment top_left
# левый нижний угол экрана
#alignment bottom_left
# правый верхний угол экрана
alignment top_right
# правый нижний угол экрана
#alignment bottom_right
# расстояние между кромкой экрана и окном
# по горизонтали
gap_x 20
# по вертикали
gap_y 25

# --- графика окна ---
# если желаете выводить conky на другом фоне напишите yes
background no
# окантовка окна, бордюр
draw_borders no
# если бордюр yes
# длина штрихов бордюра, если 0, то бордюр выводится сплошной линией
stippled_borders 1
# толщина линий бордюра
border_width 1
# бордюр вокруг выводимых графиков
draw_graph_borders no
# включить тень?
draw_shades no
# окантовка вокруг текста и выводимых объектов
draw_outline no
# Добавить пробел? Только для встраиваемых объектов
use_spacer right

# --- цвет ---
# основной цвет по умолчанию
default_color 00BFFF #DeepSkyBlue
# цвет тени
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 mono:size=9

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

# --- следующие данные необходимы для работы
# обновление в секундах не имеет смысла ставить больше 2
# при выводе времени в секундах необходимо значение 1 и менее
update_interval 0.5
# время работы программы до её выключения
# установите 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/olgmen4_1.lua
lua_draw_hook_pre widgets
TEXT
${voffset 10}${goto 55}${color 009cff}${font Zekton:bold:size=7}CPU 1${goto 95}${cpu cpu1}${goto 120}%
${goto 55}${color 00ff00}CPU 2${goto 95}${cpu cpu2}${goto 120}%
${voffset 5}${goto 95}${color ffffff}${font Zekton:bold:size=20}${time %H:%M:%S}
${voffset -14}${goto 180}${color ffff00}${font Zekton:bold:size=7}${upspeed eth0}${goto 220}UP
${voffset 1}${goto 180}${color ff0000}${downspeed eth0}${goto 220}DOWN
${voffset -5}

olgmen4_1.lua (colocar na pasta home/usuário/scripts
Spoiler:
-[[
Собрал все это Борис Кринкель <olgmen> krinkel@rambler.ru

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

Все данные подогнаны под выставленные размеры. При необходимости изменить какие-нибудь данные возможно потребуется подгонка.

Для вызова этого скрипта в Conky вставьте следующие строки до TEXT (при условии, что скрипт сохранен в ~/scripts

lua_load ~/scripts/olgmen4_1.lua
lua_draw_hook_pre widgets
]]

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

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

--[[ Вывод фона и горизонтальных линий ]]

function body(cr, x, y, h, w, bgc, bga)

-- рисуем фон

cairo_move_to(cr, x, y)
cairo_line_to(cr, x + w - h, y)
cairo_arc(cr, x + w - h, y + h, h, -math.pi/2,0)
cairo_line_to(cr, x + w, y + h)
cairo_line_to(cr, x + h, y + h)
cairo_arc(cr, x + h, y, h, math.pi/2, math.pi)
cairo_line_to(cr, x, y + h)
cairo_close_path(cr)

cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
cairo_fill(cr)

-- горизонтальные линии

cairo_set_line_width (cr, 10.5) -- толщина линий

cairo_set_source_rgba(cr, 0, 0.4, 1, 1) -- синяя
cairo_move_to(cr, x + h*1.1, y + h*0.1)
cairo_line_to(cr, x + w - h, y + h*0.1)
cairo_stroke(cr)

cairo_set_source_rgba(cr, 0, 1, 0, 1) -- зеленая
cairo_move_to(cr, x + h*1.1, y + h*0.23)
cairo_line_to(cr, x + w - h, y + h*0.23)
cairo_stroke(cr)

cairo_set_source_rgba(cr, 1, 1, 0, 1) -- желтая
cairo_move_to(cr, x + h, y + h*0.75)
cairo_line_to(cr, x + w - h*1.1, y + h*0.75)
cairo_stroke(cr)

cairo_set_source_rgba(cr, 1, 0, 0, 1) -- красная
cairo_move_to(cr, x + h, y + h*0.88)
cairo_line_to(cr, x + w - h*1.1, y + h*0.88)
cairo_stroke(cr)

end
--[[ Конец вывода фона ]]
-- --------------------------------------------------------------------------
--[[ Вывод дуговых эквалайзеров ]]

function gradient_ring(cr, xc, yc, name, arg, max, bgc, bga, fgc, fga, ring_i, ring_o, frac, t, sa, ea)

-- функция вывода делений эквалайзера

local function draw_gradient_ring(pct)

local angle_0=(sa+180)*(2*math.pi/360)-math.pi/2
local angle_f=(ea+180)*(2*math.pi/360)-math.pi/2
local pct_arc=pct*(angle_f-angle_0)

local i = 0
-- деления выводим через 2 градуса
local winkel = math.rad(2)
-- коеффициент перерасчета
if name == "downspeedf" then koef = max/30
else koef = max/2
end

-- выводим 45 делений для фона
for i=0,44,1 do
-- толщина делений 2 пикселя
cairo_set_line_width(cr,2)
-- задаем цвет для фона
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
-- координаты начальных точек
cairo_move_to(cr, xc-math.cos(angle_0+winkel*i)*ring_i, yc-math.sin(angle_0+winkel*i)*ring_i)
-- выводим деления
cairo_line_to(cr, xc-math.cos(angle_0+winkel*i)*(ring_i*0.9), yc-math.sin(angle_0+winkel*i)*(ring_i*0.9))
cairo_stroke(cr)
end

-- эквалайзер, количество выводимых делений зависит от величины параметра
for i=0,pct_arc*koef,1 do
-- толщина линий 2 пикселя
cairo_set_line_width(cr,2)
-- задаем цвет эквалайзера
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
-- координаты начальных точек
cairo_move_to(cr, xc-math.cos(angle_0+winkel*i)*ring_i, yc-math.sin(angle_0+winkel*i)*ring_i)
-- выводим деления
cairo_line_to(cr, xc-math.cos(angle_0+winkel*i)*(ring_i*0.9), yc-math.sin(angle_0+winkel*i)*(ring_i*0.9))
cairo_stroke(cr)
end
end

-- вывод делений

local function setup_gradient_ring()
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_gradient_ring(pct)
end

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

if update_num>5 then setup_gradient_ring() end
end
--end
--[[ END GRADIENT RING WIDGET ]]
-- -------------------------------------------------------------------------------------
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)
body(cr, 5, 10, 125, 300, 0x000000, 0.4)
cairo_destroy(cr)
-- выводим эквалайзер
cr = cairo_create(cs)
gradient_ring(cr, 180, 133, 'cpu', 'cpu1', 100, 0x9999aa, 0.5, 0x0000ff, 1, 116, 98, 10, 4, 0, 90)
gradient_ring(cr, 180, 133, 'cpu', 'cpu2', 100, 0x9999aa, 0.5, 0x00ff00, 1,99, 98, 10, 4, 0, 90)
gradient_ring(cr, 130, 10, 'upspeedf', 'eth0', 100, 0x9999aa, 0.5, 0xffff00, 1,99, 98, 10, 4, 180, 265)
gradient_ring(cr, 130, 10, 'downspeedf', 'eth0', 1000, 0x9999aa, 0.5, 0xff0000, 1,116, 98, 10, 4, 180, 265)
cairo_destroy(cr)
end
Não equecer que esta para configuração 1680x1050 no caso de monitores maiores ou menores altera valo x= e y= .


Esse conky é lindo! :lu: Vou experimentar! :yeah:
Avatar do usuário
ZonZor
 
Mensagens: 105
Registrado em: 10 Julho, 2011

Re: Partilhe a configuração do seu Conky!!

Mensagempor Roger Braga » Ter, 26 de Julho 2011, 13:56

Conkycolors
Imagem


conkyrc
Spoiler:
#----# calvarr #-----#
######################
# - Conky settings - #
######################
update_interval 1
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1

imlib_cache_size 0
double_buffer yes
no_buffers yes

#####################
# - Text settings - #
#####################
use_xft yes
xftfont Droid Sans:size=8
override_utf8_locale yes
text_buffer_size 2048

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

alignment top_right
gap_x 10
gap_y 10
minimum_size 200 0
maximum_width 200

default_bar_size 60 8

#########################
# - Graphics settings - #
#########################
draw_shades yes
draw_graph_borders no
default_color c5f384

color0 597432 #icoane#
color1 96b35d
color2 c5f384 #text#
color3 e8f60e #day calendar#

TEXT
${font Droid Sans:style=Bold:size=8}${color2}SYSTEM $stippled_hr${font}
##############
# - SYSTEM - #
##############
${color0}${voffset 6}${font OpenLogos:size=19}u${font}${color}${goto 32}${voffset -20}Kernel: ${alignr}${color2}${kernel}${color}
${goto 32}Uptime: ${alignr}${color2}${uptime}${color}
# |--UPDATES--| #
${goto 32}${color2}Updates: ${alignr}${font Droid Sans:style=Bold:size=8}${color1}${execi 360 aptitude search "~U" | wc -l | tail}${color}${font} ${color2}Packages${color}
# |--CPU--| #
${offset 1}${color0}${font Poky:size=16}P${font}${offset -19}${voffset 9}${cpubar cpu0 4,18}${color}${voffset -16}${goto 32}CPU1: ${goto 124}CPU2:${font Droid Sans:style=Bold:size=8}${color1}${goto 60}${cpugauge cpu1 25,50}${goto 150}${cpugauge cpu2 25,50}
${voffset -5}${goto 60}${font Droid Sans:style=Bold:size=8}${cpu cpu1} %${goto 150}${cpu cpu2} %${goto 90}${execpi 6 sensors | grep 'Core 1' | cut -c 15-16}°C${goto 180}${execpi 6 sensors | grep 'Core 0' | cut -c 15-16}°C
# |--RAM--| #
${color0}${voffset -10}${font Poky:size=16}M${font}${color}${goto 32}${voffset -7}RAM: ${font Droid Sans:style=Bold:size=8}${color1}$memperc%${color}${font}
${offset 1}${voffset 2}${color0}${membar 4,18}${color}${goto 32}${voffset -2}F: ${color2}${memeasyfree}${color} U: ${color2}${mem}${color}
# |--SWAP--| #
${voffset 2}${color0}${font Poky:size=14}s${font}${color}${voffset -8}${goto 32}SWAP: ${font Droid Sans:style=Bold:size=8}${color1}${swapperc}%${color}${font}
${voffset 4}${offset 1}${color0}${swapbar 4,18}${color}${voffset -4}${goto 32}F: ${color2}$swapmax${color} U: ${color2}$swap${color}
# |--PROC--| #
${voffset 2}${color0}${font Poky:size=15}a${font}${color}${goto 32}${voffset -10}Processes: ${color2}${alignr 13}CPU${alignr}RAM${color}
${voffset -1}${goto 42}${color2}${top name 1}${color}${font Droid Sans:style=Bold:size=8}${color1} ${goto 124}${top cpu 1}${alignr }${top mem 1}${color}${font}
${voffset -1}${goto 42}${color2}${top name 2}${color}${font Droid Sans:style=Bold:size=8}${color1} ${goto 124}${top cpu 2}${alignr }${top mem 2}${color}${font}
${voffset -1}${goto 42}${color2}${top name 3}${color}${font Droid Sans:style=Bold:size=8}${color1} ${goto 124}${top cpu 3}${alignr }${top mem 3}${color}${font}
${voffset -10}${color0}${font Poky:size=15}u${font}${color}${goto 32}

#############
# - CLOCK - #
#############
${voffset 5}${font Droid Sans:style=Bold:size=8}${color2}DATE $stippled_hr${font}${voffset 3}${goto 28}${font Droid Sans:style=Bold:size=30}${color2}${time %H}${color}${font}${voffset -28}${font Droid Sans:style=Bold:size=20}${color2}${time :%M}${time :%S}${color}${font}
${voffset -2}${goto 100}${font Droid Sans:style=Bold:size=12}${color2}${time %A}${color}${font}${font Droid Sans:style=Bold:size=8}${goto 10}${voffset 10}Brasil: ${tztime GMT3 %H :%M}${font}
${goto 100}${voffset -10}${time %d %b %Y}
################
# - CALENDAR - #
################
${voffset -2}${color0}${font Poky:size=16}D${font}${voffset -8}${font Droid Sans:style=Bold:size=7}${offset -17}${voffset 4}${time %d}${font}${color}${voffset -1}${font Droid Sans Mono:size=7}${execpi 300 DJS=`date +%_d`; cal |sed '2,7!d'| sed '/./!d' | sed 's/^/${goto 32} /'| sed 's/$/ /' | sed 's/^/ /' | sed /" $DJS "/s/" $DJS "/" "'${font Droid Sans Mono:style=Bold:size=8}${voffset -1}${color1}'"$DJS"'${color}${font Droid Sans Mono:size=7}'" "/}${voffset -1}
#################
# - HDD - #
#################
${voffset -5}${font Droid Sans:style=Bold:size=8}${color2}HDD $stippled_hr${font}
${voffset -6}${color0}${font Poky:size=14}H${font}${color}${color2} HDDTEMP: ${color1}${execi 120 hddtemp /dev/sda -n --unit=C}°C${font}${color2}
SYSTEM:$alignr ${fs_used /}/ ${fs_size /}
${font Liberation Sans:style=Bold:size=8}${color2}Free: ${font Liberation Sans:size=8}${color2}${fs_free_perc /}% ${color2} ${goto 124}${font webdings:size=6}${if_match ${fs_free_perc /} >0}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >10}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >20}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >30}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >40}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >50}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >60}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >70}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >80}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /} >90}${color1}${else}${color3}${endif}.${font}${color}
#HOME:$alignr ${fs_used /home}/ ${fs_size /home}
# ${font Liberation Sans:style=Bold:size=8}${color2}Free: ${font Liberation Sans:size=8}${color2}${fs_free_perc /home}% ${color2} ${goto 124}${font webdings:size=6}${if_match ${fs_free_perc /windows} >0}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >10}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >20}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >30}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >40}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >50}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >60}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >70}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >80}${color1}${else}${color3}${endif}.${if_match ${fs_free_perc /home} >90}${color1}${else}${color3}${endif}.${font}${color}#
###############
# - NETWORK - #
###############
${voffset 8}${font Droid Sans:style=Bold:size=8}${color2}NETWORK $stippled_hr${font}
# |--wlan1
${if_up wlan1}
${voffset -13}${color0}${font OpenSymbol:size=14}⇧${font}${color}${goto 32}${voffset -6}Up: ${font Droid Sans:style=Bold:size=8}${color1}${upspeed wlan1}${color}${font} ${alignr}${color2}${upspeedgraph wlan1 11,80 000000 e8f60e -l}${color}
${goto 32}Total: ${color2}${totalup wlan1}${color}
${voffset -2}${color0}${font OpenSymbol:size=14}⇩${font}${color}${goto 32}${voffset -6}Down: ${font Droid Sans:style=Bold:size=8}${color1}${downspeed wlan1}${color}${font} ${alignr}${color2}${downspeedgraph wlan1 11,80 000000 c5f384 -l}${color}
${goto 32}Total: ${color2}${totaldown wlan1}${color}
${voffset -2}${color0}${font Poky:size=14}Y${font}${color}${goto 32} ${voffset -2}Signal: ${font Droid Sans:style=Bold:size=8}${color1}${font Droid Sans:style=Bold:size=8}${wireless_link_qual wlan1}%${color}${font}${if_match ${wireless_link_qual wlan1} >0}${color1}${else}${color3}${endif}${voffset -1}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=8}O${if_match ${wireless_link_qual wlan1} >10}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=10}O${if_match ${wireless_link_qual wlan1} >20}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=12}O${if_match ${wireless_link_qual wlan1} >30}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=16}O${if_match ${wireless_link_qual wlan1} >40}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=20}O${if_match ${wireless_link_qual wlan1} >50}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=24}O${if_match ${wireless_link_qual wlan1} >60}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=28}O${if_match ${wireless_link_qual wlan1} >70}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=32}O${if_match ${wireless_link_qual wlan1} >80}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=36}O${if_match ${wireless_link_qual wlan1} >90}${color1}${else}${color3}${endif}${voffset -2}${goto 150}${font HalfCircleAlphabetXP:style=Bold:size=40}O${font}${color}
${voffset -20}${offset 30}SSID: ${offset 10}${font Droid Sans:style=Bold:size=8}${color1}${WIRELESS_ESSID wlan1}
${voffset 4}${color0}${font Poky:size=13}w${font}${color}${goto 32}${voffset -8}Local IP: ${alignr}${color2}${addr wlan1}${color}
${goto 32}Public IP: ${alignr}${color2}${execi 60 curl http://riivo.eu/php/ip.php}${color}
# |--ETH0
${else}${if_up eth0}
${voffset -13}${color0}${font OpenSymbol:size=14}⇧${font}${color}${goto 32}${voffset -6}Up: ${font Droid Sans:style=Bold:size=8}${color1}${upspeed eth0}${color}${font}${alignr}${color2}${upspeedgraph eth0 11,80 000000 e8f60e -l}${color}
${goto 32}Total: ${color2}${totalup eth0}${color}
${voffset -2}${color0}${font OpenSymbol:size=14}⇩${font}${color}${goto 32}${voffset -6}Down: ${font Droid Sans:style=Bold:size=8}${color1}${downspeed eth0}${color}${font} ${alignr}${color2}${downspeedgraph eth0 11,80 000000 c5f384 -l}${color}
${goto 32}Total: ${color2}${totaldown eth0}${color}
${voffset -2}${color0}${font Poky:size=13}w${font}${color}${goto 32}${voffset -4}Local IP: ${alignr}${color2}${addr eth0}${color}
${goto 32}Public IP: ${alignr}${color2}${execi 10800 ~/.conkycolors/bin/conkyIp}${color}
# |--PPP0
${endif}${else}${if_up ppp0}
${voffset -13}${color0}${font OpenSymbol:size=14}⇧${font}${color}${goto 32}${voffset -6}Up: ${font Droid Sans:style=Bold:size=8}${color1}${upspeed ppp0}${color}${font} ${alignr}${color2}${upspeedgraph ppp0 11,80 000000 e8f60e -l}${color}
${goto 32}Total: ${color2}${totalup ppp0}${color}
${voffset -2}${color0}${font OpenSymbol:size=14}⇩${font}${color}${goto 32}${voffset -6}Down: ${font Droid Sans:style=Bold:size=8}${color1}${downspeed ppp0}${color}${font} ${alignr}${color2}${downspeedgraph ppp0 11,80 000000 c5f384 -l}${color}
${goto 32}Total: ${color2}${totaldown ppp0}${color}
${voffset -2}${color0}${font Poky:size=13}w${font}${color}${goto 32}${voffset -4}Local IP: ${alignr}${color2}${addr ppp0}${color}
${endif}${else}${voffset 4}${color0}${font Droid Sans:size=12}4${font}${color}${goto 32}Network Unavailable${endif}${endif}
#totalizador de tráfego#
${voffset -10}${font Droid Sans:style=Bold:size=8}totalizador de tráfego:${font}
${alignr}${offset -30}${color2}Hoje: ${font OpenSymbol:size=9}⇩${font}${execi 60 vnstat | grep "today" | awk '{print $2 $3}'} ${font OpenSymbol:size=9}⇧${font}${execi 60 vnstat | grep "today" | awk '{print $5 $6}'}
${offset 80}${font OpenSymbol:size=7}∑${font} ${execi 60 vnstat | grep "today" | awk '{print $8 $9}'}
${alignr}${offset -45}Mensal: ${font OpenSymbol:size=9}⇩${font}${execi 300 vnstat -m | grep "`LANG=en_GB.UTF-8 date +"%b '%y"`" | awk '{print $3 $4}'} ${font OpenSymbol:size=9}⇧${font}${execi 300 vnstat -m | grep "`LANG=en_GB.UTF-8 date +"%b '%y"`" | awk '{print $6 $7}'}
${offset 80}${font OpenSymbol:size=7}∑${font} ${execi 300 vnstat -m | grep "`LANG=en_GB.UTF-8 date +"%b '%y"`" | awk '{print $9 $10}'}${color}
#########################
# - weather -#
#########################
${voffset -8}${font Droid Sans:style=Bold:size=8}${color2}WEATHER $stippled_hr${font}
${voffset -48}${execpi 300 conkyForecast --location=BRXX0232 --template=/home/roger/.conkycolors/templates/.conkyForecast.template}
#########################
# - Imagen -#
#########################
${image /home/roger/conky_12.01.2011/adesk/theme/images/brau.png -p -1,260 -s 26x26}
##############
# - NVIDIA - #
##############
${voffset -30}${font Droid Sans:style=Bold:size=8}NVIDIA $stippled_hr${font}
${color0}${voffset -4}${font Poky:size=17}N${font}${color}${goto 32}${voffset -8}GPU Temp:${alignr}${font Droid Sans:style=Bold:size=8}${color1} ${exec nvidia-settings -q GPUCoreTemp | grep Attribute | cut -d ' ' -f 6 | cut -c 1-2}${font}${color}°C
${goto 32}GPU Clock:${alignr}${font Droid Sans:style=Bold:size=8}${color1} ${exec nvidia-settings -q GPU2DClockFreqs -t}${font}${color}MHz
${goto 32}Video RAM:${alignr}${font Droid Sans:style=Bold:size=8}${color1} ${exec nvidia-settings -q VideoRam -t}${font}${color}KiB
${goto 32}Driver Version:${alignr}${font Droid Sans:style=Bold:size=8}${color1} ${exec nvidia-settings -q NvidiaDriverVersion -t}${font}${color}
${voffset -33}${font OpenLogos:size=103}${color2}v${font}${voffset -76}${goto 178}${font UbuntuTitleBold:size=20}${color2}10.10${font}


Fazer download da imagen http://imageshack.us/photo/my-images/714/brau.png/
OBS: Conferir fontes se caso não tiver você achara elas aqui http://www.dafont.com/

AGARB REGOR


Imagem
:ubuntued: "Somente seres humanos excepcionais e irrepreensíveis suscitam ideias generosas e ações elevadas. O conhecimento é limitado. A imaginação envolve ao mundo."
:ubuntued:
Avatar do usuário
Roger Braga
Mr. Deskmod
 
Mensagens: 755
Registrado em: 04 Julho, 2011
Localização: São Paulo, BRASIL

Re: Partilhe a configuração do seu Conky!!

Mensagempor BrunoGom3z » Qua, 3 de Agosto 2011, 1:37

Miguel72 » Sáb Jul 23, 2011 2:39 am escreveu:Conkys utilizados para esta apresentação:

- http://gnome-look.org/content/show.php/Conky+lua?content=139024 (este é o "conky lua" original mas foi modificado por mim).

- http://gnome-look.org/content/show.php/Conky_Ken?content=134705 (este é o "conky ken" original, mas só utilizei o ficheiro "rings" e foi modificado por mim)

- http://ubuntued.info/conky-o-gestor-de-sistema-para-a-area-de-trabalho (o conky forecast que está nos repositórios do Ubuntu) e aqui têm o tutorial da configuração do mesmo em inglês http://ubuntuforums.org/showthread.php?t=869328 )



TOQUES DE AZUL



Imagem




Começo por dizer que vou aqui postar os códigos do que utilizei para fazer este conky, excepto o código do "conky forecast" porque, como referi em cima, o mesmo encontra-se nos repositórios do Ubuntu.

Então vamos lá! Primeiro, criem uma pasta com o nome ".lua" (ponham o ponto antes do lua para o ficheiro ficar oculto evitando assim que o eliminem acidentalmente) na vossa pasta pessoal.

Depois, dentro desta nova pasta (.lua), criem outra com o nome "scripts" (nesta não é preciso o ponto antes do nome).

Em seguida, copiem para dentro da pasta scripts os ficheiros todos (os três abaixo indicados e com o respectivo código).

Então, no ficheiro "startconky.sh", cliquem com o botão do lado direito do rato e em permissões, escolham "permitir executar o ficheiro como uma aplicação" e façam "ok".

Finalmente para o vosso conky arrancar com o Ubuntu (ou outra distribuição Debian), vão ao Menu Sistema-Preferências-Aplicações de Arranque e cliquem em Adicionar. Vai aparecer uma janela com três campos para preencher.

- Nome: Podem por o que quiserem por exemplo - Arranque do Conky

- Comando: Aqui navegam até à pasta onde está o ficheiro "startconky.sh", ou seja /PastaPessoal (carregam em Ctrl+H para verem os ficheiros ocultos) /.lua/scripts e depois dão dois cliques no ficheiro "startconky.sh" que ele vai aparecer (o caminho para ele) no campo de Comando automaticamente.

- Comentário: Também podem por o que quiserem por exemplo - Atraso no Arranque do Conky.


E já está! Alguma dúvida é só perguntar.


Código do clock_rings.lua (clock_rings.lua é o nome a dar ao ficheiro)
Spoiler:
--[[
Clock Rings by Linux Mint (2011) reEdited by despot77

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
lua_load ~/scripts/clock_rings.lua
lua_draw_hook_pre clock_rings

Changelog:
+ v1.0 -- Original release (30.09.2009)
v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v 2011mint -- reEdit despot77 (18.02.2011)
]]

settings_table = {
{
-- Edit this table to customise your rings.
-- You can create more rings simply by adding more elements to settings_table.
-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
name='time',
-- "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 ''.
arg='%I.%M',
-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
max=12,
-- "bg_colour" is the colour of the base ring.
bg_colour=0xffffff,
-- "bg_alpha" is the alpha value of the base ring.
bg_alpha=0.1,
-- "fg_colour" is the colour of the indicator part of the ring.
fg_colour=0xffffff,
-- "fg_alpha" is the alpha value of the indicator part of the ring.
fg_alpha=0.2,
-- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
x=140, y=250,
-- "radius" is the radius of the ring.
radius=50,
-- "thickness" is the thickness of the ring, centred around the radius.
thickness=5,
-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
start_angle=0,
-- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
end_angle=360
},
{
name='time',
arg='%I.%M',
max=12,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.2,
x=140, y=250,
radius=56,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%M%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.4,
x=140, y=250,
radius=56,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=140, y=250,
radius=62,
thickness=5,
start_angle=-0,
end_angle=360
},
{
name='time',
arg='%m',
max=12,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=140, y=250,
radius=78.5,
thickness=10,
start_angle=-0,
end_angle=360
},
{
name='cpu',
arg='cpu0',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=50, y=399,
radius=35,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='cpu',
arg='cpu1',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=50, y=399,
radius=30,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='memperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=130, y=407,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='swapperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=200, y=407,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=130, y=508,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='downspeedf',
arg='wlan0',
max=2000,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0x339900,
fg_alpha=0.8,
x=50, y=500,
radius=35,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='upspeedf',
arg='wlan0',
max=500,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=50, y=500,
radius=30,
thickness=4,
start_angle=-90,
end_angle=180
},
}

-- Use these settings to define the origin and extent of your clock.

clock_r=125

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=140
clock_y=250

clock_colour=0xffffff
clock_alpha=0.5

show_seconds=true

require 'cairo'

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

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

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

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

-- Draw background ring

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

-- Draw indicator ring

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

function draw_clock_hands(cr,xc,yc)
local secs,mins,hours,secs_arc,mins_arc,hours_arc
local xh,yh,xm,ym,xs,ys

secs=os.date("%S")
mins=os.date("%M")
hours=os.date("%I")

secs_arc=(2*math.pi/60)*secs
mins_arc=(2*math.pi/60)*mins+secs_arc/60
hours_arc=(2*math.pi/12)*hours+mins_arc/12

-- Draw hour hand

xh=xc+0.7*clock_r*math.sin(hours_arc)
yh=yc-0.7*clock_r*math.cos(hours_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xh,yh)

cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_line_width(cr,5)
cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
cairo_stroke(cr)

-- Draw minute hand

xm=xc+clock_r*math.sin(mins_arc)
ym=yc-clock_r*math.cos(mins_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xm,ym)

cairo_set_line_width(cr,3)
cairo_stroke(cr)

-- Draw seconds hand

if show_seconds then
xs=xc+clock_r*math.sin(secs_arc)
ys=yc-clock_r*math.cos(secs_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xs,ys)

cairo_set_line_width(cr,1)
cairo_stroke(cr)
end
end

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

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

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

draw_ring(cr,pct,pt)
end

-- Check that Conky has been running for at least 5s

if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)

local cr=cairo_create(cs)

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

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

draw_clock_hands(cr,clock_x,clock_y)
end


Código do rings (rings é o nome a dar ao ficheiro)
Spoiler:
# ##############
# # - rings: - #
# ##############
# (created 09-11-2010 by Ken Berns)
#(For questions and suggestions -> ken.berns@yahoo.de)
#
######################
# - 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 10240
imlib_cache_size 0

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


border_inner_margin 0
border_outer_margin 0

minimum_size 1280 300
maximum_width 1260

alignment tl
gap_x 0
gap_y 60

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

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

uppercase no

default_color FFFFFF

################
# - LUA Load - #
################
#lua_load ~/.lua/scripts/clock_rings.lua
#lua_draw_hook_pre clock_rings

############
# - Code - #
############
TEXT
${voffset 170}${goto 100}${font Santana:size=24:style=Bold}${time %H:%M}


Código do startconky.sh (startconky.sh é o nome a dar ao ficheiro)
Spoiler:
#!/bin/bash
sleep 30
conky -c ~/.lua/scripts/rings &
sleep 15
conky &



OFF TOPIC


Como eu tinha dito e sou uma pessoa coerente, se o Cláudio apagasse os meus posts, eu não o aceitaria. E, como também o disse, se tivesse mal, mudava-me! Como tal, este foi o meu último post e dou assim por terminada a minha relação com este forum! Desejo a todos as melhores felicidades.
De qualquer maneira durante os próximos dias, virei verificar este post (e só este!) caso haja alguma dúvida poque, como fui eu o responsável por publicar este conky, é minha obrigação responder a eventuais perguntas relacionadas com ele.

Cumps.



Como faço pra instalar esse conky lua? Baixei já o pacote, e instalei o conky-all. Como procedo agora? Sei que tenho que colocar um código no conkyrc. Mas as imagens?

Abraços.




------- EDIT ---------


Galera já consegui fazer o conky funcionar, o lance são as imagens que não estão aparecendo, como faço-o rodar direitinho?
Avatar do usuário
BrunoGom3z
 
Mensagens: 65
Registrado em: 01 Agosto, 2011
Localização: Fortaleza - CE

Re: Partilhe a configuração do seu Conky!!

Mensagempor Miguel Fonseca » Qua, 3 de Agosto 2011, 4:04

------- EDIT ---------


Galera já consegui fazer o conky funcionar, o lance são as imagens que não estão aparecendo, como faço-o rodar direitinho?


Boas Bruno, que imagens é que falas?
Explica melhor a tua dúvida para eu, se puder, ajudar-te.

Cumps.
It is only in Love and Murder, that we still remain sincere! - Friedrich Durrenmatt
Avatar do usuário
Miguel Fonseca
Bleeding-edge Helper
 
Mensagens: 2512
Registrado em: 10 Junho, 2011

Re: Partilhe a configuração do seu Conky!!

Mensagempor MarceloH » Sex, 5 de Agosto 2011, 5:26

BrunoGom3z » Ter Ago 02, 2011 9:37 pm escreveu:
Miguel72 » Sáb Jul 23, 2011 2:39 am escreveu:Conkys utilizados para esta apresentação:

- http://gnome-look.org/content/show.php/Conky+lua?content=139024 (este é o "conky lua" original mas foi modificado por mim).

- http://gnome-look.org/content/show.php/Conky_Ken?content=134705 (este é o "conky ken" original, mas só utilizei o ficheiro "rings" e foi modificado por mim)

- http://ubuntued.info/conky-o-gestor-de-sistema-para-a-area-de-trabalho (o conky forecast que está nos repositórios do Ubuntu) e aqui têm o tutorial da configuração do mesmo em inglês http://ubuntuforums.org/showthread.php?t=869328 )



TOQUES DE AZUL



Imagem




Começo por dizer que vou aqui postar os códigos do que utilizei para fazer este conky, excepto o código do "conky forecast" porque, como referi em cima, o mesmo encontra-se nos repositórios do Ubuntu.

Então vamos lá! Primeiro, criem uma pasta com o nome ".lua" (ponham o ponto antes do lua para o ficheiro ficar oculto evitando assim que o eliminem acidentalmente) na vossa pasta pessoal.

Depois, dentro desta nova pasta (.lua), criem outra com o nome "scripts" (nesta não é preciso o ponto antes do nome).

Em seguida, copiem para dentro da pasta scripts os ficheiros todos (os três abaixo indicados e com o respectivo código).

Então, no ficheiro "startconky.sh", cliquem com o botão do lado direito do rato e em permissões, escolham "permitir executar o ficheiro como uma aplicação" e façam "ok".

Finalmente para o vosso conky arrancar com o Ubuntu (ou outra distribuição Debian), vão ao Menu Sistema-Preferências-Aplicações de Arranque e cliquem em Adicionar. Vai aparecer uma janela com três campos para preencher.

- Nome: Podem por o que quiserem por exemplo - Arranque do Conky

- Comando: Aqui navegam até à pasta onde está o ficheiro "startconky.sh", ou seja /PastaPessoal (carregam em Ctrl+H para verem os ficheiros ocultos) /.lua/scripts e depois dão dois cliques no ficheiro "startconky.sh" que ele vai aparecer (o caminho para ele) no campo de Comando automaticamente.

- Comentário: Também podem por o que quiserem por exemplo - Atraso no Arranque do Conky.


E já está! Alguma dúvida é só perguntar.


Código do clock_rings.lua (clock_rings.lua é o nome a dar ao ficheiro)
Spoiler:
--[[
Clock Rings by Linux Mint (2011) reEdited by despot77

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
lua_load ~/scripts/clock_rings.lua
lua_draw_hook_pre clock_rings

Changelog:
+ v1.0 -- Original release (30.09.2009)
v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v 2011mint -- reEdit despot77 (18.02.2011)
]]

settings_table = {
{
-- Edit this table to customise your rings.
-- You can create more rings simply by adding more elements to settings_table.
-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
name='time',
-- "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 ''.
arg='%I.%M',
-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
max=12,
-- "bg_colour" is the colour of the base ring.
bg_colour=0xffffff,
-- "bg_alpha" is the alpha value of the base ring.
bg_alpha=0.1,
-- "fg_colour" is the colour of the indicator part of the ring.
fg_colour=0xffffff,
-- "fg_alpha" is the alpha value of the indicator part of the ring.
fg_alpha=0.2,
-- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
x=140, y=250,
-- "radius" is the radius of the ring.
radius=50,
-- "thickness" is the thickness of the ring, centred around the radius.
thickness=5,
-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
start_angle=0,
-- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
end_angle=360
},
{
name='time',
arg='%I.%M',
max=12,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.2,
x=140, y=250,
radius=56,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%M%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.4,
x=140, y=250,
radius=56,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%S',
max=60,
bg_colour=0xffffff,
bg_alpha=0.1,
fg_colour=0xffffff,
fg_alpha=0.6,
x=140, y=250,
radius=62,
thickness=5,
start_angle=-0,
end_angle=360
},
{
name='time',
arg='%m',
max=12,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.5,
x=140, y=250,
radius=78.5,
thickness=10,
start_angle=-0,
end_angle=360
},
{
name='cpu',
arg='cpu0',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=50, y=399,
radius=35,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='cpu',
arg='cpu1',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=50, y=399,
radius=30,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='memperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=130, y=407,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='swapperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=200, y=407,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=130, y=508,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='downspeedf',
arg='wlan0',
max=2000,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0x339900,
fg_alpha=0.8,
x=50, y=500,
radius=35,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='upspeedf',
arg='wlan0',
max=500,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffffff,
fg_alpha=0.8,
x=50, y=500,
radius=30,
thickness=4,
start_angle=-90,
end_angle=180
},
}

-- Use these settings to define the origin and extent of your clock.

clock_r=125

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=140
clock_y=250

clock_colour=0xffffff
clock_alpha=0.5

show_seconds=true

require 'cairo'

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

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

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

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

-- Draw background ring

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

-- Draw indicator ring

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

function draw_clock_hands(cr,xc,yc)
local secs,mins,hours,secs_arc,mins_arc,hours_arc
local xh,yh,xm,ym,xs,ys

secs=os.date("%S")
mins=os.date("%M")
hours=os.date("%I")

secs_arc=(2*math.pi/60)*secs
mins_arc=(2*math.pi/60)*mins+secs_arc/60
hours_arc=(2*math.pi/12)*hours+mins_arc/12

-- Draw hour hand

xh=xc+0.7*clock_r*math.sin(hours_arc)
yh=yc-0.7*clock_r*math.cos(hours_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xh,yh)

cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_line_width(cr,5)
cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
cairo_stroke(cr)

-- Draw minute hand

xm=xc+clock_r*math.sin(mins_arc)
ym=yc-clock_r*math.cos(mins_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xm,ym)

cairo_set_line_width(cr,3)
cairo_stroke(cr)

-- Draw seconds hand

if show_seconds then
xs=xc+clock_r*math.sin(secs_arc)
ys=yc-clock_r*math.cos(secs_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xs,ys)

cairo_set_line_width(cr,1)
cairo_stroke(cr)
end
end

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

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

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

draw_ring(cr,pct,pt)
end

-- Check that Conky has been running for at least 5s

if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)

local cr=cairo_create(cs)

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

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

draw_clock_hands(cr,clock_x,clock_y)
end


Código do rings (rings é o nome a dar ao ficheiro)
Spoiler:
# ##############
# # - rings: - #
# ##############
# (created 09-11-2010 by Ken Berns)
#(For questions and suggestions -> ken.berns@yahoo.de)
#
######################
# - 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 10240
imlib_cache_size 0

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


border_inner_margin 0
border_outer_margin 0

minimum_size 1280 300
maximum_width 1260

alignment tl
gap_x 0
gap_y 60

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

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

uppercase no

default_color FFFFFF

################
# - LUA Load - #
################
#lua_load ~/.lua/scripts/clock_rings.lua
#lua_draw_hook_pre clock_rings

############
# - Code - #
############
TEXT
${voffset 170}${goto 100}${font Santana:size=24:style=Bold}${time %H:%M}


Código do startconky.sh (startconky.sh é o nome a dar ao ficheiro)
Spoiler:
#!/bin/bash
sleep 30
conky -c ~/.lua/scripts/rings &
sleep 15
conky &



OFF TOPIC


Como eu tinha dito e sou uma pessoa coerente, se o Cláudio apagasse os meus posts, eu não o aceitaria. E, como também o disse, se tivesse mal, mudava-me! Como tal, este foi o meu último post e dou assim por terminada a minha relação com este forum! Desejo a todos as melhores felicidades.
De qualquer maneira durante os próximos dias, virei verificar este post (e só este!) caso haja alguma dúvida poque, como fui eu o responsável por publicar este conky, é minha obrigação responder a eventuais perguntas relacionadas com ele.

Cumps.



Como faço pra instalar esse conky lua? Baixei já o pacote, e instalei o conky-all. Como procedo agora? Sei que tenho que colocar um código no conkyrc. Mas as imagens?

Abraços.




------- EDIT ---------


Galera já consegui fazer o conky funcionar, o lance são as imagens que não estão aparecendo, como faço-o rodar direitinho?


Eu fiz esse tópico sobre algumas coisas do conky, talvez alguma te ajude: http://forum.ubuntued.info/viewtopic.php?f=31&t=243

MarceloH
 
Mensagens: 7
Registrado em: 30 Julho, 2011

AnteriorPróximo

Voltar para Temas do Ubuntu

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 11 visitantes