Bem-vindo: Qui, 28 de Março 2024, 10:36 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ções do Conky!!

Mensagempor Luis Cardoso » Dom, 21 de Abril 2013, 11:40

Conky Google Now


Pode ser descarregado aqui:
Descomprima o arquivo descarregado e copie o seu conteúdo para a Pasta Pessoal.

No entanto, para poder utilizá-lo, precisa de instalar as seguintes fontes:
Descomprima o ficheiro das fontes e instale aquela que está assinalada.


Antes de correr, terá de mudar a localização. Abra o ficheiro de configuração do Conky:
gedit ~/.conkyrc

Procure por 2294941 e altere pelo valor da sua região presente no endereço que resultar aqui:

No exemplo presente nas imagens, procurei por Braga, Portugal, que me devolveu o seguinte endereço:
Código: Selecionar todos
http://weather.yahoo.com/portugal/braga/braga-737514/

Então, neste caso, tive de substituir 2294941 por 737514. Salva-se as alterações e pode correr o conky, através do seguinte comando:
conky
ImagemImagem
«Escolhe um trabalho de que gostes, e não terás que trabalhar um só dia na tua vida» - Confúcio
Avatar do usuário
Luis Cardoso
Redator
 
Mensagens: 10455
Registrado em: 26 Maio, 2011
Localização: Portugal

Re: Partilhe a configurações do Conky!!

Mensagempor Claudio Novais » Dom, 21 de Abril 2013, 14:21

Lindíssimo este Conky Luís!!! :venia:

É espetacular este conky pois ele não precisa de scripts auxiliares. É só o ficheiro de configuração do Conky e pronto, temos meteorologia! ;) No meu caso ficou assim:
Código: Selecionar todos
# Conky Google Now style #

# Conky settings #
background no
update_interval 1
double_buffer yes
no_buffers yes

# Window specifications #
own_window yes
own_window_type conky
own_window_hints undecorated
,below,sticky,skip_taskbar,skip_pager
own_window_colour FFFFFF

minimum_size 250

# Alignment #
alignment tr
gap_x 100
gap_y 100

border_inner_margin 15
border_outer_margin 0

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

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

override_utf8_locale yes

imlib_cache_size 0

default_color 666666

TEXT
${font Open Sans Light:size=25}${time %A}, ${time %I:%%P}${font}${voffset 15}
${
font Open Sans Light:size=15}${color AAAAAA}${time %B} ${time %e}, ${time %Y}${color}${font}${voffset 15}
${
color EEEEEE}${hr}${color}${voffset 15}
${
execi 300 curl -"http://weather.yahooapis.com/forecastrss?w=737514&u=c" -~/.cache/weather.xml}${font Open Sans Light:size=12}${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -"city=\"[^\"]*\"" | grep -"\"[^\"]*\"" | grep -"[^\"]*"}, ${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -"country=\"[^\"]*\"" | grep -"\"[^\"]*\"" | grep -"[^\"]*"}${font}
${
font Open Sans Light:size=60}${voffset -15}${alignr}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -"temp=\"[^\"]*\"" | grep -"\"[^\"]*\"" | grep -"[^\"]*"}°${font}${voffset -15}
${
execi 300 cp -~/.weathericons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -"code=\"[^\"]*\"" | grep -"\"[^\"]*\"" | grep -"[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p 0,155 -s 60x60}
${
font Open Sans Light:size=10}${voffset -15}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -"text=\"[^\"]*\"" | grep -"\"[^\"]*\"" | grep -"[^\"]*"}${font}
${
font Open Sans Light:size=10}${color AAAAAA}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -"speed=\"[^\"]*\"" | grep -"\"[^\"]*\"" | grep -"[^\"]*"}${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -"speed=\"[^\"]*\"" | grep -"\"[^\"]*\"" | grep -"[^\"]*"}${color}${font}${voffset 15}
${
color EEEEEE}${hr}${color}${voffset 15}
${
color CC0000}${memperc}%${color} of RAM is currently in use${voffset 15}
${
font Open Sans Light:size=10}${color 0099CC}CPU1:${color} ${color 669900}${cpu cpu1}%${color}${alignr}${color 0099CC}CPU2:${color} ${color 669900}${cpu cpu2}%${color}${font}
${
cpugraph cpu1 50,120 FF8800 FF8800}${alignr}${cpugraph cpu2 50,120 FF8800 FF8800}${voffset -45}
Avatar do usuário
Claudio Novais
Editor do Ubuntued
 
Mensagens: 16869
Registrado em: 25 Maio, 2011

Conky Barra Inferior Informativa

Mensagempor Claudio Novais » Sáb, 18 de Maio 2013, 4:19

