Notizia:
  • Rilasciata Precise Pangolin 12.04. Per ottenerla, visitate questa pagina, oppure provate il tour dal vivo con un browser web moderno.
  • Nuovo forum di Ubuntu-it, l'annuncio. È consigliato aggiornare il proprio profilo e controllare la sezione Gruppo Forum per problemi noti.
  • Rilasciata la versione italiana di Precise Pangolin 12.04. Per maggiori informazioni, consultare questa discussione.
  • Il vincitore del Concorso desktop del mese di aprile è Jerico. L'elenco dei precedenti vincitori è qui.
  • È uscito il numero 17 della Newsletter italiana di Ubuntu. Lo trovate a questo indirizzo.
  • È uscito il numero 59 di Full Circle Magazine in italiano. Lo trovate a questo indirizzo.

Conky & conkyForecast [2°Parte]

Il ritrovo della comunità dove confrontarsi e discutere sulle notizie dal mondo dell'informatica, di Ubuntu e di tutto quello che la riguarda, novità, pettegolezzi e quant'altro.

Conky & conkyForecast [2°Parte]

Messaggioda deegan » domenica 5 febbraio 2012, 18:24

Come suggerito da Janvitus si continua qui::*  ;D
Collegamento alla 1°discussione
Su richiesta ecco la mia cartella .fonts
http://eroshare.in/np01g4knqahr.html
http://eroshare.in/f02zc7pifn1a.html

Rincomincio io::*  :P
Immagine

.conkyMeteo
Codice: Seleziona tutto
######################
# - Conky settings - #
######################
#!/usr/bin/conky -d -c

update_interval 1.0
total_run_times 0
cpu_avg_samples 2
net_avg_samples 2
imlib_cache_size 0
imlib_cache_flush_interval  ##Interval (in seconds) to flush Imlib2 cache.
    
double_buffer yes
no_buffers yes
  format_human_readable

#####################
# - Text settings - #
#####################
use_xft yes
xftfont Cure:size=8
override_utf8_locale yes
text_buffer_size 1920

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

minimum_size 160
maximum_width 160
alignment top_right
gap_x 10
gap_y 60

#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
use_spacer none
xftalpha 0.8
uppercase no
background no
#border_inner_margin 1
#border_outer_margin 0


default_color 929292 ##707070
color0 286f8a
color1 00FF00
color2 ffff00
color3 A9A9A9

##  Controlla il consumo (in % di cpu) di tutti i processi conky
# watch -n 0,5 ps -C conky -o cmd,pcpu

##LUA LOAD##
lua_load ~/lua/bargraph_small.lua
lua_draw_hook_post main_bars

#  conky -c .conkyMeteo  

TEXT
${font Nu:size=8}${alignc}Besozzo  ${execi 3600 conkyForecast -d HT -u -x}°C
${font Cure:size=8}${alignc}${execi 1800 conkyForecast --datatype=CT}
${execpi 1800 conkyForecast --location=ITXX0082 --template=/home/deegan/.scripts/varese.template}



${font Cure:size=8}${alignc}${execi 500 conkyForecast --datatype=MP}

${voffset -7}${alignc 25}${execpi 600 conkyForecast  --datatype=DW --startday=1 --shortweekday} ${alignc -6}${execpi 600 conkyForecast  --datatype=DW --startday=2 --shortweekday} ${alignc -43}Luna
${voffset 4}${alignc 60}${font ConkyWeather:size=28}${execpi 600 conkyForecast  --datatype=WF --startday=1 --endday=2 --spaces=1}$font

${font ZeKton:size=7:style=bold}${voffset -10}${alignc 35}${execi 500 /usr/bin/conkyForecast  --startday=1 --datatype=HT}${alignc -2}${execi 500 /usr/bin/conkyForecast  --startday=2 --datatype=HT}
${font Cure:size=8}
${offset -5}${goto 80}$stippled_hr $color
${font ZeKton:size=8:style=bold}${alignc}${time %d %B. %Y}
${alignc}${time %A}
${font ZeKton:size=16:style=bold}${alignc}${time %H:%M}
${voffset -15}${goto 70}${stippled_hr}
${color 707070}${font Nu:size=8}${voffset -15}${alignc}Lucid Lynx 10.04
${font Cure:size=8}${alignc}$processes processes ($running_processes running)
${alignc}${nodename}
${alignc}${kernel}  
${voffset -1}${goto 70}${stippled_hr}
CPU. ${cpu cpu0}%

MEM. ${alignr}$memperc% $mem/$memmax

ROOT. ${alignr}${fs_free /}/${fs_size /}/${fs_type /}

${wireless_essid wlan0}. ${alignr}${downspeed wlan0}.Kb/s

${goto 20}CPT. ${hwmon temp 1}°C ${goto 80}|${goto 103}HDT. ${hddtemp /dev/sda}°
${goto 70}${stippled_hr}
${alignc}PACKAGES. ${color red}${execi 6000 aptitude search "~U" | wc -l > ~/.up}${exec tail -n 1 ~/.up} $color

${alignc}Cambio. ${execi 3600 wget -q -O - "http://www.google.com/finance/converter?a=100&from=EUR&to=USD"|grep "<div id=currency_converter_result>"|sed 's/<[^>]*>//g'}

${font ZeKton:size=8:style=bold}${alignc}Mggasdesigns@gmail.it
${font Nu:size=8} ${alignc}Hai ${color3}${execpi 1800 python ~/.scripts/gmail.py} ${color}email
${font Nu:size=8}${color}${goto 70}${stippled_hr}

${alignc}Google Reader${font}
${alignc}${execi 60 ~/.scripts/conkyGoogleReader.py -S -u XXXXXXXXX@gmail.com -p XXXXXXXXXXXXXXX| fold -s -w35}


${font ZeKton:size=8:style=bold}${alignc}${if_running qbittorrent}Qbittorrent $endif
${font Nu:size=8} ${alignc}${if_running qbittorrent}DW:${downspeed wlan0} || UP:${upspeed wlan0}$endif


