Conky es una interesante herramienta que nos sirve para monitorizar nuestro sistema (entre otras cosas) y aunque hace mucho, mucho tiempo no lo uso (pues ha perdido el sentido, por lo menos para mi), me encantaba por ser una aplicación sencilla, que consume pocos recursos.
Normalmente cuando ejecutamos y configuramos Conky, solo usamos una sola instancia pero ¿Qué tal si queremos usar varias? Como se puede ver en la siguiente imagen, por ejemplo:
Veamos como hacerlo. Para ello tenemos que crear varios archivos, 3 en este caso:
- .conkyrc_mail para la notificación de correos
- .conkyrc_sistema para información del sistema
- .conkyrc_time para el reloj en el escritorio
Creamos una carpeta llamada .conky en nuestro /home.
$ mkdir ~/.conky
Luego abrimos un terminal como y como root creamos un archivo en /usr/local/bin con el nombre start_conky:
$ sudo touch /usr/local/bin/start_conky
y le ponemos adentro lo siguiente:
#!/bin/bash conky -c /home/tu_usuario/.conky/.conkyrc_sistema & conky -c /home/tu_usuario/.conky/.conkyrc_hora & conky -c /home/tu_usuario/.conky/.conkyrc_mail &
Ya lo que nos queda es darle permisos:
$ sudo chmod a+x /usr/local/bin/start_conky $ sudo chown root:staff /usr/local/bin/start_conky
Pero puede pasar que Conky arranque antes de que el Escritorio termine de cargar y desaparezca. Para solucionar esto creamos un archivo en la ruta /home/tu_usuario/.config/autostart bajo el nombre conky_start (es un nombre diferente al fichero creado en /usr/local/bin) y le ponemos adentro:
#!/bin/bash sleep 15 start_conky exit 0
Podemos cambiar el valor sleep 15 en dependencia del tiempo que demore en cargar nuestro escritorio.
Hasta aquí la parte relevante de este artículo. Si quieren copiar los script que se usan para el ejemplo anterior, sigan leyendo.
.conkyrc_mail
# Use Xft? use_xft yes xftfont DejaVu Sans:size=8 xftalpha 0.8 text_buffer_size 2048 # Update interval in seconds update_interval 1 # 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_transparent yes own_window_type override #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 200 0 #maximum_width 200 # Draw shades? draw_shades no # Draw outlines? draw_outline no # Draw borders around text draw_borders no # Stippled borders? stippled_borders 0 # border margins border_margin 5 # border width border_width 1 # Default colors and also border colors default_color white #default_shade_color black #default_outline_color white own_window_colour 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 35 gap_y 40 # 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 1 # 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 none TEXT ${alignr}${font}${execi 600 conkyEmail –servertype=IMAP –servername=192.168.200.2 –username=tu usuario –password=tupassword –ssl –connectiontimeout=51}${font} Mensaje(s)
.conkyrc_time
# Use Xft? use_xft yes xftfont DejaVu Sans:size=8 xftalpha 0.8 text_buffer_size 2048 # Update interval in seconds update_interval 1 # 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_transparent yes own_window_type override #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 200 0 #maximum_width 200 # Draw shades? draw_shades no # Draw outlines? draw_outline no # Draw borders around text draw_borders no # Stippled borders? stippled_borders 0 # border margins border_margin 5 # border width border_width 1 # Default colors and also border colors default_color white #default_shade_color black #default_outline_color white own_window_colour 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 -40 gap_y 679 # 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 1 # 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 none TEXT ${alignc 35}${font Arial Black:size=26}${time %H:%M}${font} ${alignc}${time %A %d %Y}
.conkyrc_sistema
# Use Xft? use_xft yes xftfont DejaVu Sans:size=8 xftalpha 0.8 text_buffer_size 2048 # Update interval in seconds update_interval 1 # 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_transparent yes own_window_type override #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 200 0 #maximum_width 200 # Draw shades? draw_shades no # Draw outlines? draw_outline no # Draw borders around text draw_borders no # Stippled borders? stippled_borders 0 # border margins border_margin 5 # border width border_width 1 # Default colors and also border colors default_color 2a2a2a own_window_colour 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 800 gap_y 690 # 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 1 # 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 none TEXT ${font} CPU: ${cpu cpu1}% ${alignr 60}${cpubar cpu1 8,60} ${font} RAM: $memperc% ${alignr 60}${membar 8,60} ${font} SWAP: $swapperc% ${alignr 60}${swapbar 8,60}
Fuente: desdelinux