Este conky é uma barra que fica na parte inferior da tela e que apresenta informações do sistema, nomeadamente o espaço ocupado na raiz e na /home, uploads e downloads e algumas informações extra.


O conky foi originalmente criado por Juan Reyes e estava no topo da tela. Depois de eu fazer algumas modificações, nomeadamente traduzir, reposicionar e acrescentar fundo, o resultado foi o da imagem acima. A configuração do Conky dessa imagem é esta:
Código: Selecionar todos
use_xft yes
background yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_type override
own_window_transparent no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1307
maximum_width 1307
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color green
alignment bottom_right
gap_x 0
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer yes


TEXT
${offset 35}${font Ubuntu Mono:pixelsize=11}${color ffffff}Sistema: ${fs_used /} de ${fs_size /}${offset 15}•${offset 15}Home: ${fs_used /home} de ${fs_size /home}${offset 15}•${offset 15}Memoria:${offset 8}${mem} de 4.00GB${offset 15}•${offset 15}Kernel:${offset 8}${kernel}${offset 15}•${offset 15}Wifi:${offset 8}${wireless_link_qual wlan0}${offset -10}%${offset 15}•${offset 15}Upload:${offset 8}${totalup wlan0}${offset 15}•${offset 15}Download:${offset 8}${totaldown wlan0}${offset 10}•${offset 15}Uptime:${offset 8}$uptime ${offset 30}
Avatar do usuário
Claudio Novais
Editor do Ubuntued
 
Mensagens: 16869
Registrado em: 25 Maio, 2011

Re: Partilhe a configurações do Conky!!

Mensagempor Logistic » Ter, 21 de Maio 2013, 23:03

boas,

Estou com um problema a posicionar o conky no sitio do ecrã que quero, ele anda para a esquerda e para a direita mas para baixo e para cima não mexe.

Código: Selecionar todos
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 3
total_run_times 0
own_window yes
own_window_type conky
own_window_argb_visual yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 70
maximum_width 650
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
default_color e0e0e0
default_shade_color black
default_outline_color green
alignment tr
gap_x 360
gap_y 25
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer right

Logistic
 
Mensagens: 24
Registrado em: 08 Abril, 2013

Re: Partilhe a configurações do Conky!!

Mensagempor Claudio Novais » Ter, 21 de Maio 2013, 23:38

Olá Logistic,

Estou sem tempo neste momento, por isso não vou testar o seu conky. No entanto, esse problema normalmente ocorre quando o Conky é muito alto (mais alto que a resolução do ecrã). Será isso?

Normalmente sugiro que tirem a transparência para verem até onde ele vai. Assim sabe se está a usar toda essa altura ou não. Creio que deve saber, mas mudar de posição verticalmente é a variável gap_y. ;)
Avatar do usuário
Claudio Novais
Editor do Ubuntued
 
Mensagens: 16869
Registrado em: 25 Maio, 2011

Elementary Conky v2

Mensagempor Claudio Novais » Qui, 30 de Maio 2013, 18:56


Esta é uma configuração do Conky muito simples, é apenas constituída pelas horas e a data. No entanto, através das fontes utilizadas, dá um ar de elegância muito interessante em ambientes de trabalho limpos.