bargraph_small.lua
Codice: Seleziona tutto
--[[
BARGRAPH WIDGET
v2.1 by wlourf (07 Jan. 2011)
this widget draws a bargraph with different effects
http://u-scripts.blogspot.com/2010/07/bargraph-widget.html
   
To call the script in a conky, use, before TEXT
   lua_load /path/to/the/script/bargraph.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:
x,y     - coordinates of the starting point of the bar, default = middle of the conky window
cap     - end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
       http://www.cairographics.org/samples/set_line_cap/
angle     - angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
       set to 90 for an horizontal bar
skew_x     - skew bar around x axis, default = 0
skew_y     - skew bar around y axis, default = 0
blocks    - number of blocks to display for a bar (values >0) , default= 10
height     - height of a block, default=10 pixels
width     - width of a block, default=20 pixels
space     - space between 2 blocks, default=2 pixels
angle_bar - this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
radius     - for cicular bars, internal radius, default=0
       with radius, parameter width has no more effect.

Colours below are defined into braces {colour in hexadecimal, alpha}
fg_colour    - colour of a block ON, default= {0x00FF00,1}
bg_colour    - colour of a block OFF, default = {0x00FF00,0.5}
alarm        - threshold, values after this threshold will use alarm_colour colour , default=max
alarm_colour - colour of a block greater than alarm, default=fg_colour
smooth        - (true or false), create a gradient from fg_colour to bg_colour, default=false
mid_colour   - colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
          for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
          3 colours to gradient created by fg_colour and alarm_colour, default=no mid_colour
led_effect   - add LED effects to each block, default=no led_effect
          if smooth=true, led_effect is not used
          possibles values : "r","a","e" for radial, parallel, perdendicular to the bar (just try!)
          led_effect has to be used with theses colours :
fg_led        - middle colour of a block ON, default = fg_colour
bg_led        - middle colour of a block OFF, default = bg_colour
alarm_led    - middle colour of a block > ALARM,  default = alarm_colour

reflection parameters, not available for circular bars
reflection_alpha  - add a reflection effect (values from 0 to 1) default = 0 = no reflection
          other values = starting opacity
reflection_scale  - scale of the reflection (default = 1 = height of text)
reflection_length - length of reflection, define where the opacity will be set to zero
          values from 0 to 1, default =1
reflection     - position of reflection, relative to a vertical bar, default="b"
          possibles values are : "b","t","l","r" for bottom, top, left, right
draw_me          - if set to false, text is not drawn (default = true or 1)
          it can be used with a conky string, if the string returns 1, the text is drawn :
          example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",

v1.0 (10 Feb. 2010) original release
v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value   
v1.2 (28 Feb. 2010) just renamed the widget to bargraph
v1.3 (03 Mar. 2010) added parameters radius & angle_bar to draw the bar in a circular way
v2.0 (12 Jul. 2010) rewrite script + add reflection effects and parameters are now set into tables
v2.1 (07 Jan. 2011) Add draw_me parameter and correct memory leaks, thanks to "Creamy Goodness"

--      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 version 3 (GPLv3)
--    
--      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, write to the Free Software
--      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
--      MA 02110-1301, USA.      

]]

require 'cairo'

----------------START OF PARAMETERS ----------
function conky_main_bars()
   local bars_settings={
      {   --[ Graph for CPU1 ]--
         name="cpu",
         arg="cpu0",
         max=100,
         alarm=50,
         alarm_colour={0xFF0000,0.60},
         bg_colour={0xFFFFFF,0.20},
         fg_colour={0x00FF00,0.55},
         mid_colour={{0.45,0xFFFF00,0.70}},
         x=25,y=318,
         blocks=12,
                        space=1.5,
         height=10,width=3,
         angle=90,
                        smooth=true
         },

      {   --[ Graph for Memory ]--
         name="memperc",
         arg="",
         max=100,
         alarm=50,
         alarm_colour={0xFF0000,0.60},
         bg_colour={0xFFFFFF,.20},
         fg_colour={0x00FF00,0.50},
         mid_colour={{0.45,0xFFFF00,0.70}},
         x=26,y=340,
         blocks=12,
                        space=1.5,
         height=10,width=3,
         angle=90,
         smooth=true
         },      
                {   --[ Graph for WinXP ]--
         name="fs_used_perc",
         arg="/",
         max=100,
         alarm=50,
         alarm_colour={0xFF0000,0.60},
         bg_colour={0xFFFFFF,0.20},
         fg_colour={0x00FF00,0.50},
         mid_colour={{0.45,0xFFFF00,0.70}},
         x=26,y=364,
         blocks=12,
                        space=1.5,
         height=10,width=3,
         angle=90,
         smooth=true
         },
               {   --[ Graph for NetDisc ]--
                   name="downspeedf",
                   arg="wlan0",
         max=100,
         alarm=50,
         alarm_colour={0xFF0000,0.60},
         bg_colour={0xFFFFFF,0.20},
         fg_colour={0x00FF00,0.50},
         mid_colour={{0.45,0xFFFF00,0.70}},
         x=26,y=385,
         blocks=12,
                        space=1.5,
         height=10,width=3,
         angle=90,
         smooth=true
         },      
       }   
-----------END OF PARAMETERS--------------


    
   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)    
   --prevent segmentation error when reading cpu state
    if tonumber(conky_parse('${updates}'))>3 then
        for i in pairs(bars_settings) do
           
           draw_multi_bar_graph(bars_settings[i])
           
        end
    end
   cairo_destroy(cr)
   cairo_surface_destroy(cs)
   cr=nil

end



