Настройка conky для мониторинга RSS и e-mail в Debian GNU/Linux Leny (GNOME)

Я уже немножко описывал настройку conky, но вот у меня появилось немного свободного времени и я решил заняться тем, чтобы conky отображал наполнение моих почтовых ящиков да и заодно подключить RSS этого сайта.


Дата: 20.05.2009 г.

Рейтинг: 12417

Метки: conky, linux

Пошаговая инструкция:

Я почистил конфиг от лишних строчек:

# set to yes if you want Conky to be forked in the background
background no

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
#xftfont Bitstream Vera Sans Mono:size=8
xftfont Terminus:size=8

# Text alpha when using Xft
xftalpha 0.8

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 1000 5

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white

# 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
# same thing as passing -x at command line
gap_x 450
gap_y 1

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

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


# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer yes
#Note: doesn't work in conky 1.2 =(

# stuff after 'TEXT' will be formatted on screen

TEXT



${offset 240}${color slate grey}UpTime: ${color }$uptime
${offset 240}${color slate grey}CPU:${color } $cpu% ${acpitemp}C
${offset 240}${cpugraph 20,130 000000 ffffff}
${offset 240}${color slate grey}Load: ${color }$loadavg
${offset 240}${color slate grey}Processes: ${color }$processes
${offset 240}${color slate grey}Running: ${color }$running_processes

