Ultimo aggiornamento 20 novembre 2011 H.21:56
Per avere il meteo nel conky dovete fare questo procedimento:
Codice: Seleziona tutto
sudo add-apt-repository ppa:conky-companions/ppa
sudo apt-get update && sudo apt-get install conkyforecast
Codice: Seleziona tutto
cp /usr/share/conkyforecast/conkyForecast.config ~/.conkyForecast.config
gedit ~/.conkyForecast.config
#===============================================#
# USER SETTINGS, EDIT BASED ON DOCUMENTED SETUP #
#===============================================#
# config settings for conkyForecast.py
CACHE_FOLDERPATH = /tmp/
CONNECTION_TIMEOUT = 5
EXPIRY_MINUTES = 30
TIME_FORMAT = %H:%M
DATE_FORMAT = %Y-%m-%d
LOCALE = it
XOAP_LICENCE_KEY =
MAXIMUM_DAYS_FORECAST = 4
BASE_XOAP_URL = http://xml.weather.com/weather/local/?cc=*&dayf=5&link=xoap&prod=xoap&key=&unit=m
Per il codice bisogna registrarsi di nuovo presso:
http://portal.theweatherchannel.com/index.aspx
---->Ora aprite il terminale, e lanciate questo comando::
Codice: Seleziona tutto
sudo gedit /usr/share/conkyforecast/conkyForecast.config
---->1°Conky (questo conky utilizza il file moon.template)
Ora dovrete creare VOI un nuovo file di testo, nella VOSTRA home, e rinominarlo .conkyrc (occhio al punto) poi ci incollate dentro questo:
Codice: Seleziona tutto
# — SETTINGS — #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
double_buffer yes
no_buffers yes
text_buffer_size 1920
#imlib_cache_size 0
total_run_times 0
use_spacer none
# — WINDOW — #
#own_window_colour 2b2928
own_window yes
own_window_type override
own_window_transparent yes
#own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# — BORDER — #
#border_inner_margin 1
#border_outer_margin 0
# — SIZE — #
minimum_size 250
maximum_width 250
# — ALIGNMENT — #
alignment top_right
gap_x 8
gap_y 40
# — GRAPHIC — #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# — TEXT — #
use_xft yes
xftfont ZeKton:size=12:style=bold
xftalpha 0.8
uppercase no
override_utf8_locale yes
default_color 707070
TEXT
${color 707070}
${font Casper Comics Solid:size=20}${alignc}Varese Meteo
${font Paintbrush:size=12}${goto 20}${execi 1800 conkyForecast --datatype=CT}
${goto 10}${font Conky:size=38}w${font}${font Paintbrush:size=18}${voffset -20}${execi 500 /usr/bin/conkyForecast --datatype=HT}
${goto 10}${voffset 20}${font Paintbrush:size=8}${execi 500 conkyForecast --datatype=MP}${font Paintbrush:size=8}
${goto 140}Alba. ${execi 500 /usr/bin/conkyForecast --datatype=SR}
${goto 140}Tram. ${execi 500 /usr/bin/conkyForecast --datatype=SS}
${goto 140}Min. ${execi 1680 conkyForecast --datatype=LT --startday=1}
${goto 140}Max. ${execi 1680 conkyForecast --datatype=HT --startday=1}
${goto 140}Umidità. ${execi 500 /usr/bin/conkyForecast --datatype=HM}
${goto 140}Vento. ${execpi 900 conkyForecast --datatype=WS}
${goto 10}Visib. ${execpi 900 conkyForecast --datatype=VI}
${goto 10}Precipit. ${execpi 900 conkyForecast --datatype=PC --startday=0}
${goto 10}Uv. ${execpi 900 conkyForecast --datatype=UI} - ${execpi 900 conkyForecast --datatype=UT}
${goto 10}Feels like. ${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/deegan/moon.template}$font
${voffset -160}${font Paintbrush:size=8}
${goto 10}Domani. ${execi 1800 conkyForecast --datatype=DW --startday=1 --shortweekday}. ${execi 500 /usr/bin/conkyForecast --startday=1 --datatype=HT}
${goto 10}${execi 600 conkyForecast --startday=1 --datatype=CT}
Codice: Seleziona tutto
${execpi 1800 conkyForecast --template=/home/deegan/moon.template}
Quindi, se il moon.template lo create nella vostra home, la vostra stringa sarà così::
${execpi 1800 conkyForecast --template=/home/VOSTRO NOME/moon.template}
Questa stringa serve per andare a richiamare il prossimo file che creeremo::
---->Nella vostra home create un file di testo, e rinominatelo moon.template
E al suo interno incollateci quello che vi interessa, per esempio questo:
Codice: Seleziona tutto
${font Paintbrush:size=10}
${image [--datatype=WI] -p 120,60 -s 100x100}
${image [--datatype=MI] -p 10,180 -s 75x75}
${voffset -113}${goto 140}${font ConkyWindNESW:style=Bold:size=47}${execi 600 conkyForecast --datatype=BS}
${image [--datatype=WI --startday=1] -p 140,355 -s 55x55}
Codice: Seleziona tutto
conky
PS::*
Per avere i miei stessi font dovete scaricarli, altrimenti mettetene uno dei vostri.
Qui trovate il font, Conky
---->Setup dei conky all'avvio
Ora creiamo uno script per far partire il conky all'avvio. Quindi crea un file nella tua home chiamato "conkystart.sh" ed incollaci il seguente codice:
Codice: Seleziona tutto
#!/bin/sh
sleep 10s
conky
exit
Codice: Seleziona tutto
chmod +x conkystart.sh
* * * Nome: Conkystart
* * Comando: ./conkystart.sh
* Commento: script per far partire i conky all'avvio.
Fatto questo prova a riavviare e vedere se il conky parte all'avvio!
---->Killare un solo conky
Se sul desk avete più conky attivi, e volete killarne solo uno, ES: .conkyrc2
Date in un terminale::
Codice: Seleziona tutto
kill $(ps -C 'conky' -o pid,cmd | awk '/.conkyrc2/ {print $1}')
${goto}, ${offset} & ${voffset}
---->Qui ho raccolto un paio di codici che potete inserire nel vostro conky.
Modificateli se necessario in base al vostro pc.
Codice: Seleziona tutto
Raccolta di Stringhe da inserire nel vostro CONKY.
##-===========##-
${pre_exec whoami} @ $nodename
$sysname
${pre_exec cat /etc/issue.net}
$machine
Kernel. $kernel
##-===========
Gnome Desktop. ${pre_exec gnome-about --gnome-version | head -n 1 | awk '{print $2}'}
Conky. ${conky_version} Hardcore!! ${conky_build_arch}
##-===========
${execpi 60 DJS=`date +%_d`; cal | sed '/./!d' | sed '1d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color red}'"$DJS"'${color 707070}'" "/}
##-===========
${image /home/大枝西長町/loghi/ubuntu-logo2.png -p 85,50 -s 100x100}
##-===========
Cestino. ${execi 60 du -sh ~/.local/share/Trash/files/ | awk '{print $1}' | sed '/^4.0K/ d' | sed 's/$/ /'}
##-===========
${execpi 3600 w3m -dump 'http://weather.yahoo.com/italy/lombardy/-12844698/'|grep -A10 'How to Read This'|tr -s '\n*' ' #'|sed -e 's/ //' -e 's/ /\n/g'|head -4|fold -sw 55|sed 's/^[^:]*:/&/'}
##-===========
Xorg. ${execi 8 cat /var/log/Xorg.0.log | grep "X.Org X Server " | tail -c+16}
Cpu fan speed. ${hwmon fan 1} RPM
Cpu fan speed. ${hwmon fan 2} RPM
CpT. ${hwmon temp 1}°C
ACPI temp. ${acpitemp}°C
${execi 8 aticonfig --odgt | grep 'Sensor' | cut -c43-47 | sed '/^$/d'}°C
HD Temp. ${hddtemp /dev/sda}°
Mobo. ${execi 20 sensors | grep "MB Temperature" | cut -d "+" -f2 | cut -c1-7 }
${if_mounted /media/ArchLinux} ArchLinux. ${fs_used_perc /media/ArchLinux}%$endif
Sda. ${diskio_read /dev/sda} ${diskiograph 13,80 A9A9A9 707070 -t -l}
Sda. ${diskio_write /dev/sda}
Desktop. ${desktop_number}
Uptime. ${uptime}
UpTime. ${uptime_short} ${loadavg}
Cache. $cached - $buffers
Run. $running_processes
Proc. $processes
SWAP usage. $swapperc%
Mem. $mem / $memperc% - $memmax - ${top_mem name 1} - ${top_mem mem_res 1} - ${membar 8,60}
Cpugraph. ${cpugraph cpu0 12,40} OPPURE ${cpugraph cccccc ffffff}
${execi 99999 cat /proc/cpuinfo | grep "model name" -m1 | cut -d":" -f2 | cut -d" " -f2- | sed 's#Processor ##'}
Freq:$color ${execi 20 sensors |grep "Core0 Temp" | cut -d" " -f4}
Batteria. ${battery_percent BAT1}% ${alignr}${battery_bar 10,60 BAT1} --Controllate che la vostra batteria sia BAT1/OPPURE BAT0 (BATzero)
Carica/Scarica: ${acpiacadapter} -- ${battery_time BAT1}
-- Highest CPU $alignr CPU% MEM%
${hr 1}
${top name 1}$alignr${top cpu 1}${top mem 1}
${top name 2}$alignr${top cpu 2}${top mem 2}
${top name 3}$alignr${top cpu 3}${top mem 3}
-- Highest MEM $alignr CPU% MEM%
${hr 1}
${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}
--Filesystem
${hr 1}
Root. ${alignr}${fs_free /} / ${fs_size /}
${fs_bar 4 /}
Home. ${alignr}${fs_free /home} / ${fs_size /home}
${fs_bar 4 /home}
Sdb1. ${fs_used_perc /media/sdb1}% ${fs_bar 8,35 /media/sdb1}
##-=========== Qui la la temperatura della Cpu cambia colore con l'aumentare della temperatura.
CPU ${if_match ${cpu cpu0}<=10}${color A9A9A9}${cpu cpu0}%${endif}${if_match ${cpu cpu0}>=11}${if_match ${cpu cpu0}<=20}${color d4fffc} ${cpu cpu0}%${endif}${endif}${if_match ${cpu cpu0}>=21}${if_match ${cpu cpu0}<=30}${color 72f0ff} ${cpu cpu0}%${endif}${endif}${if_match ${cpu cpu0}>=31}${if_match ${cpu cpu0}<=40}${color 78ffda} ${cpu cpu0}%${endif}${endif}${if_match ${cpu cpu0}>=41}${if_match ${cpu cpu0}<=50}${color 6cff92} ${cpu cpu0}%${endif}${endif}${if_match ${cpu cpu0}>=51}${if_match ${cpu cpu0}<=60}${color d6f681} ${cpu cpu0}%${endif}${endif}${if_match ${cpu cpu0}>=61}${if_match ${cpu cpu0}<=70}${color feff90} ${cpu cpu0}%${endif}${endif}${if_match ${cpu cpu0}>=71}${if_match ${cpu cpu0}<=80}${color ffdd3c} ${cpu cpu0}%${endif}${endif}${if_match ${cpu cpu0}>=81}${if_match ${cpu cpu0}<=89}${color e58f20} ${cpu cpu0}%${endif}${endif} ${if_match ${cpu cpu0}>=90}${color d51717}${cpu cpu0}%${endif}
##-===========
Schermo.
${alignc}${pre_exec xrandr | grep '*' | sed -e 's/*+//' -e 's/^\s*//g' -e 's/\s*$//g' -e 's/\s\s*/, /g' -e 's/\,\ \([0-9]*\)\.[0-9]/ px, \1 Hz/'}
${freq_g 1}+${freq_g 2} GHz @
##-===========
Net. ${execpi 2 iwconfig wlan0 | line 1 | cut -c32-45}
Qualità. ${execpi 2 cat /sys/class/net/wlan0/wireless/link}%
Gateway. ${gw_ip}
Mode. ${wireless_mode wlan0}
Bitrate. ${wireless_bitrate wlan0}
Private IP. ${addr wlan0}
Public IP. ${execi 10 wget -O - -q icanhazip.com}
Ip. ${execi 3600 wget -O - http://whatismyip.org/ | tail}
Down. ${downspeed wlan0}kb/s ${downspeedgraph wlan0 13,70 ecedee 495056 -t}
Up. ${upspeed wlan0}kb/s ${upspeedgraph wlan0 13,70 ecedee 495056 -t}
Total Up. ${totalup eth0}
Total Down. ${totaldown eth0}
##-===========
Notifica Facebook.
${rss http://www.facebook.com/feeds/notifications.php?id=1519528109&viewer=1519528109&key=AQCPERugcVkxewyu&format=rss20 1 item_titles 10 }
##-===========
Time.${time %H.%M}
Date. ${time %d %b .%a}
${if_running qbittorrent}${alignc}Qbittorrent $endif
${if_running qbittorrent}${alignc}Sto' scaricando... $endif
${if_running qbittorrent} Up. ${upspeed eth0} Kb/s $endif
${if_running qbittorrent} Down. ${downspeed eth0} Kb/s $endif
-----
${if_running amule}Amule $endif
${if_running amule}Sto' scaricando... $endif
${if_running amule}Up. ${upspeed wlan0} Kb/s $endif
${if_running amule}Down. ${downspeed wlan0} Kb/s $endif
-----
${if_running amsn}Amsn $endif
${if_running amsn}Sto' scaricando... $endif
${if_running amsn}Up. ${upspeed wlan0} Kb/s $endif
${if_running amsn}Down. ${downspeed wlan0} Kb/s $endif
##-===========
--Cambio USD/EUR/GBP
-${execi 3600 wget -q -O - "http://www.google.com/finance/converter?a=100&from=USD&to=EUR"|grep "<div id=currency_converter_result>"|sed 's/<[^>]*>//g'}${alignr}${execi 3600 wget -q -O - "http://www.google.com/finance/converter?a=100&from=GBP&to=EUR"|grep "<div id=currency_converter_result>"|sed 's/<[^>]*>//g'}
-${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'}${alignr}${execi 3600 wget -q -O - "http://www.google.com/finance/converter?a=100&from=EUR&to=GBP"|grep "<div id=currency_converter_result>"|sed 's/<[^>]*>//g'}
##-===========
Alba. ${execi 500 /usr/bin/conkyForecast --location=ITXX0082 --datatype=SR}
Tramonto. ${execi 500 /usr/bin/conkyForecast --location=ITXX0082 --datatype=SS}
Min. ${execi 1680 conkyForecast --location=ITXX0082 --datatype=LT --startday=1}
Max. ${execi 1680 conkyForecast --location=ITXX0082 --datatype=HT --startday=1}
Humidità. ${execi 500 /usr/bin/conkyForecast --location=ITXX0082 --datatype=HM}
Temp. ${execi 500 /usr/bin/conkyForecast --location=ITXX0082 --datatype=HT}
Vento.${execpi 900 conkyForecast --location=ITXX0082 --datatype=WS}
Barom. ${execpi 900 conkyForecast --location=ITXX0082 --datatype=BD}
Visib. ${execpi 900 conkyForecast --location=ITXX0082 --datatype=VI}
Precipit. ${execpi 900 conkyForecast --location=ITXX0082 --datatype=PC --startday=0}
Città. ${execpi 900 conkyForecast --location=ITXX0082 --datatype=CN} -- ${execpi 900 conkyForecast --location=ITXX0082 --datatype=CO}
Luna. ${execi 500 conkyForecast --location=ITXX0082 --datatype=MP}
Updated. ${execpi 120 conkyForecast --location=ITXX0082 --datatype=LU}
Fetched. ${execpi 120 conkyForecast --location=ITXX0082 --datatype=LF}
Lat. ${execi 30 conkyLatLong | grep 'N' | awk '{print $1}'}
Long. ${execi 30 conkyLatLong | grep 'W' | awk '{print $3}'}
Lat - Long. ${exec python ~/.scripts/conkyLatLong.py} (Qui recuperate il file=conkyLatLong.py)
##-===========
${image [--datatype=WI --startday=1] -p 80,950 -s 70x70}${image [--datatype=WI --startday=2] -p 180,950 -s 70x70}${image [--datatype=WI --startday=3] -p 280,950 -s 70x70}
${voffset 40}${goto 80}${font Paintbrush:size=12}[--datatype=DW --shortweekday --startday=1]: [--datatype=HT --startday=1]${goto 180}[--datatype=DW --shortweekday --startday=2]: [--datatype=HT --startday=2]${goto 280}[--datatype=DW --shortweekday --startday=3]: [--datatype=HT --startday=3]
##-===========
Aggiornamenti. ${execi 1200 ~/.scripts/updates.sh}
Update. ${execi 10800 aptitude search "~U" | wc -l | tail}
##-===========
Master volume: ${mixer}
##-===========
Internet Information
-- Netstat..
${execi 30 netstat -ept | grep ESTAB | awk '{print $9}' | cut -d: -f1 | sort | uniq -c | sort -nr}
${execi 5 netstat -ept | grep ESTAB | awk '{print $1 " " $9}' | cut -d: -f1 | sort | uniq -c | sort -nr}
-- Apps del collegamento Internet..
${execi 2 netstat -lantp | grep -i establ | awk -F/ '{print $2}' | sort | uniq| sed '/^$/d' }
-- Connessioni stabilite..
${execi 2 netstat -pant 2> /dev/null | grep ESTA | awk '{print $5;}' | cut -d: -f1 | sort | uniq -c | sort -n | tail -6 | sed 's/^[ \t]*//'}
-- Collegamenti di rete attivi..
${execi 2 netstat -ant | awk '{print $NF}' | grep -v '[a-z]' | sort | uniq -c | sed 's/^[ \t]*//'}
##-===========
${execi 3600 espeak -ven-it "ciao deegan"}
##-===========
${execi 60 python ~/.scripts/conkyEmail.py --servertype=POP3 --servername=imapmail.libero.it --username=metalXXXXXX --password=XXXXXX}
##-===========
${if_running rhythmbox}
${font Impact:size=11}${alignc}Rhythmbox ${font Paintbrush:size=10}
${font DejaVu Sans:size=16}♫${font} ${font Astron Boy Video:style=Bold:pixelsize=12}Artist ~ ${offset 25}${exec rhythmbox-client --no-start --print-playing-format "%ta"}
${offset 10}Track. ~ ${exec rhythmbox-client --no-start --print-playing-format "%tt"}
${offset 30}${font Astron Boy Video:style=Bold:pixelsize=12}Album. ~ ${exec rhythmbox-client --no-start --print-playing-format "%at"}${alignr}${exec rhythmbox-client --no-start --print-playing-format "%te"}
${execibar 1 conkyRhythmbox --datatype=PP}
${else}
${alignc}Rhythmbox Closed
$endif
##-===========
OPPURE
${if_running rhythmbox}$alignc ${exec /usr/bin/rhythmbox-client --no-start --no-present --print-playing|cut -b -99}
${endif}
##-===========
${if_running banshee-1}Album. ~~ ${exec conkyBanshee --datatype=AR} $color1 $alignr ${execi 8 banshee-1 --query-position | cut -f2- -d" "} . ${execi 8 banshee-1 --query-duration | cut -f2- -d" "}
${exec cp "`conkyBanshee --datatype=CA | sed -e 's/\\\//g'`" /home/USER/.album}${image /home/USER/.album -p 210,1 -s 79x74}
${voffset 1}${execibar 2 conkyBanshee --datatype=PP}
${goto 25}${exec conkyBanshee --datatype=TI | cut -c -27}${alignr 25}${color1}${exec conkyBanshee --datatype=PT}$color1$font ${else}Banshee Out
##-===========
${if_mpd_playing}$mpd_artist $alignr MPD
$mpd_title $alignr $mpd_elapsed -- $mpd_length $endif MPD OUT
##-===========