Descrição desta Configuração do Conky:
  • O conky original chama-se "Elementary Conky", construído por Xaahu Yazeed, e no ficheiro disponibilizado para download pode-se encontrar duas versões do conky e duas fontes que são as utilizadas para esta configuração.
  • O problema desta configuração é que ela está mal "desenhada", ela chama ficheiros Lua que não existem e tem definições que tornam o conky instável no Unity (pelo menos no Unity). Assim fiz algumas modificações resultando nas seguintes versões:
    • Versão para wallpapers claros:
      Código: Selecionar todos
      # Use Xft?
      use_xft yes
      xftfont AvantGarde LT ExtraLight:bold:pixelsize=9
      xftalpha 0.8
      text_buffer_size 1024

      # Update interval in seconds
      update_interval 1

      # This is the number of times Conky will update before quitting.
      # Set to zero to run forever.
      total_run_times 0

      # Create own window instead of using desktop (required in nautilus)
      own_window_class Conky
      own_window yes
      own_window_type normal
      own_window_transparent yes
      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 300 0
      maximum_width 1000

      # Draw shades?
      draw_shades no
      default_color ffffff #4D4D4D
      # Draw outlines?
      draw_outline no

      # Draw borders around text
      draw_borders no

      # Stippled borders?
      stippled_borders 0

      # border margins
      draw_graph_borders no
      # border width
      border_width 0

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

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

      color0 888


      imlib_cache_size 0

      TEXT
      ${color 222222}${font Quicksand Light - U:pixelsize=70}${time %H %M %S}${font}${voffset -20}${offset 10}${font Existence Light - U:pixelsize=20}${time %p}${font}


      ${voffset 10}${offset 120}${font Existence Light - U:pixelsize=20}${time %A, %d de %B}${font}
      ${voffset -26}${offset 40}${font Existence Light - U:pixelsize=32}${time %Y}${font}
    • Versão para wallpapers escuros:
      Código: Selecionar todos
      # Use Xft?
      use_xft yes
      xftfont AvantGarde LT ExtraLight:bold:pixelsize=9
      xftalpha 0.8
      text_buffer_size 1024

      # Update interval in seconds
      update_interval 1

      # This is the number of times Conky will update before quitting.
      # Set to zero to run forever.
      total_run_times 0

      # Create own window instead of using desktop (required in nautilus)
      own_window_class Conky
      own_window yes
      own_window_type normal
      own_window_transparent yes
      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 300 0
      maximum_width 1000

      # Draw shades?
      draw_shades no
      default_color ffffff #4D4D4D
      # Draw outlines?
      draw_outline no

      # Draw borders around text
      draw_borders no

      # Stippled borders?
      stippled_borders 0

      # border margins
      draw_graph_borders no
      # border width
      border_width 0

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

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

      color0 888


      imlib_cache_size 0

      TEXT
      ${color DDD}${font Quicksand Light - U:pixelsize=70}${time %H %M %S}${font}${voffset -20}${offset 10}${font Existence Light - U:pixelsize=20}${time %p}${font}


      ${voffset 10}${offset 120}${font Existence Light - U:pixelsize=20}${time %A, %d de %B}${font}
      ${voffset -26}${offset 40}${font Existence Light - U:pixelsize=32}${time %Y}${font}

De salientar que esta configuração alterada por mim continua a usar as fontes "Existence Light" e as fontes "Quicksand Light" ambas disponibilizadas no ficheiro do conky original.
Avatar do usuário
Claudio Novais
Editor do Ubuntued
 
Mensagens: 16869
Registrado em: 25 Maio, 2011

Conky Elementary RSS

Mensagempor Claudio Novais » Sáb, 8 de Junho 2013, 2:58


Este simples conky permite ter na área de trabalho 10 feeds (RSS feeds). Neste caso concreto da imagem e da configuração apresentada abaixo apresentamos os feeds do Ubuntued.

Esta configuração deste Conky foi utilizada pelo Luís Cardoso no ambiente de trabalho "Debian elementar" e utiliza as fontes "Existence Light" que foram utilizadas neste conky.

