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!
--[[ Clock Rings by londonali1010 (2009) Edited by AleAngel
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
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=0x9400D3, -- "bg_alpha" is the alpha value of the base ring. bg_alpha=0.2, -- "fg_colour" is the colour of the indicator part of the ring. fg_colour=0x9400D3, -- "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=600, y=210, -- "radius" is the radius of the ring. radius=52, -- "thickness" is the thickness of the ring, centred around the radius. thickness=10, -- "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='%M.%S', max=60, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.4, x=600, y=210, radius=64, thickness=10, start_angle=0, end_angle=360 }, { name='time', arg='%S', max=60, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.6, x=600, y=210, radius=76, thickness=10, start_angle=0, end_angle=360 }, { name='time', arg='%d', max=31, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.8, x=600, y=210, radius=88, thickness=10, start_angle=-90, end_angle=89 }, { name='time', arg='%m', max=12, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=1, x=600, y=210, radius=100, thickness=10, start_angle=-90, end_angle=89 }, { name='time', arg='%w', max=6, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.8, x=600, y=210, radius=88, thickness=10, start_angle=90, end_angle=269 }, { name='time', arg='%U', max=52, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=1, x=600, y=210, radius=100, thickness=10, start_angle=90, end_angle=269 }, { name='downspeedf', arg='eth0', max=100, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.6, x=230, y=45, radius=35, thickness=10, start_angle=-90, end_angle=180 }, { name='upspeedf', arg='eth0', max=100, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.3, x=230, y=45, radius=23, thickness=10, start_angle=-90, end_angle=180 }, { name='cpu', arg='cpu0', max=100, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.6, x=330, y=45, radius=35, thickness=10, start_angle=-90, end_angle=180 }, { name='cpu', arg='cpu1', max=100, bg_colour=0x9400D3, bg_alpha=0.2, fg_colour=0xBEBEBE, fg_alpha=0.3, x=330, y=45, radius=23, thickness=10, start_angle=-90, end_angle=180 },
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)
-- 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
function inca_draw_shadow(cr, radius, color, strength, radiusstart) local alpha = strength / radius cairo_set_source_rgba(cr, inca_rgb(color, alpha)) cairo_set_line_join(cr, CAIRO_LINE_JOIN_ROUND) cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND) local w, radiusstart = 0, radiusstart if radiusstart ~= nil and radiusstart > 1 then radius = radius + radiusstart else radiusstart = 1 end for w=radiusstart,radius,1 do cairo_set_line_width(cr, w) cairo_stroke_preserve(cr) end end
function inca_draw_ring(cr, x, y, radius, width, ring) local value,valuemax = ring['value'], ring['valuemax'] local angle1,angle2,angle3 = ring['angle1'], ring['angle2'], 0 local color,alpha = settings['fgcolor'], ring['alpha'] local alphasd = 0.3
if ring['isparsable'] == true then value = conky_parse(value) if value == nil then return end value = tonumber(value)/valuemax value = math.max(0, math.min(1, value)) else value = 1 alphasd = 1 color = settings['bgcolor'] end angle3 = (angle2 - angle1)*value + angle1 cairo_arc_negative(cr, x, y, radius, angle1*math.pi/180, angle3*math.pi/180) inca_draw_shadow(cr, 5, 0x000000, 0.60*alphasd, width + 1) cairo_set_source_rgba(cr, inca_rgb(color,alpha)) cairo_set_line_width(cr, width) cairo_stroke(cr) end
function inca_draw_line(cr, x1, y1, x2, y2, width, line) local value,valuemax = line['value'], line['valuemax'] local color,alpha = settings['fgcolor'], line['alpha'] local alphasd = 0.3
if line['isparsable'] == true then value = conky_parse(value) if value == nil then return end value = tonumber(value)/valuemax value = math.max(0, math.min(1, value)) else value = 1 alphasd = 1 color = settings['bgcolor'] end local x = (1 - value)/2 cairo_move_to(cr, x1 + x2*x, y1 + y2*x) cairo_rel_line_to(cr, x2*(1-x*2), y2*(1-x*2)) cairo_close_path (cr) inca_draw_shadow(cr, 5, 0x000000, 0.60*alphasd, width + 1) cairo_set_source_rgba(cr, inca_rgb(color, alpha)) cairo_set_line_width(cr, width) cairo_stroke(cr) end
function inca_draw_job(cr, job) if job['job'] == 'text' then cairo_select_font_face(cr, job.font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD) cairo_set_font_size(cr, job.size) cairo_move_to(cr, job['x'], job['y']) local str = job['str'] if job['isparsable'] == true then str = conky_parse(str) if str == nil then return end end if job['isformatable'] ~= nil and job['isformatable'] == true then str = string.format(job['fmt'], str) end cairo_text_path(cr, str) inca_draw_shadow(cr, 5, 0x000000, 0.65) cairo_set_source_rgba(cr, inca_rgb(settings['fgcolor'], 1)) cairo_fill(cr) elseif job['job'] == 'ring' then local x,y,radius = job['x'], job['y'], job['radius'] local layers,width = job['layers'], job['width'] for i in pairs(layers) do inca_draw_ring(cr, x, y, radius, width, layers[i]) end elseif job['job'] == 'line' then local x1,y1,x2,y2 = job['x1'], job['y1'], job['x2'], job['y2'] local layers,width = job['layers'], job['width'] for i in pairs(layers) do inca_draw_line(cr, x1, y1, x2, y2, width, layers[i]) end end end
function conky_paint() 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) for i in pairs(jobs) do inca_draw_job(cr, jobs[i]) end end
AGARB REGOR
"Somente seres humanos excepcionais e irrepreensíveis suscitam ideias generosas e ações elevadas. O conhecimento é limitado. A imaginação envolve ao mundo."
José Craveiro escreveu:Está um conjunto muito elegante. Falta só mesmo preparar melhor a apresentação do post através do "Prever" e ver o que não queremos que apareça. Mas gostei muito
Obrigado José! É a primeira vez que posto um Desktop aqui! Eu já estava prevendo que não ia fazer direito! Na próxima vou seguir sua dica,obrigado.
É assim, eu não tenho como editar o seu tópico (só o Cláudio tem esse tipo de privilégio pois é ele o Administrador), por isso vou ver o seu tópico e corrigi-lo para você. Depois coloco aqui o código todo direitinho e o João Ferretti apenas terá de editar o seu tópico já com as correcções, ?
Obrigado Luis Cardoso! Já editei o post! Espero que eu não erre mais na hora de postar novamente. Um abraço!
anna kamilla » Dom Dez 04, 2011 6:02 pm escreveu:lindo mesmo ferreti. gostei também do ambiente feminino da evil queen, agora o meu que nunca ninguém comenta.
Obrigado Anna! Já vi seus outros posts e são muito bonitos! parabéns.
background yes use_xft yes xftfont neuropol x free:size=10 xftalpha 1 update_interval 1.0 total_run_times 0 own_window yes own_window_transparent yes own_window_type override own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager double_buffer yes minimum_size 400 400 maximum_width 1600 draw_shades no draw_outline no draw_borders no draw_graph_borders no default_color C71585 default_shade_color black default_outline_color 000000 alignment top_left gap_x 12 gap_y 12 no_buffers yes uppercase no cpu_avg_samples 2 override_utf8_locale no ############################################## # Output ############################################## TEXT SYSTEM INFO: ${font neuropol x free:size=10}Host: $nodename | ${font neuropol x free:size=10}RAM: $mem/$memmax | ${font neuropol x free:size=10}Disk usage: ${fs_used /}/${fs_size /} | ${font neuropol x free:size=10}CPU usage: ${cpu cpu0}% CPU1 usage: ${cpu cpu1}%
${font neuropol x free:bold:size=52}${time %H:%M:%S} ${font neuropol x free:bold:size=24}${time %A %d %B %Y}
AGARB REGOR
"Somente seres humanos excepcionais e irrepreensíveis suscitam ideias generosas e ações elevadas. O conhecimento é limitado. A imaginação envolve ao mundo."
# Conky, a system monitor, based on torsmo # # Any original torsmo code is licensed under the BSD license # # All code written since the fork of torsmo is licensed under the GPL # # Please see COPYING for details # # Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen # Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS) # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. #
alignment top_Right background no border_width 1 cpu_avg_samples 2 default_color white default_outline_color black default_shade_color white draw_borders no draw_graph_borders yes draw_outline no draw_shades no use_xft yes xftfont Ubuntu regular:size=10 gap_x 20 gap_y 138 minimum_size 5 5 net_avg_samples 2 no_buffers yes out_to_console no out_to_stderr no extra_newline no own_window no own_window_class Conky own_window_type desktop stippled_borders 0 update_interval 1.0 uppercase no use_spacer none show_graph_scale no show_graph_range no double_buffer yes
${color black}${font Courier-new:size=10}${top_mem name 2}${alignr}${top mem 2} % ${top_mem name 3}${alignr}${top mem 3} % ${top_mem name 4}${alignr}${top mem 4} % ${top_mem name 5}${alignr}${top mem 5} %
AGARB REGOR
"Somente seres humanos excepcionais e irrepreensíveis suscitam ideias generosas e ações elevadas. O conhecimento é limitado. A imaginação envolve ao mundo."