function draw_multi_bar_graph(t)
   cairo_save(cr)
   --check values
   if t.draw_me == true then t.draw_me = nil end
   if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end   
   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'")
      return
   end
   if t.name==nil then t.name="" end
   if t.arg==nil then t.arg="" end

   --set default values   
   if t.x == nil      then t.x = conky_window.width/2 end
   if t.y == nil      then t.y = conky_window.height/2 end
   if t.blocks == nil   then t.blocks=10 end
   if t.height == nil   then t.height=10 end
   if t.angle == nil    then t.angle=0 end
   t.angle = t.angle*math.pi/180
   --line cap style
   if t.cap==nil      then t.cap = "b" end
   local cap="b"
   for i,v in ipairs({"s","r","b"}) do
      if v==t.cap then cap=v end
   end
   local delta=0
   if t.cap=="r" or t.cap=="s" then delta = t.height end
   if cap=="s" then    cap = CAIRO_LINE_CAP_SQUARE
   elseif cap=="r" then
      cap = CAIRO_LINE_CAP_ROUND
   elseif cap=="b" then
      cap = CAIRO_LINE_CAP_BUTT
   end
   --end line cap style
   --if t.led_effect == nil   then t.led_effect="r" end
   if t.width == nil   then t.width=20 end
   if t.space == nil   then t.space=2 end
   if t.radius == nil   then t.radius=0 end
   if t.angle_bar == nil   then t.angle_bar=0 end
   t.angle_bar = t.angle_bar*math.pi/360 --halt angle
   
   --colours
   if t.bg_colour == nil    then t.bg_colour = {0x00FF00,0.5} end
   if #t.bg_colour~=2       then t.bg_colour = {0x00FF00,0.5} end
   if t.fg_colour == nil    then t.fg_colour = {0x00FF00,1} end
   if #t.fg_colour~=2       then t.fg_colour = {0x00FF00,1} end
   if t.alarm_colour == nil    then t.alarm_colour = t.fg_colour end
   if #t.alarm_colour~=2       then t.alarm_colour = t.fg_colour end

   if t.mid_colour ~= nil then   
      for i=1, #t.mid_colour do    
          if #t.mid_colour[i]~=3 then
             print ("error in mid_color table")
             t.mid_colour[i]={1,0xFFFFFF,1}
          end
      end
    end
    
   if t.bg_led ~= nil and #t.bg_led~=2   then t.bg_led = t.bg_colour end
   if t.fg_led ~= nil and #t.fg_led~=2   then t.fg_led = t.fg_colour end
   if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
   
   if t.led_effect~=nil then
      if t.bg_led == nil then t.bg_led = t.bg_colour end
      if t.fg_led == nil    then t.fg_led = t.fg_colour end
      if t.alarm_led == nil  then t.alarm_led = t.fg_led end
   end
   

   if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
   if t.smooth == nil then t.smooth = false end

   if t.skew_x == nil then
      t.skew_x=0
   else
      t.skew_x = math.pi*t.skew_x/180   
   end
   if t.skew_y == nil then
      t.skew_y=0
   else
      t.skew_y = math.pi*t.skew_y/180   
   end
   
   if t.reflection_alpha==nil then t.reflection_alpha=0 end
   if t.reflection_length==nil then t.reflection_length=1 end
   if t.reflection_scale==nil then t.reflection_scale=1 end
   
   --end of default values
   

    local function rgb_to_r_g_b(col_a)
      return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
   end
   
   
   --functions used to create patterns

   local function create_smooth_linear_gradient(x0,y0,x1,y1)
      local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
      cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
      cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
      if t.mid_colour ~=nil then
         for i=1, #t.mid_colour do
            cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
         end
      end
      return pat
   end

   local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
      local pat =  cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
      cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
      cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
      if t.mid_colour ~=nil then
         for i=1, #t.mid_colour do
            cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
         end
      end
      return pat
   end
   
   local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
      local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
      cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
      cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
      cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
      return pat
   end

   local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
      local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
      if mode==3 then
         cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))            
         cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
         cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))            
      else
         cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
         cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))            
      end
      return pat
   end






   local function draw_single_bar()
      --this fucntion is used for bars with a single block (blocks=1) but
      --the drawing is cut in 3 blocks : value/alarm/background
      --not zvzimzblr for circular bar
      local function create_pattern(col_alp,col_led,bg)
         local pat
         
         if not t.smooth then
            if t.led_effect=="e" then
               pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
            elseif t.led_effect=="a" then
               pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
            elseif  t.led_effect=="r" then
               pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
            else
               pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
            end
         else
            if bg then
               pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
            else
               pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
            end
         end
         return pat
      end
      
      local y1=-t.height*pct/100
      local y2,y3
      if pct>(100*t.alarm/t.max) then
         y1 = -t.height*t.alarm/100
         y2 = -t.height*pct/100
         if t.smooth then y1=y2 end
      end
      
      if t.angle_bar==0 then
      
         --block for fg value
         local pat = create_pattern(t.fg_colour,t.fg_led,false)
         cairo_set_source(cr,pat)
         cairo_rectangle(cr,0,0,t.width,y1)
         cairo_fill(cr)
         cairo_pattern_destroy(pat)
      
         -- block for alarm value         
         if not t.smooth and y2 ~=nil then
            pat = create_pattern(t.alarm_colour,t.alarm_led,false)
            cairo_set_source(cr,pat)
            cairo_rectangle(cr,0,y1,t.width,y2-y1)
            cairo_fill(cr)
            y3=y2
            cairo_pattern_destroy(pat)
         else
            y2,y3=y1,y1
         end
         -- block for bg value
         cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
         pat = create_pattern(t.bg_colour,t.bg_led,true)
         cairo_set_source(cr,pat)
         cairo_pattern_destroy(pat)
         cairo_fill(cr)
      end      
   end  --end single bar
   





   local function draw_multi_bar
Ultima modifica di deegan il mercoledì 18 aprile 2012, 22:36, modificato 1 volta in totale.
FB () Conky & conkyForecast [2°Parte]  Schlunix.org   Samsung Galaxy Ace GT-S5830  Rom  Cyanogenmod 7.2
MB:Asus Rampage 2Gene. SV:ATI Sapphire HD 5770. Cpu: QuadCore Intel Core i7 920, 2800 MHz . Ram: 3X2GB Kingston DDR3-1333
deegan
Imperturbabile Insigne
Imperturbabile Insigne
 
Messaggi: 2540
Iscrizione: aprile 2008
Località: Varese

Re: Conky & conkyForecast [Il proseguo]

Messaggioda z_owl » domenica 5 febbraio 2012, 20:07

Ecco il mio:

[img width=800 height=449]http://img252.imageshack.us/img252/1382/schermatadel20120205185.png[/img]

.conkyrc
Codice: Seleziona tutto
own_window yes
own_window_type below
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
 
# fiddle with window
use_spacer right

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048
 
# Update interval in seconds
update_interval 1.0
 
# Minimum size of text area
# minimum_size 250 5
 
# Draw shades?
draw_shades no
 
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
uppercase no # set to yes if you want all text to be in uppercase
 
# Stippled borders?
stippled_borders 0
 
# border margins
border_margin 5
 
# border width
border_width 0
 
# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color white
default_outline_color white
draw_graph_borders yes
 
own_window_colour red
own_window_transparent yes
 
# 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
gap_x 15
gap_y 40

color1 FFD500 #giallo
color2 FF4500#arancione
color3 D9D9D9 #grigio

color4 DDDDDD
color5 AAAAAA
color6 888888
color7 EF5A29

 
# stuff after 'TEXT' will be formatted on screen
 