Portanto, para ter esta configuração, antes de mais convém instalar a fonte referida. Depois, você apenas precisa de criar um ficheiro com a seguinte configuração e mandar o conky abrir esse ficheiro. A configuração é a seguinte:
Código: Selecionar todos
    # Use Xft?
    use_xft yes
    xftfont AvantGarde LT ExtraLight:bold:pixelsize=9
    xftalpha 0.8
    text_buffer_size 1024

    # Update interval in seconds
    update_interval 1

    # This is the number of times Conky will update before quitting.
    # Set to zero to run forever.
    total_run_times 0

    # Create own window instead of using desktop (required in nautilus)
    own_window_class Conky
    own_window yes
    own_window_type normal
    own_window_transparent yes
    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 500 0
    maximum_width 800

    # Draw shades?
    draw_shades no
    default_color ffffff #4D4D4D
    # Draw outlines?
    draw_outline no

    # Draw borders around text
    draw_borders no

    # Stippled borders?
    stippled_borders 0

    # border margins
    draw_graph_borders no
    # border width
    border_width 0

    # 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 40
    gap_y 100

    color0 888


    imlib_cache_size 0

    TEXT
    ${color 222}${font Existence Light - U:pixelsize=32}${rss http://feeds.feedburner.com/ubuntued 10 feed_title}${font}
    ${hr 1}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 0}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 1}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 2}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 3}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 4}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 5}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 6}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 7}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 8}${font}

    ${font Existence Light - U:pixelsize=16}${rss http://feeds.feedburner.com/ubuntued 10 item_title 9}${font}
Avatar do usuário
Claudio Novais
Editor do Ubuntued
 
Mensagens: 16869
Registrado em: 25 Maio, 2011

Re: Partilhe a configurações do Conky!!

Mensagempor Paulo Anderson » Sáb, 8 de Junho 2013, 5:06

Pessoal... eu instalei o Conky, mas a pasta .conky não aparece na minha pasta pessoal, mesmo usando com o ctrl+h

Paulo Anderson
 
Mensagens: 29
Registrado em: 01 Maio, 2013

Re: Partilhe a configurações do Conky!!

Mensagempor Exploit » Sáb, 8 de Junho 2013, 6:08

crias uma e já ficas a ter..

mas o conky não usa essa pasta.. ele lê o ficheiro .conkyrc presente na pasta pessoal
Avatar do usuário
Exploit
 
Mensagens: 1297
Registrado em: 31 Agosto, 2011

Colors Conky

Mensagempor Claudio Novais » Seg, 10 de Junho 2013, 2:40


Colors_conky


Este conky resume-se 7 círculos que simulam uma espécie de concavidade circular que é preenchida com cores consoante a utilização de cada aspeto do computador. Por ordem de cima para baixo os círculos indicam as seguintes informações:
  • Processador utilizado
  • Temperatura
  • Memória Ram utilizada
  • Upload da rede
  • Download da rede
  • Espaço ocupado na partição da Raiz
  • Espaço ocupado na partição da /home (pasta pessoal)

O conky foi desenhado por Dany e ele pode ser obtido originalmente neste link. O Conky deste link tem alguns pressupostos: ele tem de ser guardado na Pasta pessoal (ficando à vista de toda a gente); tem um bug que é uma localização absoluta de uma imagem para o computador do Dany; e ele utiliza a placa de rede por cabo, ao invés da placa wireless para mostrar as estatísticas de utilização.

Por estes motivos referidos acima, eu resolvi fazer as minhas modificações (quase que já é costume!). Então fiz as seguintes modificações: pus as configurações de forma a que se ponha os ficheiros numa pasta oculta chamada ".conky", para ficarem salvaguardados; pus o ficheiro lua sem links absolutos para que a imagem de fundo seja carregada em qualquer computador; alterei a placa de rede para utilizar o valor comum para as placas wireless (o Wlan0) e ainda fiz alguns ajustes de posicionamento das letras.

Caso você precise de alterar a placa de rede (por cabo ou wireless) procure no ficheiro ".lua.lua" pela parte onde diz "wlan0" das configurações abaixo (no caso do ficheiro original deve procurar por eth0) e altere para o valor correto. Se precisar de ajuda neste aspeto pergunte aqui neste tópico!

Instalação do Conky



A instalação desta configuração do conky apresentado na imagem acima (com as minhas modificações) é relativamente simples. Antes de mais, como é óbvio você precisa de ter o Conky instalado. Depois precisa de instalar as fontes Aller que podem ser obtidas neste link (só precisa de instalar as fontes "Aller_Bd.ttf").

Quando já tiver estes dois pré-requisitos, grave os 3 ficheiros seguintes na pasta oculta chamada ".conky" que deve estar presente na sua Pasta Pessoal. Caso ela não exista (por padrão não existe!) crie uma exatamente com esse nome, mas sem aspas. Os ficheiros que deverá colocar são os seguintes (sempre sem aspas nos nomes):
  • Um ficheiro de texto com o nome ".lua.lua" e com o seguinte conteúdo:
    Código: Selecionar todos
    --[[
    Ring Meters by londonali1010 (2009)
     
    This script draws percentage meters as rings. It is fully customisable; all options are described in the 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/rings-v1.2.1.lua
       lua_draw_hook_pre ring_stats
     
    Changelog:
    + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)
    + v1.2 -- Added option for the ending angle of the rings (07.10.2009)
    + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
    + v1.0 -- Original release (28.09.2009)
    ]]
     
    settings_table = {

       {
          name='cpu',
          arg='cpu0',
          max=100,
          bg_colour=0xffffff,
          bg_alpha=0.0,
          fg_colour=0x00C9FF,
          fg_alpha=1.0,
          x=35, y=35,
          radius=29,
          thickness=7,
          start_angle=0,
          end_angle=360
       },
       {
          name='hwmon',
          arg='temp 1',
          max=100,
          bg_colour=0xffffff,
          bg_alpha=0.0,
          fg_colour=0xFF00D9,
          fg_alpha=1.0,
          x=35, y=135,
          radius=29,
          thickness=7,
          start_angle=0,
          end_angle=360
       },
       {
          name='memperc',
          arg='',
          max=100,
          bg_colour=0xffffff,
          bg_alpha=0.0,
          fg_colour=0x47B13E,
          fg_alpha=1.0,
          x=35, y=235,
          radius=29,
          thickness=7,
          start_angle=0,
          end_angle=360
       },
       {
          name='upspeedf',
          --arg='eth0',
          arg='wlan0',
          max=33,
          bg_colour=0xffffff,
          bg_alpha=0.0,
          fg_colour=0xFF9401,
          fg_alpha=1.0,
          x=35, y=335,
          radius=29,
          thickness=7,
          start_angle=0,
          end_angle=360
       },
       {
          name='downspeedf',
          --arg='eth0',
          arg='wlan0',
          max=65,
          bg_colour=0xffffff,
          bg_alpha=0.0,
          fg_colour=0x6948FF,
          fg_alpha=1.0,
          x=35, y=435,
          radius=29,
          thickness=7,
          start_angle=0,
          end_angle=360
       },
       {
          name='fs_used_perc',
          arg='/',
          max=100,
          bg_colour=0xffffff,
          bg_alpha=0.0,
          fg_colour=0xFF2C34,
          fg_alpha=1.0,
          x=35, y=535,
          radius=29,
          thickness=7,
          start_angle=0,
          end_angle=360
       },
       {
          name='fs_used_perc',
          arg='/home',
          max=100,
          bg_colour=0xffffff,
          bg_alpha=0.0,
          fg_colour=0xEAE710,
          fg_alpha=1.0,
          x=35, y=635,
          radius=29,
          thickness=7,
          start_angle=0,
          end_angle=360
       },   
    }

    settings_t = {
    }
    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_ring_cc(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_negative(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_negative(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
       cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
       cairo_stroke(cr)      
    end
    function conky_ring_stats()
       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
       local function setup_rings_cc(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_cc(cr,pct,pt)
       end
       if conky_window==nil then return end
       local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
     
       local cr=cairo_create(cs)   
     
       local updates=conky_parse('${updates}')
       update_num=tonumber(updates)
     
       if update_num>5 then
          for i in pairs(settings_table) do
             setup_rings(cr,settings_table[i])
          end
          for i in pairs(settings_t) do
             setup_rings_cc(cr,settings_t[i])
          end
       end
    end
    require 'imlib2'

    function init_drawing_surface()
        imlib_set_cache_size(4096 * 1024)
        imlib_context_set_dither(1)
    end

    function draw_image()
        init_drawing_surface()
       
        --you'll need to change the path here (keep it absolute!)
        image = imlib_load_image(os.getenv("HOME") .."/.conky/conky.png")
        if image == nil then return end
        imlib_context_set_image(image)
       imlib_render_image_on_drawable(0,0)
       imlib_free_image()
    end


    function conky_start()
        if conky_window == nil then return end
        draw_image()
    end
  • O ficheiro de configuração do Conky, também um ficheiro de texto, com o nome "conkyrc" e com o conteúdo seguinte:
    Código: Selecionar todos
    # -- Conky settings -- #
    background yes
    update_interval 1

    cpu_avg_samples 2
    net_avg_samples 2

    override_utf8_locale yes
    short_units yes
    double_buffer yes
    no_buffers yes

    text_buffer_size 2048
    imlib_cache_size 0

    own_window_type normal
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    own_window yes
    own_window_transparent yes
    #own_window_argb_visual yes
    #own_window_title pie/ring-chart + text

    border_inner_margin 0
    border_outer_margin 0

    minimum_size 70 700
    alignment tr
    gap_x 30
    gap_y 160
    # -- Graphics settings -- #
    draw_shades no
    draw_outline no
    default_color cccccc
    draw_borders no
    draw_graph_borders no
    use_xft yes
    xftfont Aller:Bold:size=10
    xftalpha 0.5

    # -- Lua load -- #
    lua_load ~/.conky/.lua.lua
    lua_draw_hook_pre ring_stats
    lua_draw_hook_post start

    #at least one line (empty or not) after TEXT
    TEXT
    ${goto 22}${voffset 27}CPU
    ${goto 19}${voffset 83}TEMP
    ${goto 22}${voffset 83}RAM
    ${goto 27}${voffset 83}UP
    ${goto 16}${voffset 83}DOWN
    ${goto 18}${voffset 83}ROOT
    ${goto 17}${voffset 83}HOME
  • Deverá guardar a imagem deste link com o nome "conky.png"

Por fim, para abrir esta configuração do conky, basta executar o comando seguinte que abre o Conky e chama o ficheiro da configuração:
conky -c ~/.conky/conkyrc


Vídeo demonstrativo



Neste vídeo mostra-se toda a instalação apresentada na secção anterior, desde a instalação do Conky à execução desta configuração:
Avatar do usuário
Claudio Novais
Editor do Ubuntued
 
Mensagens: 16869
Registrado em: 25 Maio, 2011

AnteriorPróximo

Voltar para Temas do Ubuntu

Quem está online

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

cron