Hiparco

Recetas y trucos de GNU/Linux e informática en general

Alojado en http://guimi.net

Instalando y configurando conky

Conky es una herramienta de monitorización muy potente.
Aunque se pueden hacer maravillas con él, yo prefiero una configuración sobria.

Su instalación es tan sencilla como siempre:

# aptitude install conky

Y lo configuramos mediante:

$ vi .conkyrc
# Conky configuracion file
# 2013 - Guimi
# http://www.guimi.net
# 

#### BASIC CONFIGURATION ###############################
# Overrided by execpi argument
update_interval 2.0
#text_buffer_size 2048
text_buffer_size 512
minimum_size 5 5
no_buffers yes
out_to_console no
out_to_stderr no
use_spacer none
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
stippled_borders 0
# background (make it a daemon)
#background no
background yes

#### WINDOWS ###########################################
# Usual problems: conky dissapears when minimizing windows
# or when cliking desktop
# that's why I let conky be at taskbar
## Create own window in instead of using desktop?
own_window yes
own_window_transparent yes
#own_window_type normal
# disappears when minimizing
own_window_type window
#own_window_type override
#own_window_type desktop
#own_window_type normal
own_window_class Conky
#own_window_class conky-semi
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_hints undecorated,below,sticky,skip_pager

#### DATA DISPLAY CONF #################################
# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none
show_graph_scale no
show_graph_range no
cpu_avg_samples 2
net_avg_samples 2
extra_newline no
uppercase no
## Shorten MiB/GiB to M/G in stats.
short_units yes
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Use Xft?
# xft is required to Force UTF8 (see below)
use_xft yes
xftfont DejaVu Sans Mono:size=10
override_utf8_locale yes

#### BASIC DISPLAY CONF ################################
maximum_width 300
gap_x 1370
#gap_y 60
gap_y 5

border_width 1
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no

## My colors (suit yourself)
color0 White
color1 LightGrey
color2 Tan1		#FFA54F
color3 Grey

##################################### TEXT ##################################
TEXT
#### SYSTEM ############################################
#${scroll 16 $nodename - $sysname $kernel on $machine | }
${color2}$nodename${color1} - $sysname $kernel (${color0}$machine${color1})
${color1}IP address: ${color0}${addr eth0}
#User: ${alignr}$alignc${exec whoami} @ $nodename
${color1}Uptime:${color0} $uptime
#### USAGE #############################################
${color0}$hr
#${color grey}Frequency (in MHz):$color $freq
#${color grey}Frequency (in GHz):$color $freq_g
${color1}RAM Usage:${color0} $mem/$memmax - $memperc% ${membar 4}
${color1}Swap Usage:${color0} $swap/$swapmax - $swapperc% ${swapbar 4}
${color1}CPU Usage:${color0} $cpu% ${cpubar 4}
${color1}Processes:${color0} $processes  ${color1}Running:${color0} $running_processes
#### FILESYSTEM ########################################
${color0}$hr
${color1}File systems:
 /     ${color0}${fs_used /}/${fs_size /} ${fs_bar 6 /}${color1}
 /home ${color0}${fs_used /home}/${fs_size /home} ${fs_bar 6 /home}
#### NETWORKING ########################################
${color0}$hr
${color1}Networking [UP / DOWN]:
#Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0}
#$color${upspeedgraph eth0 16,180 ffff00 00ff00} ${downspeedgraph eth0 16,180 ffff00 00ff00}
${color0}${upspeedgraph eth0 25,145 00ff00 ff0000 -t} ${downspeedgraph eth0 25,145 00ff00 ff0000 -t}
${color0}${totalup eth0} ${upspeed eth0}${alignr}${color0}${downspeed eth0} ${totaldown eth0}
#### TOP ###############################################
${color0}$hr
${color0}Name              PID   CPU%   MEM%
${color3} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color3} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color3} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color3} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color3} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
#### GRAPHICS ##########################################
${color0}$hr
${color1}CPU1 ${color0}${cpugraph cpu1 25,260 00ff00 ff0000 -t}
${color1} ${voffset -25}${cpu cpu1}%
${color1}CPU2 ${color0}${cpugraph cpu2 25,260 00ff00 ff0000 -t}
${color1} ${voffset -25}${cpu cpu2}%
${color1}RAM  ${color0}${memgraph 25,260 00ff00 ff0000 -t}
${color1} ${voffset -25}$memperc%
#${color}${diskiograph sda 16,370 0000ff ff0000}
#DISK ${color}${diskiograph sda 16,270 0000ff ff0000}${alignr}${diskio sda}${color grey}
#DISK ${color}${diskiograph sda 16,270}${alignr}${diskio sda}${color grey}
${color1}DISK ${color}${diskiograph sda 25,260 00ff00 ff0000 -t}${color1}
${color1}${voffset -25}${diskio sda}
#### CALENDAR ##########################################
${color0}$hr
#${font RadioSpace:size=32}${color3}${alignc}${time %l:%M%p}${font}
#${alignc}$color0${time %e} $color1${time %B}
${offset 178}${color2}${font RadioSpace:size=32}${time %k:%M%p}${font}
${alignr}${color1}${time %A}
${alignr}${color0}${time %e} ${color1}${time %B}
#${alignr}${color0}${time %D}
${voffset -70}${font DroidSansMono:size=7.55}${color0}${execpi 30 calOutput=`date +%-d`; cal -h | sed -e 's/\r//g' -e 's/^/ /g' -e '1d' -e 's/\<'"$calOutput"'\>/${color2}&${color0}/'}
${font}${color}
#### RHYTHMBOX #########################################
${color0}$hr
${color1}Rhythmbox: ${color0}${execi 5 rhythmbox-client --no-start --print-playing-format %tt}
#${color1}${color0}${scroll 40 ${exec rhythmbox-client --no-start --print-playing-format %st}}
${color1}${color0} ${execi 5 rhythmbox-client --no-start --print-playing-format %st}
#### CONSOLE ###########################################
${color0}$hr
${color1}${execpi 5 dmesg | tail -n 7}