${offset 240}${color slate grey}Highest CPU:
${offset 240}${color #ddaa00} ${top name 1}${top_mem cpu 1}
${offset 240}${color lightgrey} ${top name 2}${top cpu 2}
${offset 240}${color lightgrey} ${top name 3}${top cpu 3}
${offset 240}${color lightgrey} ${top name 4}${top cpu 4}

${offset 240}${color slate grey}Highest MEM:
${offset 240}${color #ddaa00} ${top_mem name 1}${top_mem mem 1}
${offset 240}${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${offset 240}${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${offset 240}${color lightgrey} ${top_mem name 4}${top_mem mem 4}

${offset 240}${color slate grey}MEM: ${color } $memperc% $mem/$memmax
${offset 240}${membar 3,100}
${offset 240}${color slate grey}SWAP: ${color }$swapperc% $swap/$swapmax
${offset 240}${swapbar 3,100}

${offset 240}${color slate grey}ROOT: ${color }${fs_free /}/${fs_size /}
${offset 240}${fs_bar 3,100 /}
${offset 240}${color slate grey}TMP: ${color }${fs_free /tmp}/${fs_size /tmp}
${offset 240}${fs_bar 3,100 /tmp}
${offset 240}${color slate grey}Log: ${color }${fs_free /var/log}/${fs_size /var/log}
${offset 240}${fs_bar 3,100 /var/log}
${offset 240}${color slate grey}HOME: ${color }${fs_free /home}/${fs_size /home}
${offset 240}${fs_bar 3,100 /home}

${offset 240}${color slate grey}NET:
${offset 240}${color}Up: ${color }${upspeed eth0} k/s
${offset 240}${upspeedgraph eth0 20,130 000000 ffffff}
${offset 240}${color}Down: ${color }${downspeed eth0}k/s${color}
${offset 240}${downspeedgraph eth0 20,130 000000 ffffff}

Просмотр количества писем в почтовом ящике:

Эту информацию можно отобразить с помощью переменной pop3_unseen

Формат записи такой:
${pop3_unseen сервер_поп3 Ваш_почтовый ящик пароль}

Вот так это у меня:

${color slate grey}E-Mail:
${offset 24}${color lightgrey}zzzzzz@mail.ru: ${pop3_unseen pop.mail.ru zzzzzz@mail.ru * -i 30}
${offset 24}${color lightgrey}xxxxxx@mail.ru: ${pop3_unseen pop.mail.ru xxxxxx@mail.ru * -i 30}
${offset 24}${color lightgrey} ttttttttt@list.ru: ${pop3_unseen pop.mail.ru ttttttttt@list.ru * -i 30}

* - означает, что пароль на почтовый ящик будет запрашиваться при старте
-i 30 - означает, что содержимое ящиков проверяеться каждые 30 минут, если это параметр не устанавливать, то ящики будут проверяться каждые 5 минут

Просмотр RSS:
Эту информацию можно отобразить с помощью переменной rss

Формат записи такой:
${rss ссылка время_обновления_в_минутах параметр списков}
У меня в версии 1,6 работал только item_titles - он загружает все новости предложенные сервером но вместо него в 1,7 можно ставить item_title(порядковый_номер_новости) и тогда можно строить конфигурацию так:

${color lightgrey}${rss http://ithowto.ru/rss.xml 30 item_title(1)}
${color lightgrey}${rss http://ithowto.ru/rss.xml 30 item_title(2)}
${color lightgrey}${rss http://ithowto.ru/rss.xml 30 item_title(3)}
${color lightgrey}${rss http://ithowto.ru/rss.xml 30 item_title(4)}

Вот так это у меня:

${color lightgrey}${rss http://ithowto.ru/rss.xml 30 item_titles}

А вот так это все выглядит вместе

Настройка conky  для мониторинга RSS и e-mail в Debian GNU/Linux Leny (GNOME)# set to yes if you want Conky to be forked in the background
background no

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
#xftfont Bitstream Vera Sans Mono:size=8
xftfont Sans:size=8

# Text alpha when using Xft
xftalpha 0.8

# Update interval in seconds
update_interval 2.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 500 5

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white

# 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
# same thing as passing -x at command line
gap_x 1
gap_y 1

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

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


# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer yes

# stuff after 'TEXT' will be formatted on screen

TEXT



${color slate grey}UpTime: ${color }$uptime
${color slate grey}CPU:${color } $cpu% ${acpitemp}C
${offset 24}${cpugraph 20,130 000000 ffffff}
${color slate grey}Load: ${color }$loadavg
${color slate grey}Processes: ${color }$processes
${color slate grey}Running: ${color }$running_processes

${color slate grey}Highest CPU:
${offset 24}${color lightgrey} ${top name 1}${top cpu 1}
${offset 24}${color lightgrey} ${top name 2}${top cpu 2}
${offset 24}${color lightgrey} ${top name 3}${top cpu 3}
${offset 24}${color lightgrey} ${top name 4}${top cpu 4}
${offset 24}${color lightgrey} ${top name 5}${top cpu 5}

${color slate grey}Highest MEM:
${offset 24}${color lightgrey} ${top_mem name 1}${top_mem mem 1}
${offset 24}${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${offset 24}${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${offset 24}${color lightgrey} ${top_mem name 4}${top_mem mem 4}
${offset 24}${color lightgrey} ${top_mem name 5}${top_mem mem 5}

${color slate grey}MEM: ${color } $memperc% $mem/$memmax
${offset 24}${membar 3,130}
${color slate grey}SWAP: ${color }$swapperc% $swap/$swapmax
${offset 24}${swapbar 3,130}

${color slate grey}root: ${color }${fs_free /}/${fs_size /}
${offset 24}${fs_bar 3,130 /}
${color slate grey}tmp: ${color }${fs_free /tmp}/${fs_size /tmp}
${offset 24}${fs_bar 3,130 /tmp}
${color slate grey}log: ${color }${fs_free /var/log}/${fs_size /var/log}
${offset 24}${fs_bar 3,130 /var/log}
${color slate grey}home: ${color }${fs_free /home}/${fs_size /home}
${offset 24}${fs_bar 3,130 /home}

${color slate grey}NET: ${color lightgrey}${addr ppp0}
${offset 24}${color}Up: ${color }${upspeed eth0} k/s
${offset 24}${upspeedgraph eth0 20,130 000000 ffffff}
${offset 24}${color}Down: ${color }${downspeed eth0}k/s${color}
${offset 24}${downspeedgraph eth0 20,130 000000 ffffff}

${color slate grey}E-Mail:
${offset 24}${color lightgrey}zzzzzz@mail.ru: ${pop3_unseen pop.mail.ru zzzzzz@mail.ru * -i 30}
${offset 24}${color lightgrey}xxxxxx@mail.ru: ${pop3_unseen pop.mail.ru xxxxxx@mail.ru * -i 30}
${offset 24}${color lightgrey} ttttttttt@list.ru: ${pop3_unseen pop.mail.ru ttttttttt@list.ru * -i 30}

${color slate grey}RSS ithowto.ru:
${color lightgrey}${rss http://ithowto.ru/rss.xml 30 item_titles}

Если, кто-то хочет подробней разобраться вот страница с описанием переменных только там описание под conky 1.7, то есть владельцам версии 1.6 не будут доступны к примеру переменные отображения информации по audacious.




Похожие статьи: