Перейти к содержимому





- - - - -

Добавил состояние погоды в моем городе

Опубликовал: intelfan, 10 Май 2008 · 457 Просмотров

1) установил curl.
2) написал (скопипастил и доработал напильником) скрипт weather.sh. Засунул его в ~/.conky/
#!/usr/bin/perl
if($fc = `curl -s http://informer.gismeteo.ru/text/36177-1.JS | iconv -f CP1251 -t UTF-8`){
my $a = substr($fc,372);
my @vars=split(/</, $a);
foreach $v (@vars){
my ($x,$z)=split(/>/, $v);
if ((defined($z))and($z ne '')){push(@res,$z);}}
my $city=$res[0];
my $date=$res[1];
my $sky=$res[2];
my $prec=$res[3];
my $temp=$res[4];
my $wind=$res[5];
print "Погода в г. $city: \n $temp, $sky, $prec; \n Ветер: $wind\n";}
3) добавил в conky.rc
${color #5b6dad}${execi 10 /home/zhomart/.conky/weather.sh RSXX0091}

Окончательный вид коньков:
Изображение

conky.rc

alignment top_right
background yes
border_width 1
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
double_buffer yes
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
gap_x 25
gap_y 40
maximum_width 350
max_port_monitor_connections 10
max_specials 512
max_user_text 16384
minimum_size 350 10
net_avg_samples 2
no_buffers yes
out_to_console no
wm_class_name Conky
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type override
own_window yes
stippled_borders 2
update_interval 2
uppercase no
use_spacer yes
use_xft yes
xftalpha 0.8
xftfont Terminus:size=9
override_utf8_locale yes

# stuff after 'TEXT' will be formatted on screen

TEXT
${color #000000}System: ${color #3d2ce3}linux-$kernel${alignr}
${color #000000}Uptime:${color #3d2ce3} $uptime
${color #000000}CPU Usage:${color #3d2ce3} $cpu% ${cpubar}
${color #000000}RAM Usage:${color #3d2ce3} $mem/$memmax - $memperc% ${membar}
${color #000000}Swap Usage:${color #3d2ce3} $swap/$swapmax - $swapperc% ${swapbar}
${color #000000}Core1 temp = ${color #3d2ce3}${execi 10 sensors | grep 'Core 0' | cut -b15-16} °C
${color #000000}Core2 temp = ${color #3d2ce3}${execi 10 sensors | grep 'Core 1' | cut -b15-16} °C
${color #000000}Aux temp = ${color #3d2ce3}${execi 10 sensors | grep 'temp1' | cut -b15-16} °C
${color #000000}Mb temp = ${color #3d2ce3}${execi 10 sensors | grep 'temp3' | cut -b15-16} °C
${color #000000}Температура HDD = ${color #3d2ce3}${execi 10  netcat localhost 7634 | cut -b23-24} °C

${color #000000}TCP Connections: ${color #3d2ce3}${tcp_portmon 1 65535 count}
${color #000000}Down:${color #3d2ce3} ${downspeed eth0} k/s${color #000000}	 Up:${color #3d2ce3} ${upspeed eth0} k/s
${color #000000}Down: ${color #3d2ce3} ${totaldown eth0} ${color #000000} Up: ${color #3d2ce3} ${totalup eth0}

${color #000000}Filesystem
Root: ${alignr}${fs_free /} + ${fs_used /} = ${fs_size /}
${color #3d2ce3}${fs_bar 4 /}
${color #000000}Home: ${alignr}${fs_free /home/zhomart} + ${fs_used /home/zhomart} = ${fs_size /home/zhomart}
${color #3d2ce3}${fs_bar 4 /home/zhomart}
${color #000000}80Gb:${alignr}${fs_free /media/80Gb} + ${fs_used /media/80Gb} = ${fs_size /media/80Gb}
${color #3d2ce3}${fs_bar 4 /media/80Gb}

${color #000000}${execi 600 /home/zhomart/.conky/weather.sh RSXX0091}


  • 0



X

Размещение рекламы на сайте     Предложения о сотрудничестве     Служба поддержки пользователей

© 2011-2017 vse.kz. При любом использовании материалов Форума ссылка на vse.kz обязательна.