Otra versión más compacta para pantallas pequeñas (como portátiles)

# Conky configuracion file
# 2013 - Guimi
# http://www.guimi.net
# 
 
#### BASIC CONFIGURATION ###############################
# Overrided by execpi argument
update_interval 2.0
#text_buffer_size 2048
text_buffer_size 512
minimum_size 5 5
no_buffers yes
out_to_console no
out_to_stderr no
use_spacer none
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
stippled_borders 0
# background (make it a daemon)
#background no
background yes
 
#### WINDOWS ###########################################
# Usual problems: conky dissapears when minimizing windows
# or when cliking desktop
# that's why I let conky be at taskbar
## Create own window in instead of using desktop?
own_window yes
own_window_transparent yes
#own_window_type normal
# disappears when minimizing
own_window_type window
#own_window_type override
#own_window_type desktop
#own_window_type normal
own_window_class Conky
#own_window_class conky-semi
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_hints undecorated,below,sticky,skip_pager
 
#### DATA DISPLAY CONF #################################
# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none
show_graph_scale no
show_graph_range no
cpu_avg_samples 2
net_avg_samples 2
extra_newline no
uppercase no
## Shorten MiB/GiB to M/G in stats.
short_units yes
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Use Xft?
# xft is required to Force UTF8 (see below)
use_xft yes
xftfont DejaVu Sans Mono:size=10
override_utf8_locale yes
 
#### BASIC DISPLAY CONF ################################
maximum_width 300
gap_x 1370
#gap_y 60
gap_y 5
 
border_width 1
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
 
## My colors (suit yourself)
color0 White
color1 LightGrey
color2 Tan1        #FFA54F
color3 Grey
 
##################################### TEXT ##################################
TEXT
#### SYSTEM ############################################
#${scroll 16 $nodename - $sysname $kernel on $machine | }
${color2}$nodename${color1} - $sysname $kernel (${color0}$machine${color1})
${color1}IP address: ${color0}${addr eth0}
#User: ${alignr}$alignc${exec whoami} @ $nodename
${color1}Uptime:${color0} $uptime
#### USAGE #############################################
${color0}$hr
#${color grey}Frequency (in MHz):$color $freq
#${color grey}Frequency (in GHz):$color $freq_g
${color1}RAM Usage:${color0} $mem/$memmax - $memperc% ${membar 4}
${color1}SWAP Usage:${color0} $swap/$swapmax - $swapperc% ${swapbar 4}
${color1}CPU Usage:${color0} $cpu% ${cpubar 4}
${color1}DISK ${color}${diskiograph sda 10,210 00ff00 ff0000 -t}${color1} ${diskio sda}
#${color1}${voffset -25}${diskio sda}
#### NETWORKING ########################################
${color0}$hr
${color1}Networking [UP / DOWN]:
#Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0}
#$color${upspeedgraph eth0 16,180 ffff00 00ff00} ${downspeedgraph eth0 16,180 ffff00 00ff00}
${color0}${upspeedgraph eth0 20,145 00ff00 ff0000 -t} ${downspeedgraph eth0 20,145 00ff00 ff0000 -t}
${color0}${totalup eth0} ${upspeed eth0}${alignr}${color0}${downspeed eth0} ${totaldown eth0}
#### FILESYSTEM ########################################
${color0}$hr
#${color1}File systems:
FS /   ${color0}${fs_used /}/${fs_size /} ${fs_bar 6 /}${color1}
#### GRAPHICS ##########################################
${color0}$hr
${color1}RAM  ${color0}${memgraph 20,260 00ff00 ff0000 -t}
${color1} ${voffset -20}$memperc%
${color1}CPU  ${color0}${cpugraph cpu0 20,260 00ff00 ff0000 -t}
${color1} ${voffset -20}${cpu cpu0}%
${color1}       1:${color0}${cpu cpu1}%   ${color1}2:${color0}${cpu cpu2}%   ${color1}3:${color0}${cpu cpu3}%   ${color1}4:${color0}${cpu cpu4}%
${color1}Processes:${color0} $processes  ${color1}Running:${color0} $running_processes
#### TOP ###############################################
${color0}$hr
${color0}Name               PID    CPU%   MEM%
${color3} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color3} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color3} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color3} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color3} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${color3} ${top name 6} ${top pid 6} ${top cpu 6} ${top mem 6}
#### CONSOLE ###########################################
${color0}$hr
${color0}Console
${color1}${execpi 5 dmesg | tail -n 8}
#### CALENDAR ##########################################
${color0}$hr
#${font RadioSpace:size=32}${color3}${alignc}${time %l:%M%p}${font}
#${alignc}$color0${time %e} $color1${time %B}
${offset 178}${color2}${font RadioSpace:size=32}${time %k:%M%p}${font}
${alignr}${color1}${time %A}
${alignr}${color0}${time %e} ${color1}${time %B}
#${alignr}${color0}${time %D}
${voffset -70}${font DroidSansMono:size=7.55}${color0}${execpi 30 calOutput=`date +%-d`; cal -h | sed -e 's/\r//g' -e 's/^/ /g' -e '1d' -e 's/\<'"$calOutput"'\>/${color2}&${color0}/'}
${font}${color}
Categoría: Debian, Software Libre