Линукс

Конфигурация на Conky!

Print
User Rating:  / 25
PoorBest 

Здравейте, искам да споделя моя опит и мойта конфигурация на конки, извинете ме ако Ви се стори че обяснявам елементарно, но искам да съм разбираем, за всички, най-вече за начинаещите!

Като приключим, резултатът трябва да е този:


 

 

Нужни пакети:

  • conky-all
  • conkyforecast
  • conkyrhythmbox
  • hddtemp
  • lm-sensors

 

Всичко го има в Synaptic, може би само conkyforecast (това показва времето) няма да го има, но може да го свалите от тук, или да отворите терминал (Програми>>Помощни програми>>Терминал, ако сте с нещо различно то бг локализирано убунту с графична среда гном и пътя е някакъв друг, натиснете alt+F2 и в прозорчето пишете gnome-terminal и натискате ентер) и поставете:

 

sudo add-apt-repository ppa:conky-companions/ppa

sudo apt-get update

sudo apt-get install conkyforecast


Сега трябва да го конфигурираме. В домашната си папка създаваме файл .conkyForecast.config (упс, изчезна... натиснете Ctrl+h за да се видят скритите файлове) отваряме го с текстов редактор (ако не знаете къде стои или кой е, alt+f2 и пишете gedit, ако сте с графична среда kde пишете kate) и поставяме:

 

# config settings for conkyForecast.py
CACHE_FOLDERPATH = /tmp/
CONNECTION_TIMEOUT = 5
EXPIRY_MINUTES = 30
TIME_FORMAT = %H:%M
DATE_FORMAT = %Y-%m-%d
LOCALE = bg
XOAP_PARTNER_ID = 1156928576
XOAP_LICENCE_KEY = 6799af26c5e47ece
MAXIMUM_DAYS_FORECAST = 7
BASE_XOAP_URL = http://xml.weather.com/weather/local/?cc=*&dayf=10&link=xoap&prod=xoap&par=&key=&unit=m

 

Запазваме промените и правим файла изпълним, цъкаме с десен бутон, избираме права и слагаме отметки така:

 

или в теминал пишем:

 

sudo chmod 777 ~/.conkyforecast.config


Следва да създадем папка scripts в нашатата домашна папка, в нея ще направим един скриптов файл за времето и един за пощата, но първо времето... В новата папка си правим файл weather-7.template, отваряме си го с текстов редактор и вътре поставяме:

 

${image [--datatype=WI] -p -1,635 -s 90x90}
${voffset -175}${goto 15}${color #F3F5F3}[--datatype=DW --startday=1 --shortweekday].${goto 75}[--datatype=DW --startday=2 --shortweekday].${goto 135}[--datatype=DW --startday=3 --shortweekday].${goto 195}[--datatype=DW --startday=4 --shortweekday].
${voffset 42}${goto 5}${font Sans:size=8:weight=bold}${color #F3F5F3}[--datatype=HT --startday=1 --hideunits --centeredwidth=1]/[--datatype=LT --startday=1 --hideunits --centeredwidth=1]${goto 65}[--datatype=HT --startday=2 --hideunits --centeredwidth=1]/[--datatype=LT --startday=2 --hideunits --centeredwidth=1]${goto 125}[--datatype=HT --startday=3 --hideunits --centeredwidth=1]/[--datatype=LT --startday=3 --hideunits --centeredwidth=1]${goto 185}[--datatype=HT --startday=4 --hideunits --centeredwidth=1]/[--datatype=LT --startday=4 --hideunits --centeredwidth=1]
${image [--datatype=WI --startday=1] -p 0,755 -s 40x40}${image [--datatype=WI --startday=2] -p 60,755 -s 40x40}${image [--datatype=WI --startday=3] -p 120,755 -s 40x40}${image [--datatype=WI --startday=4] -p 180,755 -s 40x40}

 

Запазваме промените. Малко пояснение, можем да местим иконките по десктопа като променяме цифрите след -p първото число е хоризантала, второто по вертикала, символа -s е за размера на иконката. Текста по хоризонтал се регулира от числото след goto a по вертикал от числото след voffset. Сега да създадем скрипт за пощата, правим нов празен файл, който кръщаваме gmail.pl, отваряме го с текстов редактор и поставяме:

 

#!/usr/bin/perl
use Switch;
use Text::Wrap;
my $what=$ARGV[0];
$user=Име; #username for gmail account without qoutes
$pass=Парола; #password for gmail account without qoutes
$file="/tmp/gmail.html"; #temporary file to store gmail
#wrap format for subject
$Text::Wrap::columns=65; #Number of columns to wrap subject at
$initial_tab=""; #Tab for first line of subject
$subsequent_tab="\t"; #tab for wrapped lines
$quote="\""; #put quotes around subject
#limit the number of emails to be displayed
$emails=4; #if -1 display all emails
&passwd; #give password the proper url character encoding
switch($what){ #determine what the user wants
case "n" {&gmail; print "$new\n";} #print number of new emails
case "s" { #print $from and $subj for new email
&gmail;
if ($new>0){
my $size=@from;
if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
for(my $i=0; $i<$size; ++$i){
print "From: $from[$i]\n"; #print from line
$text=$quote.$subj[$i].$quote."\n";
print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
}
$size=@from;
if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
}
}
case "e" { #print number of new emails, $from, and $subj
&gmail;
if($new==0){print "Няма нови писма.\n";}
else{
print "Има $new писмо/а.\n";
my $size=@from;
if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
for(my $i=0; $i<$size; ++$i){
print "From: $from[$i]\n"; #print from line
$text=$quote.$subj[$i].$quote;
print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
}
$size=@from;
if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
}
}
else {
print "Usage Error: gmail.pl <option>\n";
print "\tn displays number of new emails\n";
print "\ts displays from line and subject line for each new email.\n";
print "\te displays the number of new emails and from line plus \n";
print "\t\tsubject line for each new email.\n";
} #didn't give proper option
}
sub gmail{
if(!(-e $file)){ #create file if it does not exists
`touch $file`;
}
#get new emails
`wget -O - https://$user:$pass\@mail.google.com/mail/feed/atom --no-check-certificate> $file`;
open(IN, $file); #open $file
my $i=0; #initialize count
$new=0; #initialize new emails to 0
my $flag=0;
while(<IN>){ #cycle through $file
if(/<entry>/){$flag=1;}
elsif(/<fullcount>(\d+)<\/fullcount>/){$new=$1;} #grab number of new emails
elsif($flag==1){
if(/<title>.+<\/title>/){push(@subj, &msg);} #grab new email titles
elsif(/<name>(.+)<\/name>/){push(@from, $1); $flag=0;} #grab new email from lines
}
}
close(IN); #close $file
}
sub passwd{ #change to url escape codes in password
#URL ESCAPE CODES
$_=$pass;
s/\%/\%25/g;
s/\#/\%23/g;
s/\$/\%24/g;
s/\&/\%26/g;
s/\//\%2F/g;
s/\:/\%3A/g;
s/\;/\%3B/g;
s/\</\%3C/g;
s/\=/\%3D/g;
s/\>/\%3E/g;
s/\?/\%3F/g;
s/\@/\%40/g;
s/\[/\%5B/g;
s/\\/\%5C/g;
s/\]/\%5D/g;
s/\^/\%5E/g;
s/\`/\%60/g;
s/\{/\%7B/g;
s/\|/\%7C/g;
s/\}/\%7D/g;
s/\~/\%7E/g;
$pass=$_;
}
sub msg{
#THE HTML CODED CHARACTER SET [ISO-8859-1]
chomp; s/<title>(.+)<\/title>/$1/; #get just the subject
#now replace any special characters
s/\&\#33\;/!/g;        #Exclamation mark
s/\&\#34\;/"/g; s/\&quot\;/"/g;      #Quotation mark
s/\&\#35\;/#/g;        #Number sign
s/\&\#36\;/\$/g;        #Dollar sign
s/\&\#37\;/%/g;        #Percent sign
s/\&\#38\;/&/g; s/\&amp\;/&/g;        #Ampersand
s/\&\#39\;/'/g;        #Apostrophe
s/\&\#40\;/(/g;        #Left parenthesis
s/\&\#41\;/)/g;        #Right parenthesis
s/\&\#42\;/*/g;        #Asterisk
s/\&\#43\;/+/g;        #Plus sign
s/\&\#44\;/,/g;        #Comma
s/\&\#45\;/-/g;        #Hyphen
s/\&\#46\;/./g;        #Period (fullstop)
s/\&\#47\;/\//g;        #Solidus (slash)
s/\&\#58\;/:/g;        #Colon
s/\&\#59\;/\;/g;        #Semi-colon
s/\&\#60\;/</g; s/\&lt\;/</g;        #Less than
s/\&\#61\;/=/g;        #Equals sign
s/\&\#62\;/>/g; s/\&gt\;/>/g;        #Greater than
s/\&\#63\;/\?/g;        #Question mark
s/\&\#64\;/\@/g;        #Commercial at
s/\&\#91\;/\[/g;        #Left square bracket
s/\&\#92\;/\\/g;        #Reverse solidus (backslash)
s/\&\#93\;/\]/g;        #Right square bracket
s/\&\#94\;/\^/g;        #Caret
s/\&\#95\;/_/g;        #Horizontal bar (underscore)
s/\&\#96\;/\`/g;        #Acute accent
s/\&\#123\;/\{/g;        #Left curly brace
s/\&\#124\;/|/g;        #Vertical bar
s/\&\#125\;/\}/g;        #Right curly brace
s/\&\#126\;/~/g;        #Tilde
s/\&\#161\;/¡/g;        #Inverted exclamation
s/\&\#162\;/¢/g;        #Cent sign
s/\&\#163\;/£/g;        #Pound sterling
s/\&\#164\;/¤/g;        #General currency sign
s/\&\#165\;/¥/g;        #Yen sign
s/\&\#166\;/¦/g;        #Broken vertical bar
s/\&\#167\;/§/g;        #Section sign
s/\&\#168\;/¨/g;        #Umlaut (dieresis)
s/\&\#169\;/©/g; s/\&copy\;/©/g;        #Copyright
s/\&\#170\;/ª/g;        #Feminine ordinal
s/\&\#171\;/«/g;        #Left angle quote, guillemotleft
s/\&\#172\;/¬/g;        #Not sign
s/\&\#174\;/®/g;        #Registered trademark
s/\&\#175\;/¯/g;        #Macron accent
s/\&\#176\;/°/g;        #Degree sign
s/\&\#177\;/±/g;        #Plus or minus
s/\&\#178\;/²/g;        #Superscript two
s/\&\#179\;/³/g;        #Superscript three
s/\&\#180\;/´/g;        #Acute accent
s/\&\#181\;/µ/g;        #Micro sign
s/\&\#182\;/¶/g;        #Paragraph sign
s/\&\#183\;/·/g;        #Middle dot
s/\&\#184\;/¸/g;        #Cedilla
s/\&\#185\;/¹/g;        #Superscript one
s/\&\#186\;/º/g;        #Masculine ordinal
s/\&\#187\;/»/g;        #Right angle quote, guillemotright
s/\&\#188\;/¼/g; s/\&frac14\;/¼/g;       # Fraction one-fourth
s/\&\#189\;/½/g; s/\&frac12\;/½/g;       # Fraction one-half
s/\&\#190\;/¾/g; s/\&frac34\;/¾/g;       # Fraction three-fourths
s/\&\#191\;/¿/g;        #Inverted question mark
s/\&\#192\;/À/g;        #Capital A, grave accent
s/\&\#193\;/Á/g;        #Capital A, acute accent
s/\&\#194\;/Â/g;        #Capital A, circumflex accent
s/\&\#195\;/Ã/g;        #Capital A, tilde
s/\&\#196\;/Ä/g;        #Capital A, dieresis or umlaut mark
s/\&\#197\;/Å/g;        #Capital A, ring
s/\&\#198\;/Æ/g;        #Capital AE dipthong (ligature)
s/\&\#199\;/Ç/g;        #Capital C, cedilla
s/\&\#200\;/È/g;        #Capital E, grave accent
s/\&\#201\;/É/g;        #Capital E, acute accent
s/\&\#202\;/Ê/g;        #Capital E, circumflex accent
s/\&\#203\;/Ë/g;        #Capital E, dieresis or umlaut mark
s/\&\#204\;/Ì/g;        #Capital I, grave accent
s/\&\#205\;/Í/g;        #Capital I, acute accent
s/\&\#206\;/Î/g;        #Capital I, circumflex accent
s/\&\#207\;/Ï/g;        #Capital I, dieresis or umlaut mark
s/\&\#208\;/Ð/g;        #Capital Eth, Icelandic
s/\&\#209\;/Ñ/g;        #Capital N, tilde
s/\&\#210\;/Ò/g;        #Capital O, grave accent
s/\&\#211\;/Ó/g;        #Capital O, acute accent
s/\&\#212\;/Ô/g;        #Capital O, circumflex accent
s/\&\#213\;/Õ/g;        #Capital O, tilde
s/\&\#214\;/Ö/g;        #Capital O, dieresis or umlaut mark
s/\&\#215\;/×/g;        #Multiply sign
s/\&\#216\;/Ø/g;        #Capital O, slash
s/\&\#217\;/Ù/g;        #Capital U, grave accent
s/\&\#218\;/Ú/g;        #Capital U, acute accent
s/\&\#219\;/Û/g;        #Capital U, circumflex accent
s/\&\#220\;/Ü/g;        #Capital U, dieresis or umlaut mark
s/\&\#221\;/Ý/g;        #Capital Y, acute accent
s/\&\#222\;/Þ/g;        #Capital THORN, Icelandic
s/\&\#223\;/ß/g;        #Small sharp s, German (sz ligature)
s/\&\#224\;/à/g;        #Small a, grave accent
s/\&\#225\;/á/g;        #Small a, acute accent
s/\&\#226\;/â/g;        #Small a, circumflex accent
s/\&\#227\;/ã/g;        #Small a, tilde
s/\&\#228\;/ä/g;        #Small a, dieresis or umlaut mark
s/\&\#229\;/å/g;        #Small a, ring
s/\&\#230\;/æ/g;        #Small ae dipthong (ligature)
s/\&\#231\;/ç/g;        #Small c, cedilla
s/\&\#232\;/è/g;        #Small e, grave accent
s/\&\#233\;/é/g;        #Small e, acute accent
s/\&\#234\;/ê/g;        #Small e, circumflex accent
s/\&\#235\;/ë/g;        #Small e, dieresis or umlaut mark
s/\&\#236\;/ì/g;        #Small i, grave accent
s/\&\#237\;/í/g;        #Small i, acute accent
s/\&\#238\;/î/g;        #Small i, circumflex accent
s/\&\#239\;/ï/g;        #Small i, dieresis or umlaut mark
s/\&\#240\;/ð/g;        #Small eth, Icelandic
s/\&\#241\;/ñ/g;        #Small n, tilde
s/\&\#242\;/ò/g;        #Small o, grave accent
s/\&\#243\;/ó/g;        #Small o, acute accent
s/\&\#244\;/ô/g;        #Small o, circumflex accent
s/\&\#245\;/õ/g;        #Small o, tilde
s/\&\#246\;/ö/g;        #Small o, dieresis or umlaut mark
s/\&\#247\;/÷/g;        #Division sign
s/\&\#248\;/ø/g;        #Small o, slash
s/\&\#249\;/ù/g;        #Small u, grave accent
s/\&\#250\;/ú/g;        #Small u, acute accent
s/\&\#251\;/û/g;        #Small u, circumflex accent
s/\&\#252\;/ü/g;        #Small u, dieresis or umlaut mark
s/\&\#253\;/ý/g;        #Small y, acute accent
s/\&\#254\;/þ/g;        #Small thorn, Icelandic
s/\&\#255\;/ÿ/g;        #Small y, dieresis or umlaut mark
s/^\s+//;
return $_;
}

 

Дългичко е..., на редовете 8 и 9 сменяте текстовете "Име" и "Парола" с Вашето име и парола в gmail (пишете само името без @gmail.com), след това отваряме терминал и пишем:

 

sudo chmod -R 777 ~/scripts/


това е нужно за да направим папката и файлоете в нея изпълними.

Дойде ред и на самото конки, излизаме от папка scripts и в домашната папка правим файл .conkyrc, отваряме го и поставяме:

 

 

# --- Параметри conky --- #
own_window yes
own_window_class Conky
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
# Минимална ширина
maximum_width 215
# Минимален размер
minimum_size 215
# Разположение на conky  #
alignment               top_right
#alignment               middle_middle
gap_x 25
gap_y 50
# --- Графика  --- #
draw_borders no
background no
stippled_borders 1
border_margin 9
border_width 5
default_color #F3F5F3
draw_graph_borders yes
# --- Text --- #
use_spacer right
use_xft yes
xftalpha 0.5
draw_shades yes
update_interval 1.5
draw_outline no
draw_borders no
font droid:size=8:weight=bold
uppercase no
override_utf8_locale yes
no_buffers yes
cpu_avg_samples 2
short_units yes
pad_percents 2
text_buffer_size 2048
TEXT
${color #F3F5F3}${font :style=bold}${goto 35}LinuxMint "Julia"$font
${hr 1}
Ядро:  ${alignr}${kernel}
Процесор 1:       ${hwmon  temp 1} °C${alignr}${cpu cpu1} %
Процесор 2:       ${hwmon 1 temp 1} °C${alignr}${cpu cpu2} %
RAM:${alignr}$memperc %
SWAP:${alignr}$swapperc %
Дъно t°:$alignr${execi 60 /usr/bin/sensors | grep temp2 | cut -c15-16} °C
Видео t°:$alignr${hwmon 2 temp 3}°C
Вентилатор:$alignr${execi 300 /usr/bin/sensors | grep fan1 | cut -c11-16} Об/мин.
Включен от: ${alignr}${uptime_short}
Потрбители: $alignr ${user_names}
Брой потрбители:$alignr ${user_number}
${font :style=Bold}Твърд диск:${font} ${hr 1}
${font :size=6}Дялове:        ${alignc}Заети: / Общо:${alignr}Температура:$font
Root:      ${alignc}${fs_used /} / ${fs_size /} ${alignr}${hddtemp /dev/sda} °C
Home:    ${alignc}${fs_used /home} / ${fs_size /home} ${alignr}${hddtemp /dev/sda} °C
${font :style=Bold}Интернет:${font} ${hr 1}
${font :size=6}Посока${goto 135}Скорост:     Общо:$font
Качване:${goto 140}${upspeed eth0}  ${totalup eth0}
Сваляне:${goto 140}${downspeed eth0}  ${totaldown eth0}
IP адрес:${goto 140}${addr ppp0}
${font :style=Bold}Процеси: $processes${font}${hr 1}
Aктивни: $running_processes
${font :size=6}Име${alignr}PID    Ядра$font
${top name 1} $alignr ${top pid 1} ${top cpu 1}
${top name 2} $alignr ${top pid 2} ${top cpu 2}
${top name 3} $alignr ${top pid 3} ${top cpu 3}
${top name 4} $alignr ${top pid 4} ${top cpu 4}
${top name 5} $alignr ${top pid 5} ${top cpu 5}
${top name 6} $alignr ${top pid 6} ${top cpu 6}
${font :size=11 :style=bold}${goto 15}${time %H:%M}$font
${goto 15}${time %A}
${goto 12}${if_match ${time %e}<=9}${time %e}${else}${if_match ${time %e}>=10}${time %e}${endif}${endif} ${time %B}
${goto 15}${time %Y}
${voffset -63}${font Bitstream Vera Sans Mono:size=7:weight=bold}${color gray}${execpi 60 VinDSL_Cal_5=`date +%-d`; cal | sed '1d' | sed s/^/"\$\{offset 94"\}/ | sed '/^ *$/d' | sed 's/\<'"$VinDSL_Cal_5"'\>/${color gold}&${color1}/'}${font}
${font :style=Bold}Времето в Русе:$font ${hr 1}
$alignr Обновено на ${execi 600 conkyForecast --location=BUXX0011 --datatype=LU} ч.
$alignr${execi 600 conkyForecast --location=BUXX0011 --datatype=CC}, ${execi 600 conkyForecast --location=BUXX0011 --datatype=LT}
$alignr Мин/Макс: ${execi 600 conkyForecast --location=BUXX0011 --datatype=DP}/${execi 600 conkyForecast --location=BUXX0011 --datatype=HT}
$alignr Налягане: ${execi 600 conkyForecast --location=BUXX0011 --datatype=BR}
$alignr Влажност: ${execi 600 conkyForecast --location=BUXX0011 --datatype=HM}
$alignr Видимост: ${execi 600 conkyForecast --location=BUXX0011 --datatype=VI}
$alignr УВ индекс: ${execi 600 conkyForecast --location=BUXX0011 --datatype=UI}, ${execi 600 conkyForecast --location=BUXX0011 --datatype=UT}
$alignr Изгрев/Залез: ${execi 600 conkyForecast --location=BUXX0011 --datatype=SR}/${execi 600 conkyForecast --location=BUXX0011 --datatype=SS}
$alignrВятър скорост и посока: ${execi 600 conkyForecast --location=BUXX0011 --datatype=WS}/${execi 600 conkyForecast --location=BUXX0011 --datatype=WD}
$alignr Вероятност за валеж: ${execi 600 conkyForecast --location=BUXX0011 --datatype=PC}
$alignr Луна: ${execi 600 conkyForecast --location=BUXX0011 --datatype=MP}
${voffset 120}${execpi 600 conkyForecast --location=BUXX0011 --template=~/scripts/weather-7.template}
${color #F3F5F3}${voffset -18}${font :style=Bold}Rhythmbox:${font} ${hr 1}
${exec rhythmbox-client --no-start --print-playing-format %tt} - ${exec rhythmbox-client --no-start --print-playing-format %aa}  ${exec rhythmbox-client --no-start --print-playing-format %at}
${font :style=Bold}Поща в Gmail:${font} ${hr 1}
${execi 1 perl ~/scripts/gmail.pl e}

 

Сега да си настроим града, на който искаме да знаем времето, където пише BUXX0011, го сменяте с кода на Вашия град (BUXX0011 е кода на Русе), кода може да вземете от тук, в търсачката пишете града и натискате ентер, като зареди страницата с времето на желания от Вас град, вижте горе на адресбара и вземете последните осем симвила:

 

Правим файла изпълним, в терминала пишем:

 

sudo chmod 777 ~/.conkyrc


Това беше, остава само да стартираме, натискаме alt+f2 и пишем conky, след 3-4 сек. ще се появи на десктопа.

Накрая да добавя: според хардуера на компютъра може да няма сензори за всички температури и вентилатори, конкито е настрено за pppoe връзка, ако сте с безжична, сменете ppp0 на wlan. На ред 45 в conkyrc пише: LinuxMint "Julia", напишете Вашата дистрибуция, или каквто искате.

Предпочитам по-изчистените неща, затова всичко ми е един цвят (почти), но нищо не пречи да си отворите в началото на желан от Вас ред една променлива ${color цвят} и след това, в края на реда да я затворите с $color. Ако искате да си добавите и графики:

 

за процесора: ${cpubar cpu1 8,60}, за RAM: ${membar 8,60}
за качване: ${upspeedgraph eth0 8,60 000000 000000}
за сваляне: ${downspeedgraph eth0 8,60 000000 000000}, за харда- ${fs_bar 8,60 /} или ${fs_bar 8,60 /home}


Ами аз се изчерпах.... Искам да благодаря на radoshow за усилията, които положи преди околко година за да ме ограмоти, конфигурационния файл на conkyforecast е негов, също и файла weather-7.template, макар че вече е толкова променен от мен, че едва ли ще си го познае....

Ще се радвам ако някой продължи и развие темата, например със графиките, или с lua файловете.

Искам и да се извиня на wuser за забавянето си, но просто не бях видял лс-то, всъщност ако не беше той, този урок нямаше да го има.

А ако сте изчели и изпълнили всичко, което съм написал, снимайте и покажете резултата!!!

 


Коментирай във форума

 

\n";
print "\tn displays number of new emails\n";
print "\ts displays from line and subject line for each new email.\n";
print "\te displays the number of new emails and from line plus \n";
print "\t\tsubject line for each new email.\n";
} #didn't give proper option
}
sub gmail{
if(!(-e $file)){ #create file if it does not exists
`touch $file`;

#get new emails
`wget -O - https://$user:$pass\@mail.google.com/mail/feed/atom --no-check-certificate> $file`;
open(IN, $file); #open $file
my $i=0; #initialize count
$new=0; #initialize new emails to 0
my $flag=0;
while(){ #cycle through $file
if(//){$flag=1;}
elsif(/(\d+)/){$new=$1;} #grab number of new emails
elsif($flag==1){ 
if(/.+/){push(@subj, &msg);} #grab new email titles
elsif(/(.+)/){push(@from, $1); $flag=0;} #grab new email from lines
}
}
close(IN); #close $file
}
sub passwd{ #change to url escape codes in password
#URL ESCAPE CODES
$_=$pass;
s/\%/\%25/g;
s/\#/\%23/g;
s/\$/\%24/g;
s/\&/\%26/g;
s/\//\%2F/g;
s/\:/\%3A/g;
s/\;/\%3B/g;
s/\

Компютърни езици

Операционни с-ми

Офис

База данни

Въпроси - отговори