TEXT
${voffset -33}${font OpenLogos:size=103}${color2}v${font}${voffset -70}${goto 176}${font Sans:size=16}${color4}11.10${font}
${voffset 20}${color2}${font Ubuntu:size=10:style=bold}Sistema${font}
${color}$sysname${color1}$kernel ${color}su ${color1}Ubuntu 11.10 OO
${color}Hostname: ${color1}${nodename}${color} connesso da ${color1}$uptime${color}
$sysname $kernel $alignr $machine
File System: $alignr${fs_type}

${color orange}Processore ${hr 2}$color
${color2}${font Ubuntu:size=10:style=bold} Processore: Intel Core 2 Quad Q8200 2.33 GHz ${font}${color}
Freq.: ${freq}MHz   Carico: ${loadavg}   Temp.: ${acpitemp}

${color1}CPU 1 :$color ${cpu cpu0}%$alignr ${color1}CPU 2 :$color ${cpu cpu1}%
$color3${cpubar cpu0 5,138}$alignr${cpubar cpu1 5,138}
$color3${cpugraph cpu0 32,138 040404 FF8508}$alignr${cpugraph cpu1 32,138 040404 FF8508}
${color1}CPU 3 :$color ${cpu cpu2}%$alignr ${color1}CPU 4 :$color ${cpu cpu3}%
$color3${cpubar cpu2 5,138}$alignr${cpubar cpu3 5,138}
$color3${cpugraph cpu2 32,138 040404 FF8508}$alignr${cpugraph cpu3 32,138 040404 FF8508}

${goto 20} Processes: ${color red}$processes${color}
${goto 20} Running: ${color red}$running_processes ${color}

${offset 45}${font Ubuntu:size=7,weight:bold}${color}CPU
${offset 55}${font Ubuntu:size=7,weight:normal}${color7}${top name 1}${alignr}${top cpu 1}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color4}${top name 2}${alignr}${top cpu 2}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color5}${top name 3}${alignr}${top cpu 3}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top name 4}${alignr}${top cpu 4}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top name 5}${alignr}${top cpu 5}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top name 6}${alignr}${top cpu 6}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top name 7}${alignr}${top cpu 7}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top name 8}${alignr}${top cpu 8}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top name 9}${alignr}${top cpu 9}%

${color orange}Memoria Ram ${hr 2}$color
${color2}${font Ubuntu:size=10:style=bold}Memoria${font}
${color1}Ram${color} ${alignr}$mem / ${memmax} ($memperc%)
${color3}${membar 5,280}$color
${color1}swap${color} ${alignr}$swap / ${swapmax} ($swapperc%)
${color3}${swapbar 5}$color

${offset 45}${font Ubuntu:size=7,weight:bold}${color}Memoria
${offset 55}${font Ubuntu:size=7,weight:normal}${color7}${top_mem name 1}${alignr}${top_mem mem 1}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color4}${top_mem name 2}${alignr}${top_mem mem 2}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color5}${top_mem name 3}${alignr}${top_mem mem 3}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top_mem name 4}${alignr}${top_mem mem 4}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top_mem name 5}${alignr}${top_mem mem 5}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top_mem name 6}${alignr}${top_mem mem 6}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top_mem name 7}${alignr}${top_mem mem 7}%
${offset 55}${font Ubuntu:size=7,weight:normal}${color6}${top_mem name 8}${alignr}${top_mem mem 8}%



.conkyrc2
Codice: Seleziona tutto
own_window yes
own_window_type below
own_window_transparent no
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
 
# fiddle with window
use_spacer right

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048
 
# Update interval in seconds
update_interval 1.0
 
# Minimum size of text area
# minimum_size 250 5
 
# Draw shades?
draw_shades no
 
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
uppercase no # set to yes if you want all text to be in uppercase
 
# Stippled borders?
stippled_borders 0
 
# border margins
border_margin 5
 
# border width
border_width 0
 
# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color white
default_outline_color white
draw_graph_borders yes
 
own_window_colour red
own_window_transparent yes
 
# 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
gap_x 100
gap_y 50

color1 FFD500 #giallo
color2 FF4500#arancione
color3 D9D9D9 #grigio

TEXT
${font Ubuntu:Italic:size=30}${alignr -30}${time %H:%M}${font}${font Ubuntu:style=Bold:italic:size=5}${color3}${voffset -35}${alignr}${time %S}${color}${font}
${voffset 35}${hr 3}${font}
${font Ubuntu:Italic:size=10}${alignr}${time %A  %d  %B  %Y}${font}

${color 707070}
${font Ubuntu:size=20}${alignr}Previsioni metereologiche - Este
${font Ubuntu:size=12}${goto 110}${execi 1800 conkyForecast  --datatype=CT}

${goto 10}${font}${font Ubuntu:size=18}${voffset -20}${execi 500 /usr/bin/conkyForecast  --datatype=HT}
${voffset 35}${goto 10}${font Ubuntu:size=8}${execi 500 conkyForecast  --datatype=MP}${font Ubuntu:size=8}

${voffset 35}${goto 140}Alba     ${execi 500 /usr/bin/conkyForecast  --datatype=SR}

${goto 140}Tramonto    ${execi 500 /usr/bin/conkyForecast  --datatype=SS}

${goto 140}Temperatura minima     ${execi 1680 conkyForecast  --datatype=LT --startday=0}

${goto 140}Tempreratura massima     ${execi 1680 conkyForecast  --datatype=HT --startday=0}

${goto 140}Umidità     ${execi 500 /usr/bin/conkyForecast  --datatype=HM}

${goto 140}Vento     ${execpi 900 conkyForecast  --datatype=WS}

${goto 10}Visibilità     ${execpi 900 conkyForecast  --datatype=VI}

${goto 10}Precipitazioni    ${execpi 900 conkyForecast  --datatype=PC --startday=0}

${goto 10}Raggi UV     ${execpi 900 conkyForecast --datatype=UI} - ${execpi 900 conkyForecast  --datatype=UT}

${goto 10}Gradimento   ${execi 600 conkyForecast --imperial --datatype=LT --centeredwidth=4 -iu}

#${goto 10}${execpi 900 conkyForecast  --datatype=CN}    ${color}${execpi 900 conkyForecast  --datatype=CO}

${execpi 1800 conkyForecast  --template=/home/jacopo/.moontemplate}

