Bonjour à tous,
J'aimerais intégrer la dernière ligne du syslog en affichage mis à jour si nouvelle ligne, dans un de mes petits conkys mais n'y arrive pas.
J'ai bien essayé plusieurs code et comme je n'y connais pas grand chose...
Dans le terminal je lance cette commande:
${exec cat tail -n1 -f /var/log/syslog | grep note | cut -d "=" -f2}
Quelle serait la bonne clé pour cette commande dans un conky ?
En fait, je voudrais avoir la dernière ligne du syslog.
J'ai deux fichiers conky pour en faire un car je ne sais pas faire les deux en un, je donne les 2 conky et l'image que j'aimerais obtenir avec la mise à jour de la dernière ligne du syslog, comme ça je peux voir si un truc anormal se passe.
le premier conky:
# Use Xft?
use_xft yes
xftfont Trebuchet MS:size=9
xftalpha 0.8
text_buffer_size 508
background yes
# Update interval in seconds
update_interval 1
#xftalpha 0.8
own_window_argb_visual yes
# 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 desktop
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
# Draw shades?
draw_shades yes
# Draw outlines?
draw_outline yes
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
# border_margin 1
# border width
border_width 1
# Default colors and also border colors
# default_color white
# own_window_colour white
color1 lightgrey
color2 FF7A2A
# 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 none
#borders
draw_borders no
# border_margin 4
#position
gap_x 620
gap_y 65
alignment top_right
#{exec cat ~/.note/ma_note.txt | grep note | cut -d "=" -f2}
#${exec ~/.note/ma_note.txt | grep note | cut -d "=" -f2 | fold -s -w 100}
TEXT
#${color2}M A I L I N F O
#${hr}
${font Ubuntu:pixelsize=18}${color2}Mails
#${color2}${font Ubuntu:pixelsize=15}mail
${voffset -30}${goto 65}${font :size=10}xxxxxx ${color}${font :size=10}$alignc${goto 140}${execpi 100 /home/xxxxxx/.scripts/gmail_generic.sh xxxxxx@gmail.com 'xxxxxxxxx'}${color2}
#${color2}${font Ubuntu:pixelsize=15}mail
${voffset 0}${goto 65}${font :size=10}xxxxx ${color}${font :size=10}$alignc${goto 140}${execpi 100 /home/xxxxxx/.scripts/gmail_generic1.sh xxxxxxx@gmail.com 'xxxxxxxxxx'}
${offset 190}${voffset -50}${font Ubuntu:pixelsize=18}${color2}Les notes
${voffset 20}${font Ubuntu:pixelsize=18}syslog last ligne
${color}${font :size=10}May 8 09:17:01 enebre-R3600 CRON[10614]: (root) CMD
( cd / && run-parts --report /etc/cron.hourly)
#${offset 190}${voffset -5}${font Ubuntu:pixelsize=14}${exec tail f /var/log/syslog}
#${voffset -5}${font Ubuntu:pixelsize=14}${color1}${exec cat ~/.note/ma_note.txt | grep note | cut -d "=" -f2}
la deuxième partie du conky:
# Use Xft?
use_xft yes
xftfont Trebuchet MS:size=9
xftalpha 0.8
text_buffer_size 1024
#background yes
# Update interval in seconds
update_interval 10
out_to_console no
#xftalpha 0.8
#Réglages système
cpu_avg_samples 1 #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
net_avg_samples 2 #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
no_buffers yes
# Minimum size of text area
minimum_size 200
maximum_width 350
# Draw shades?
draw_shades yes
# Draw outlines?
#draw_outline yes
# Draw borders around text
draw_borders no
# Create own window instead of using desktop (required in nautilus)
#own_window_argb_visual yes
#own_window yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Stippled borders?
stippled_borders 0
# border margins
# border_margin 1
# border width
border_width 1
# Default colors and also border colors
# default_color white
# own_window_colour white
color1 A3ADB0
color2 FF7A2A
# 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 none
#borders
draw_borders no
# border_margin 4
#position
gap_x 220
gap_y 2
alignment top_right
TEXT
${voffset 15}${font Ubuntu:pixelsize=14}${color1}${exec cat -b ~/.note/ma_note.txt | grep note | cut -d "=" -f2}
#{exec cat ~/.note/ma_note.txt | grep note | cut -d "=" -f2}
#${exec ~/.note/ma_note.txt | grep note | cut -d "=" -f2 | fold -s -w 100}