Prosíme přihlašte se nebo zaregistrujte.

Přihlašte se svým uživatelským jménem a heslem.
Vaše pomoc je stále potřeba!

Autor Téma: Meteopress gadget  (Přečteno 1449 krát)

Bohetour

  • Návštěvník
  • Příspěvků: 52
Meteopress gadget
« kdy: 26 Března 2009, 16:14:53 »
Dnes jsem u kamose na Vistach videl  :o supr gadget na plochu. Jedna se o zobrazovani pocasi pres stranku meteopress (vic jak 80 mest v CR) - teplota, vitr atd.
Momentalne mam v gnome ten applet zpravy o pocasi, ktery mi ale ukazuje situaci v Brne, coz je dost daleko. Neslo by to nejak prekonfigurovat aby to tahalo informace z meteopress, nebo existuje jeste nejaka jina appletka do gnome?

Tady je odkaz na ten gadget:
http://www.studna.cz/9821/vzhled-pracovni-plochy/ruzne-utility-k-uprave-pracovni-plochy/meteopress-vista-gadget/

Tichus

  • Aktivní člen
  • *
  • Příspěvků: 107
Re: Meteopress gadget
« Odpověď #1 kdy: 26 Března 2009, 18:23:16 »

Bohetour

  • Návštěvník
  • Příspěvků: 52
Re: Meteopress gadget
« Odpověď #2 kdy: 27 Března 2009, 11:01:44 »
Dik moc  ;D

Honza-m

  • Návštěvník
  • Příspěvků: 76
    • damater.tym.cz
Re: Meteopress gadget
« Odpověď #3 kdy: 28 Března 2009, 19:33:55 »
Já to mám v conkách  :) . To je dle mně nejvychytaňejší věcička co můžeš mít. Až na to, že to není nic moc grafické :-D.

Kód: [Vybrat]
stippled_borders 0
border_margin 6
border_width 0

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

double_buffer yes

use_spacer none
use_xft yes

update_interval 1.0

draw_shades no

draw_outline no
draw_borders no

xftfont ae_AlMothnna:size=7

uppercase no

#default_color E6E7E8

alignment top_right

text_buffer_size 1600

gap_x 5
gap_y 35

TEXT
${color #7cfc00}${font StyleBats:size=16:weight=bold}H$font ${font ae_AlMothnna:size=12:weight=bold}${voffset -8}Systém$font
${color #7cfc00}${voffset -5}${hr 2}${color}
${color #E6E7E8}${cpugraph cpu0 40,260 484848 0066FF}
${color #7cfc00}${voffset -36}${font StyleBats:size=20}${goto 10}A$font ${font ae_AlMothnna:size=12:weight=bold}${voffset -10}CPU$font   ${color #E6E7E8}${font ae_AlMothnna:size=10}${voffset -5}${freq cpu1}MHz  ${font ae_AlMothnna:size=10:weight=bold}${acpitemp}°C$font


${color #E6E7E8}${goto 5}Využití procesoru: ${cpu}%${goto 124}${color #00FF66}${cpubar 8}$color
${color #E6E7E8}${goto 5}Využití RAM:${goto 95}$memperc%${goto 124}${color #00FF66}${membar 8}

${color #E6E7E8}${goto 5}Aktivních procesů:${goto 95}$running_processes ${alignr 2}${goto 124}Procesů celkem: $processes
$stippled_hr
${color #E6E7E8}${goto 5}${Font bauhaus:pixelsize=9:weight=bold}Jméno${goto 94}CPU%${goto 148}Jméno${goto 234}CPU%$font
${Font bauhaus:pixelsize=9}${color #E6E7E8}${goto 5}${top name 1}${goto 89}${top cpu 1}     ${goto 148}${top name 5}${goto 230}${top cpu 5}
${color #E6E7E8}${goto 5}${top name 2}${goto 89}${top cpu 2}     ${goto 148}${top name 6}${goto 230}${top cpu 6}
${color #E6E7E8}${goto 5}${top name 3}${goto 89}${top cpu 3}     ${goto 148}${top name 7}${goto 230}${top cpu 7}
${color #E6E7E8}${goto 5}${top name 4}${goto 89}${top cpu 4}     ${goto 148}${top name 8}${goto 230}${top cpu 8}$font

${color #7cfc00}${font StyleBats:size=16}J$font ${font ae_AlMothnna:size=12:weight=bold}${voffset -8}Harddisky$font
${color #7cfc00}${voffset -5}${hr 2}${color}
${goto 8}${color 0066FF}${fs_bar 20 /}${color}
${color E6E7E8}${goto 11}${voffset -21}${font ae_AlMothnna:size=8:weight=bold}root$font ${goto 50}(${fs_size /})${goto 160}${fs_free_perc /}%${goto 200}${fs_free /} free${voffset 2}
${goto 8}${color 0066FF}${fs_bar 20 /home}${color}
${color E6E7E8}${goto 11}${voffset -21}${font ae_AlMothnna:size=8:weight=bold}home$font ${goto 50}(${fs_size /home}${goto 160}${fs_free_perc /home}%${goto 200}${fs_free /home} free${voffset 2}

${color #7cfc00}${font BulletBalls AOE:size=16}i$font ${font ae_AlMothnna:size=12:weight=bold}${voffset -8}Síť$font
${color #7cfc00}${voffset -5}${hr 2}${color}
${color #E6E7E8}IP adresa: ${addr eth0}
${color #E6E7E8}${downspeedgraph eth0 30,127 131313 0066FF}${goto 140}${upspeedgraph eth0 30,127 141414 00FF66}
${voffset -31}${color #E6E7E8}${goto 10}Stahování: ${color #E6E7E8} ${downspeed eth0} ${color #E6E7E8} KiB/s ${goto 145}Odesílání: ${color #E6E7E8}${upspeed eth0}${color #E6E7E8} KiB/s
${color #E6E7E8}${goto 10}Celkem: ${totaldown eth0} ${goto 145}Celkem:  ${totalup eth0}

${color #7cfc00}${font weather:size=22:weight=bold}I$font ${font ae_AlMothnna:size=12:weight=bold}${voffset -11}${goto 30}Počasí$font
${color #7cfc00}${voffset -6}${hr 2}${color}
${color E6E7E8}${Font bauhaus:pixelsize=9}${execi 900 perl ~/.conky/weather.pl update_info EZXX0003 m 6}$color

               ${color #E6E7E8}${goto   5}${execi 900 perl ~/.conky/weather.pl temperature 1 0}${goto 55}${execi 900 perl ~/.conky/weather.pl temperature 2 0}${goto 105}${execi 900 perl ~/.conky/weather.pl temperature 3 0}${goto 155}${execi 900 perl ~/.conky/weather.pl temperature 4 0}${goto 205}${execi 900 perl ~/.conky/weather.pl temperature 5 0}$color
${color #E6E7E8}${voffset -116}${goto  180}${Font bauhaus:pixelsize=25}${execi 900 perl ~/.conky/weather.pl cc_temperature}$color
${color #00FF66}${voffset  -115}${goto  175}${Font weather:size=65}${execi 900 perl ~/.conky/weather.pl cc_symbol}$color
${color #7cfc00}${voffset  -26}${goto 120}${Font weather:size=30}${execi 900 perl ~/.conky/weather.pl cc_moon}$color
${color #7cfc00}${voffset   8}${goto   10}${execi 900 perl ~/.conky/weather.pl symbol 1 0}${goto 63}${color #00AAFF}${execi 900 perl ~/.conky/weather.pl symbol 2 0}${goto 113}${color #00FFFF}${execi 900 perl ~/.conky/weather.pl symbol 3 0}${goto 161}${color #00FFAA}${execi 900 perl ~/.conky/weather.pl symbol 4 0}${goto 210}${color #00FF66}${execi 900 perl ~/.conky/weather.pl symbol 5 0}$font$color
${color #E6E7E8}${voffset  -60}$stippled_hr$color






${color #7cfc00}${font StyleBats:size=16}P$font ${font ae_AlMothnna:size=12:weight=bold}${voffset -8}Datum a Čas$font
${color #7cfc00}${voffset -5}${hr 2}${color}

${color #E6E7E8}${font monospace:size=7}${execpi 3600 cal -m | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/  & /' -e 's/ \('`date | awk '{print $3}'`'\) /\ $\{color 0066FF\}'`date | awk '{print $3}'`'\$color /'}$font$color
${color #E6E7E8}${voffset -30}${goto 180}${Font bauhaus:pixelsize=17:weight=bold}${time %T}$Font$color
${color 00FF66}${voffset -70}${goto 200}${font StyleBats:size=40}P$font


Tohle je soubor ~/.conkyrc .
A tohle je soubor ~/.conky/weather.pl
Kód: [Vybrat]
#!/usr/bin/perl

use Switch;
use XML::Simple;

$action = $ARGV[0];

# parameters for "update_info"
$code = EZXX0003; # weather.com city code;
# see http://xoap.weather.com/search/search?where=%s where %s stands for your location
$units = $ARGV[2]; # s = standard/imperial, m = metric
$forecast = $ARGV[3]; # number of days for the forecast

# parameters for "symbol"
$day = $ARGV[1]; # day displayed
$day_part = $ARGV[2]; # 0 for day, 1 for night

# parameters for "temperature"
$day = $ARGV[1]; # day displayed

$day_space = "             "; # space between short day names in day_names_cz_short

$file = "/tmp/weather.xml"; # data file
$tempfile = "/tmp/weather.tmp"; # temporary download file
$directory = "~/.conky";

#====================================================================================

switch($action){
case "cc_symbol" {
&load_data;
print(&translate($weather->{cc}->{icon},2));
}
case "cc_temperature" {
&load_data;
print $weather->{cc}->{tmp}." ˚C";
}
case "cc_moon" {
&load_data;
print &translate($weather->{cc}->{moon}->{t},3);
}
case "symbol" {
&load_data;
print &translate($weather->{dayf}->{day}[$day]->{part}[$day_part]->{icon},2);
}
case "temperature" {
&load_data;
print $temperature_space.$weather->{dayf}->{day}[$day]->{hi}."/".$weather->{dayf}->{day}[$day]->{low}."˚C";
}
case "update_info"{
&update_load;
&info;
}
}

#====================================================================================

sub update_load {
if(-e $file ){ # File does exist
&load_data;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
split /\/|\s|\:/, $weather->{cc}->{lsup};
if ($_[3] == 12) {$_[3] = 0};
if ($_[5] eq "PM") {$_[3] += 12};
$update = !($_[0] == $mon + 1 && $_[1] == $mday && $_[2] == $year - 100 && $_[3] == $hour);
}
else {$update = TRUE};
if ($update) {
`wget -O $tempfile "http://xoap.weather.com/weather/local/$code?dayf=$forecast&unit=$units&cc=*"`;
if (-s $tempfile > 0) {
`mv -f $tempfile $file`;
&load_data
}
}
}

sub info {
split ",", $weather->{loc}->{dnam};
print "".$_[0]."\n";
split /\/|\s|\:/, $weather->{cc}->{lsup};
if ($_[3] == 12) {$_[3] = 0};
if ($_[5] eq "PM") {$_[3] += 12};
print "Aktualizováno v: ".$_[3].":".$_[4]."\n"
     ."Tlak: ".&translate($weather->{cc}->{bar}->{d},2)." ".$weather->{cc}->{bar}->{r}." hPa\n"
     ."Vítr: ".$weather->{cc}->{wind}->{s}." km/h  ".&translate($weather->{cc}->{wind}->{t},2)." (".$weather->{cc}->{wind}->{d}."˚)\n"
     ."Vlhkost: ".$weather->{cc}->{hmid}." \%\n"
     ."Rosný bod: ".$weather->{cc}->{dewp}." ˚C\n"
     ."Viditelnost: ".$weather->{cc}->{vis}." km\n"
     ."Východ: ".&time12_24($weather->{loc}->{sunr})."       Západ: ".&time12_24($weather->{loc}->{suns})."\n\n"
     ."Měsíc: ".&translate($weather->{cc}->{moon}->{t},2)."\n\n"
     ."   ".&day_names_cz_short(5)."\n\n\n";
}

sub load_data {
$xml = new XML::Simple;
$weather = $xml->XMLin($file);
}

sub time12_24 {
split /\:|\s/, $_[0];
if ($_[0] == 12) {$_[0] = 0};
if ($_[2] eq "PM") {$_[0] += 12};
return "$_[0]".":"."$_[1]";
}

sub day_names_cz_short {
# $_[0]; # number of days displayed, starting from the next day
my $text = &translate($weather->{dayf}->{day}[1]->{t},3);
for ($i = 2; $i < $_[0]+1; ++$i){
$text .= $day_space.&translate($weather->{dayf}->{day}[$i]->{t},3);
}
return $text;
}

sub translate {
#$_[0] String to be translated
#$_[1] Column with translation
my $temp = `cat $directory/weather.pl | grep -x "#\\s*$_[0]\\s*#.*\n"`;
if ($temp eq ""){return $_[0]}
else {return (split /\s*#\s*|\s*\n/,$temp)[$_[1]]};
}

######################################
#                                    #
#       TRANSLATION TABLES           #
#                                    #
######################################

# DAYS

# Monday # Pondělí # Po
# Tuesday # Úterý # Út
# Wednesday # Středa # St
# Thursday # Čtvrtek # Čt
# Friday # Pátek # Pá
# Saturday # Sobota # So
# Sunday # Neděle # Ne

# WINDS

# N # S
# E # V
# S # J
# W # Z
# NE # SV
# SE # JV
# SW # JZ
# NW # SZ
# NNE # SSV
# ENE # VSV
# ESE # VJV
# SSE # JJV
# NNW # SSZ
# WNW # ZSZ
# WSW # ZJZ
# SSW # JJZ

# CONDITIONS

# Mostly Sunny # a
# Mostly Clear # a
# Fair # b
# Partly Cloudy # c
# Clouds Early / Clearing Late # c
# Mostly Cloudy # d
# Cloudy # d
# Light Rain Early # g
# Few Showers # g
# Showers # g
# Light Rain # g
# PM Light Rain # g
# Rain # h
# Rain / Wind # h
# Rain / Snow # k
# Rain / Snow Showers # k
# Light Snow # k
# PM Light Snow # k
# Scattered T-Storms # f
# N/A
# Fair and Windy

# LUNAR PHASES
# Codes are for a white font.
# New # Nov # 9
# Waxing Crescent # Dorůstající srpek # 7
# First Quarter # První čtvrť # 0
# Waxing Gibbous # Dorůstající měsíc # 3
# Full # Úplněk # 1
# Waning Gibbous # Couvající měsíc # 3 # (left <-> right)
# Last Quarter # Poslední čvrť # 0 # (left <-> right)
# Third Quarter # Poslední čvrť # 0 # (left <-> right)
# Waning Crescent # Ubývající srpek # 7 # (left <-> right)

# PREASURE

# rising # ↑
# falling # ↓
# steady # =

# ICONS

# 0 # i
# 1 # h
# 2 # h
# 3 # i
# 4 # i
# 5 # k
# 6 # h
# 7 # k
# 8 # g
# 9 # g
# 10 # h
# 11 # g
# 12 # h
# 13 # j
# 14 # k
# 15 # j
# 16 # k
# 17 # i
# 18 # h
# 19 # v # dust
# 20 # v # fog
# 21 # v # haze
# 22 # v # smoke
# 23 # w
# 24 # w
# 25 # j
# 26 # d
# 27 # d
# 28 # c
# 29 # b
# 30 # b
# 31 # 1
# 32 # a
# 33 # 1
# 34 # b
# 35 # i
# 36 # l
# 37 # f
# 38 # f
# 39 # h
# 40 # h
# 41 # k
# 42 # k
# 43 # k
# 44 # b
# 45 # h
# 46 # k
# 47 # g
# na # ~

Stačí jen ~/.conkyrc a ~/.conky/weather.pl nastavit zpustitelný příznak, a pak jen terminál
Kód: [Vybrat]
conky
:-D
Díky za radu :) každý potřebuje (někdy) pomoc :)  :cool:

 

Provoz zaštiťuje spolek OpenAlt.