$font${voffset -800}${font Ubuntu:size=8}


${goto 300}Domani, ${execi 1800 conkyForecast  --datatype=DW --startday=1 --shortweekday}. ${execi 500 /usr/bin/conkyForecast  --startday=1 --datatype=HT}
${goto 300}${execi 600 conkyForecast  --startday=1 --datatype=CT}
${goto 300}${execi 1680 conkyForecast  --datatype=LT --startday=1}/${execi 1680 conkyForecast  --datatype=HT --startday=1}




${goto 300}${execi 1800 conkyForecast  --datatype=DW --startday=2 --shortweekday}. ${execi 500 /usr/bin/conkyForecast  --startday=2 --datatype=HT}
${goto 300}${execi 600 conkyForecast  --startday=2 --datatype=CT}
${goto 300}${execi 1680 conkyForecast  --datatype=LT --startday=2}/${execi 1680 conkyForecast  --datatype=HT --startday=2}





${goto 300}${execi 1800 conkyForecast  --datatype=DW --startday=3 --shortweekday}. ${execi 500 /usr/bin/conkyForecast  --startday=3 --datatype=HT}
${goto 300}${execi 600 conkyForecast  --startday=3 --datatype=CT}
${goto 300}${execi 1680 conkyForecast  --datatype=LT --startday=3}/${execi 1680 conkyForecast  --datatype=HT --startday=3}





${goto 300}${execi 1800 conkyForecast  --datatype=DW --startday=4 --shortweekday}. ${execi 500 /usr/bin/conkyForecast  --startday=4 --datatype=HT}
${goto 300}${execi 600 conkyForecast  --startday=4 --datatype=CT}
${goto 300}${execi 1680 conkyForecast  --datatype=LT --startday=4}/${execi 1680 conkyForecast  --datatype=HT --startday=4}


.conkyrc3
Codice: Seleziona tutto
own_window yes
own_window_type below
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
 
# fiddle with window
use_spacer right

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048
 
# Update interval in seconds
update_interval 1.0
 
# Minimum size of text area
# minimum_size 250 5
 
# Draw shades?
draw_shades no
 
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
uppercase no # set to yes if you want all text to be in uppercase
 
# Stippled borders?
stippled_borders 0
 
# border margins
border_margin 5
 
# border width
border_width 0
 
# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color white
default_outline_color white
draw_graph_borders yes
 
own_window_colour red
own_window_transparent yes
 
# 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
gap_x 550
gap_y 50

color1 FFD500 #giallo
color2 FF4500#arancione
color3 D9D9D9 #grigio

TEXT
${color2}${font Ubuntu:size=10:style=bold}Altri dati${font}
${color2}${font Ubuntu:size=10:style=bold} Rete Wireless${font}${color} (IP: ${addr wlan1}) ${hr 2}$color
Download: $color${downspeed wlan1} kb/s ${alignr}Upload: ${upspeed wlan1} kb/s
${downspeedgraph wlan1 25,140 000000 ff0000} ${alignr}${upspeedgraph wlan1
25,140 000000 00ff00}$color
Totale: ${totaldown wlan1} ${alignr}Totale: ${totalup wlan1}
ESSID: $alignr ${wireless_essid wlan1}
Connection quality: $alignr ${wireless_link_qual_perc wlan1}%
DLS:${downspeed wlan1} kb/s $alignr total: ${totaldown wlan1}

${color orange}Disco fisso - Spazio ${hr 2}$color

Root:   Libero: ${fs_size /}(${fs_free_perc /}%)    Usato: ${fs_used /}(${fs_used_perc /}%)
   ${color3}${fs_bar 5 /}
Home:   Libero: ${fs_size /home}(${fs_free_perc  /home}%)    Usato: ${fs_used  /home}(${fs_used_perc  /home}%)
   ${color3}${fs_bar 5  /home}


${font Ubuntu:style=Bold:size=10}${offset -17}${voffset 10}${font}${color}${voffset -1}${font Ubuntu:size=10}${execpi 300 DJS=`date +%_d`; cal -h | sed '2,7!d'| sed '/./!d' | sed 's/^/${goto 40} /'| sed 's/$/ /' | sed 's/^/ /' | sed /" $DJS "/s/" $DJS "/" "'${font Ubuntu:style=Bold:size=10}${color1}'"$DJS"'${color}${font Ubuntu:size=10}'" "/}${voffset -1}



.moontemplate
Codice: Seleziona tutto
${font Ubuntu:size=10}
${image [--datatype=WI] -p 110,150 -s 150x150}
${image [--datatype=MI] -p 10,310 -s 100x100}
${voffset -135}${goto 140}${font ConkyWindNESW:style=Bold:size=47}${execi 600 conkyForecast --datatype=BS}
${image [--datatype=WI --startday=1] -p 300,195 -s 60x60}
${image [--datatype=WI --startday=2] -p 300,295 -s 60x60}
${image [--datatype=WI --startday=3] -p 300,395 -s 60x60}
${image [--datatype=WI --startday=4] -p 300,495 -s 60x60}
Ubuntu, Windows 7 e Arch Linux e Gentoo finalmente!!
Scrivete in italiano corretto e soprattutto cercate di essere "civili" quando scrivete! :)
Avatar utente
z_owl
Entusiasta Emergente
Entusiasta Emergente
 
Messaggi: 1614
Iscrizione: luglio 2010
Località: Carceri (PD)
Distribuzione: Ubuntu 12.04 LTS x86_64
Desktop: Unity

Re: Conky & conkyForecast [Il proseguo]

Messaggioda m3nhir » domenica 5 febbraio 2012, 20:36

mi iscrivo per seguire il proseguo  ;D  (rotfl)
Chi sa ascoltare non soltanto è simpatico a tutti , ma dopo un pò finisce  con l'imparare qualcosa.
-Wilson Mizner- Linux User # 207701 Ubuntu User # 27508
Avatar utente
m3nhir
Entusiasta Emergente
Entusiasta Emergente
 
Messaggi: 1663
Iscrizione: dicembre 2008
Distribuzione: Ubuntu 12.04.4 LTS x86_64
Desktop: gnome-shell

Re: Conky & conkyForecast [Il proseguo]

Messaggioda deegan » domenica 5 febbraio 2012, 23:32

m3nhir ha scritto:mi iscrivo per seguire il proseguo  ;D  (rotfl)


...  ;D ;D ;D
FB () Conky & conkyForecast [2°Parte]  Schlunix.org   Samsung Galaxy Ace GT-S5830  Rom  Cyanogenmod 7.2
MB:Asus Rampage 2Gene. SV:ATI Sapphire HD 5770. Cpu: QuadCore Intel Core i7 920, 2800 MHz . Ram: 3X2GB Kingston DDR3-1333
deegan
Imperturbabile Insigne
Imperturbabile Insigne
 
Messaggi: 2540
Iscrizione: aprile 2008
Località: Varese

Re: Conky & conkyForecast [Il proseguo]

Messaggioda albertoo » lunedì 6 febbraio 2012, 12:30

mi iscrivo incuriosito...nella speranza di capire mai come diavolo funziona sto coso...  ;D
[size=100]Ubuntu User # 32148
Linux user number 521477
[/size]
Avatar utente
albertoo
Prode Principiante
 
Messaggi: 119
Iscrizione: dicembre 2009

Re: Conky & conkyForecast [Il proseguo]

Messaggioda clyde » lunedì 6 febbraio 2012, 12:39

Ho seguito il primo....... perché smettere? ;D
Certo che Ubuntu è veramente bello: non mi sentivo cosi "padrone del mezzo" da quando mi regalarono il mio Vic20.......
Avatar utente
clyde
Prode Principiante
 
Messaggi: 76
Iscrizione: agosto 2009

Re: Conky & conkyForecast [Il proseguo]

Messaggioda clodiopulcro » lunedì 6 febbraio 2012, 15:44

Proseguo o prosieguo?
"Windows was created to keep stupid people away from UNIX"
Avatar utente
clodiopulcro
Entusiasta Emergente
Entusiasta Emergente
 
Messaggi: 1517
Iscrizione: luglio 2008

Re: Conky & conkyForecast [Il proseguo]

Messaggioda riki79 » lunedì 6 febbraio 2012, 18:53

Pronto per il secondo viaggio.
riki79
Prode Principiante
 
Messaggi: 34
Iscrizione: febbraio 2008
Località: Verona
Distribuzione: Archlinux
Desktop: LXDE

Re: Conky & conkyForecast [Il proseguo]

Messaggioda kar » lunedì 6 febbraio 2012, 19:56

anch'io continuo a seguire ....
kar
Scoppiettante Seguace
Scoppiettante Seguace
 
Messaggi: 605
Iscrizione: ottobre 2006

Re: Conky & conkyForecast [Il proseguo]

Messaggioda tommaa39 » lunedì 6 febbraio 2012, 20:39

clodiopulcro ha scritto:Proseguo o prosieguo?


Io voto prosieguo:

http://dizionari.hoepli.it/Dizionario_Italiano/parola/prosieguo.aspx?idD=1&Query=prosieguo
Avatar utente
tommaa39
Prode Principiante
 
Messaggi: 122
Iscrizione: maggio 2008
Località: Trieste

Re: Conky & conkyForecast [Il proseguo]

Messaggioda Iacoporosso » lunedì 6 febbraio 2012, 22:40

riposto visto che sull'altra parte andrà perso...In Grass conky    ;D ;D

Immagine

conkyrc
Codice: Seleziona tutto
background no
xftfont Eurostile:size=7
use_xft yes
xftalpha 0.8
update_interval .3
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
minimum_size 300
default_color 111111
alignment tb
gap_y 32
gap_x 44
cpu_avg_samples 1

lua_load /home/jroxo/Scrivania/overlay.lua
lua_draw_hook_post start

TEXT
 
${offset 60}${voffset 150}${font Aller :pixelsize=200}${time %H:%M}


overlay.lua
Codice: Seleziona tutto
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("/home/jroxo/Scrivania/overlay.png")
    if image == nil then return end
    imlib_context_set_image(image)
   imlib_render_image_on_drawable(0,171)
   imlib_free_image()
end


function conky_start()
    if conky_window == nil then return end
    draw_image()
end


praticamente sovrappone un immagine al conky stesso.. nel mio caso un immagine che rappresenta parte dello sfondo ( posso passarvi sia immagine che sfondo ma dipende molto dalla risoluzione del monitor per avere un perfetto sovrapponimento quindi vi consiglio di fare a manina sul vostro sfondo    ;)
Avatar utente
Iacoporosso
Prode Principiante
 
Messaggi: 209
Iscrizione: gennaio 2011

Re: Conky & conkyForecast [2°Parte]

Messaggioda deegan » lunedì 6 febbraio 2012, 23:00

Ancora in modifica::*  ;)
Immagine

Non riesco a capire come cambiare il colore alle lancette::*

Conkyrc
Codice: Seleziona tutto
# Conky settings #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

temperature_unit fahrenheit

# Window specifications #

own_window yes
own_window_type override
#own_window_type normal
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 400 470
maximum_width 400

alignment tm
gap_x 10
gap_y 15

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

# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 1

uppercase no
#tempature_unit celsius
temperature_unit fahrenheit

#add8e6
#850100
default_color 3399cc ##b2dfee

# Lua Load  #
lua_load /home/deegan/d/earthclock.lua
lua_draw_hook_pre clock_rings

TEXT
${font caviar dreams:Bold:size=16}${voffset 116}${goto 183}12
${voffset -10}${goto 131}11${goto 245}1${font}
${voffset 10}${goto 30}${font caviar dreams:Bold:size=16}${goto 90}10${goto 285}2${font}${voffset -10}

${voffset 17}


${font caviar dreams:Bold:size=16}${voffset -26}${goto 85}9${goto 298}3
${voffset 28}${goto 101}8${goto 285}4${font}${voffset -18}


${font caviar dreams:size=16}${voffset 12}${goto 140}7${goto 248}5
${voffset -9}${goto 193}6${font}
${voffset 51}


earthclock.lua
Codice: Seleziona tutto
--[[
Clock Rings by londonali1010 (2009) Edited by jpope

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 (05.10.2009)
]]

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=0x3399cc,
        -- "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=200, y=235,
        -- "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
    },
--secondo
    {
        name="time",
        arg="%S",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=200, y=235,
        radius=56,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
--terzo
    {
        name="time",
        arg="%d",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=200, y=235,
        radius=62,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
--quarto
    {
        name="time",
        arg="%m",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=200, y=235,
        radius=70,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
--quinto
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=200, y=235,
        radius=76,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
--12
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=199, y=127,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=252, y=143,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=291, y=182,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=305, y=235,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=291, y=288,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=253, y=328,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=199, y=342,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=145, y=328,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=107, y=288,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=92, y=235,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=107, y=182,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
   name="cpu",
   arg="cpu0",
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x3399cc,
        fg_alpha=0.4,
        x=146, y=143,
        radius=25,
        thickness=5,
        start_angle=0,
        end_angle=360
    },



}

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

clock_r=120

-- "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=200
clock_y=235

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,0.2,1,1,1)
    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)
        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
Ultima modifica di deegan il martedì 7 febbraio 2012, 1:35, modificato 1 volta in totale.
FB () Conky & conkyForecast [2°Parte]  Schlunix.org   Samsung Galaxy Ace GT-S5830  Rom  Cyanogenmod 7.2
MB:Asus Rampage 2Gene. SV:ATI Sapphire HD 5770. Cpu: QuadCore Intel Core i7 920, 2800 MHz . Ram: 3X2GB Kingston DDR3-1333
deegan
Imperturbabile Insigne
Imperturbabile Insigne
 
Messaggi: 2540
Iscrizione: aprile 2008
Località: Varese

Re: Conky & conkyForecast [2°Parte]

Messaggioda Vetto » martedì 7 febbraio 2012, 21:44

Ci sono anche io..!

sera a tutti, sperando di non andare  (ot)
ho questo errore se lancio conky, mi potreste aiutare grazie?
Codice: Seleziona tutto
vetto@crunchbang:~$ conky
conky                                 conkyForecastWU
conkyForecast                         conkywonky
conkyForecast-SunsetSunriseCountdown  
vetto@crunchbang:~$ conky
Conky: desktop window (1600003) is subwindow of root window (101)
Conky: window type - override
Conky: drawing to created window (0x2a00001)
Conky: drawing to double buffer
ERROR: Config data file /home/vetto/.conkyForecast.config not found, using defaults (Registration info is needed though)
Traceback (most recent call last):
  File "/usr/share/conkyforecast/conkyForecast.py", line 1698, in <module>
    main()
  File "/usr/share/conkyforecast/conkyForecast.py", line 1694, in main
    forecastinfo = ForecastInfo(options)
  File "/usr/share/conkyforecast/conkyForecast.py", line 592, in __init__
    socket.setdefaulttimeout(self.config.CONNECTION_TIMEOUT)
AttributeError: 'NoneType' object has no attribute 'CONNECTION_TIMEOUT'


non mi viene visualizzato nessun conkymeteo
i paremetri sono tutto al suo posto,
il codice di regg.Weather, il codice riguardante la mia Citta....

da quello che potrete leggere il sistema e crunchbang.
Ultima modifica di Vetto il mercoledì 8 febbraio 2012, 11:27, modificato 1 volta in totale.
Avatar utente
Vetto
Scoppiettante Seguace
Scoppiettante Seguace
 
Messaggi: 447
Iscrizione: aprile 2009

Re: Conky & conkyForecast [2°Parte]

Messaggioda pier_blackhawk » mercoledì 8 febbraio 2012, 19:47

Guardando soprattutto qui, ho iniziato a modificare il mio .conkyrc. Per ora sono davvero ad un livello dilettantistico: il risultato non è elaborato e mi dà ancora dei problemi, per i quali sto cercando aiuto (sebbene non sia sicuro che sia il posto adatto per farlo ;D).

Il primo problema è che degli indicatori dell'area networking non funziona niente (magari devo installare qualche programma, ma quale?).

Il secondo è che per i processi in esecuzione sono indicati PID e %CPU, mentre io vorrei aggiungere anche la %RAM. Il comando l'ho trovato in rete, ma quello che non mi riesce è di allineare chiaramente questre tre colonne (tipo qui). Le due colonne che ho attualmente sono semplicemente allineate al centro e a destra con rispettivamente "alignc" e "alignr".

Infine non riesco a modificare le dimensioni della finestra: la larghezza va bene, ma non la lunghezza. Infatti se aggiungo troppi indicatori alcuni non vengoni visti.

Ecco il .conkyrc:
Codice: Seleziona tutto
#CONKYRC
#-------------------------------

#avoid flicker
double_buffer yes

#own window to run simultanious 2 or more conkys
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager

#borders
draw_borders no
border_margin 1

#shades
draw_shades no

#position
gap_x 17
gap_y 73
alignment top_right

#behaviour
update_interval 1

#colour
default_color ffffff

#default_shade_color 000000

#own_window_colour 222222

#font
use_xft yes
xftfont Fixed:pixelsize=10
uppercase no

#to prevent window from moving
use_spacer none
minimum_size 200
maximum_size 250

TEXT

${alignc}lmr@${nodename}
${time %H:%M - %d.%m.%Y} ${alignr}Since ${uptime_short} up
${sysname} ${kernel} ${machine} ${alignr}conky ${conky_version}

${hr 2}

Name${alignc}PID${alignr}CPU

${top name 1} ${alignc}${top pid 1} ${alignr}${top cpu 1}%
${top name 2} ${alignc}${top pid 2} ${alignr}${top cpu 2}%
${top name 3} ${alignc}${top pid 3} ${alignr}${top cpu 3}%
${top name 4} ${alignc}${top pid 4} ${alignr}${top cpu 4}%
${top name 5} ${alignc}${top pid 5} ${alignr}${top cpu 5}%
${top name 6} ${alignc}${top pid 6} ${alignr}${top cpu 6}%

Processes: $processes ${alignr}Running: $running_processes

RAM: ${memperc}% ${membar 7}
Core1: ${cpu cpu1}% ${cpubar 7}
Core1: ${freq}MHz ${offset 87} HD: ${diskio}%
Core2: ${cpu cpu2}% ${cpubar 7}
Core2: ${freq}MHz ${offset 87} HD: ${diskio}%
${cpugraph 32,150} ${diskiograph 32,150}

Down: ${downspeed wlan0} k/s ${offset 95}Up: ${upspeed wlan0} k/s
${downspeedgraph wlan0 32,150} ${upspeedgraph wlan0 32,150}
Wi-Fi: ${wireless_link_qual_perc wlan0}% ${wireless_link_bar wlan0}
wlan0 IP: ${addr wlan0} ${alignc} eth0 IP: ${addr eth0}
ESSID: ${wireless_essid wlan0} ${alignc} Bitrate: ${wireless_bitrate wlan0}


Grazie in anticipo.
Think, McFly! Think!
pier_blackhawk
Prode Principiante
 
Messaggi: 84
Iscrizione: gennaio 2010

Re: Conky & conkyForecast [2°Parte]

Messaggioda Giothebest » mercoledì 8 febbraio 2012, 20:26

puoi postare un immagine del tuo conky, così  vedo un secondo il fatto dell'allineamento.
"Non è un perfetto idiota solo perchè nessuno è perfetto." Groucho Marx
"Val sempre la pena di fare una domanda, ma non sempre di darle una risposta"
Avatar utente
Giothebest
Scoppiettante Seguace
Scoppiettante Seguace
 
Messaggi: 909
Iscrizione: maggio 2011
Località: faenza(ra)
Distribuzione: Ubuntu 12.04--mini.iso
Desktop: gnome(cubo!!!)

Re: Conky & conkyForecast [2°Parte]

Messaggioda pier_blackhawk » mercoledì 8 febbraio 2012, 21:31

OK, grazie.
Con solo due colonne:
Immagine
Con tre colonne "disordinate":
Immagine
Think, McFly! Think!
pier_blackhawk
Prode Principiante
 
Messaggi: 84
Iscrizione: gennaio 2010

Re: Conky & conkyForecast [2°Parte]

Messaggioda woddy68 » mercoledì 8 febbraio 2012, 22:26

Bello! Ma io non ci ho mai capito una mazza di come configurare Conky >:(, però è bello, piacerebbe anche a me!
Desktop acer aspire M5500 -  UBUNTU 12..04 Lts UNITY FOR EVER!!!
Acer aspire 5670 - Ubuntu 12.04 Lts - UNITY THE BEST SHELL!!!!
Asus Eee1011PX - UBUNTU 12.04 Lts - UNITY !!!
Avatar utente
woddy68
Entusiasta Emergente
Entusiasta Emergente
 
Messaggi: 1063
Iscrizione: febbraio 2011

Re: Conky & conkyForecast [2°Parte]

Messaggioda Diabolik62 » mercoledì 8 febbraio 2012, 22:33

;D
Codice: Seleziona tutto
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,0.2,1,1,1)
    cairo_stroke(cr)


http://cairographics.org/samples/

Codice: Seleziona tutto
Il metodo cairo_set_source_rgb, che è fornito dalla libreria grafica 2D Cairo , prende un contesto di cairo e tre doppie, come gli argomenti per impostare il colore del widget di rgb. Il problema è che questi tre numeri sono puri rgb livelli dei canali (0-255), come la maggior parte dei programmi di grafica trattare.
Ogni colore è rappresentato da un valore 0-1 frazionario.
Ad esempio, per ottenere il colore verde a livello 78 (0-255), sarebbe

cairo_set_source_rgb (cr, 0, 0,30, 0);

Qualora il 0,30 proviene da dividere 78 per 255.
Quindi, per ottenere il livello di colore per l'uso in cairo chiama come quello sopra, basta dividere il livello corrispondente (0-255) per 255. A due cifre di precisione sarebbe sufficiente.
Ultima modifica di Anonymous il mercoledì 8 febbraio 2012, 22:52, modificato 1 volta in totale.
Diabolik62
Tenace Tecnocrate
Tenace Tecnocrate
 
Messaggi: 12267
Iscrizione: dicembre 2009

Re: Conky & conkyForecast [2°Parte]

Messaggioda angelico937 » giovedì 9 febbraio 2012, 15:52

ciao,
è molto interesante, ma non esiste un tool che permette di modificare le impostazioni senza impazzire con i  codici?
ciao
angelico
angelico937
Scoppiettante Seguace
Scoppiettante Seguace
 
Messaggi: 254
Iscrizione: novembre 2007

Re: Conky & conkyForecast [2°Parte]

Messaggioda knoxtnm » giovedì 9 febbraio 2012, 16:50

salve a tutti....
qualcuno sa come allineare in centro il mio conkypanel?
ho provato a scrivere top_center ma me lo sposta in basso... :-\
grazie mille...posto anche l'rc..

Immagine


Codice: Seleziona tutto
#avoid flicker
double_buffer yes

#own window to run simultanious 2 or more conkys
own_window  yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager

#borders
draw_borders no
border_margin 0

#shades
draw_shades no

#position
gap_x 0
gap_y 0
alignment top_right

#behaviour
update_interval 1

#colour
default_color  8f8f8f
#default_shade_color 000000
own_window_colour 262729

#font
use_xft yes
xftfont sans:size=7

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

#to prevent window from moving
use_spacer none
minimum_size 1024 0

#mpd
#mpd_host localhost
#mpd_port 6600

TEXT
${alignc}Date: ${color e0e0e0}${time %d/%m/%y}${color}  Time: ${color e0e0e0}${time %H:%M}${color}  |  Kernel: ${color e0e0e0}$kernel${color}  Uptime: ${color e0e0e0}${uptime_short}${color}  |  Cpu0: ${color e0e0e0}${cpu}%${color}  Ram: ${color e0e0e0}${memperc}%${color}  Swap: ${color e0e0e0}${swapperc}%${color}  Disk: ${color e0e0e0}${fs_used_perc /}%${color}  |  Motherboard: ${color e0e0e0}${execi 300 sensors | grep M/B | cut -c15-16 ;}°C${color}  Cpu: ${color e0e0e0}${execi 300 sensors | grep CPU | cut -c15-16 ;}°C${color}  Disk: ${color e0e0e0}${execi 300 nc localhost 7634 | cut -c29-30 ;}°C${color}  |  ${if_existing /proc/net/route wlan0}Signal: ${color e0e0e0}${wireless_link_qual wlan0}%${color}  Up: ${color e0e0e0}${upspeed wlan0} kb/s${color}  Down: ${color e0e0e0}${downspeed wlan0} kb/s${color}${else}${if_existing /proc/net/route eth0}Up: ${color e0e0e0}${upspeed eth0} kb/s${color}  Down: ${color e0e0e0}${downspeed eth0} kb/s${color}${endif}${else}Network Unavailable${endif}${alignc}
ubuntu 10.10.
Avatar utente
knoxtnm
Prode Principiante
 
Messaggi: 88
Iscrizione: maggio 2011
Località: Torino

Successiva

Torna a Bar Ubuntu

Chi c’è in linea

Visualizzano questa pagina: zakunin e 7 ospiti