Conky, des variables système sur le bureau !
Cet article a été mis à jour, vous consultez ici une archive de cet article!
Table des matières
Introduction
Cet article illustre juste les 2 conky que j'ai sur mon bureau, avec leurs fichiers de configuration.
En image

La configuration
Tout se passe dans le fichier .conkyrc situé dans [b]/home/$USER[/b
Voici mon fichier de config en date du 30/11/2016.
Code TEXT :
background yes use_xft yes xftfont Sans:size=10 xftalpha 1 update_interval 1.0 total_run_times 0 own_window yes own_window_transparent yes own_window_argb_visual yes own_window_type normal own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky double_buffer yes minimum_size 800 500 maximum_width 500 text_buffer_size 2000 draw_shades no draw_outline no draw_borders no draw_graph_borders no default_color white default_outline_color white alignment top_left gap_x 10 gap_y 10 no_buffers yes uppercase no cpu_avg_samples 2 override_utf8_locale yes # color1 white # color2 orange # color3 white # color4 lightblue #cornflowerblue # Lua Load # #lua_load ~/.conky/ring.lua #lua_draw_hook_pre clock_rings TEXT ${font Sans:size=8}${color3}SYSTEM : ¨¨¨¨¨¨¨¨${color2} ${color3}OS : ${color2}${exec lsb_release -d | cut -f2 } ${color3}Kernel: ${color2}${exec uname -r} ${goto 160}${color3}Arch: ${color2}$machine ${color3}Uptime:${color2} $uptime ${goto 160}${color3}Load:${color2} $loadavg ${color3}Processes: ${color2} $processes${color3}${goto 160}Running Processes: ${color2} $running_processes ${color3}Battery: ${color2} ${exec acpi -b | awk '{ print "State : " $3 " Capacity : "$4 " (" $5 ")"}'} ${color3}CPU : ¨¨¨¨¨${color2} ${color3}Clock frequency :${color2} ${freq_g} GHz ${color3}Core 0 and 4:${color2} ${cpu cpu0}%${goto 110}${color4}${cpubar cpu0 6,60}${color2}${goto 190}${exec expr `sensors | grep 'Core 0' | cut -d+ -f2 | cut -d\( -f1 | cut -d. -f1`}°C ${color3}Core 1 and 5:${color2} ${cpu cpu1}%${goto 110}${color4}${cpubar cpu1 6,60}${color2}${goto 190}${exec expr `sensors | grep 'Core 1' | cut -d+ -f2 | cut -d\( -f1 | cut -d. -f1`}°C ${color3}Core 2 and 6:${color2} ${cpu cpu2}%${goto 110}${color4}${cpubar cpu2 6,60}${color2}${goto 190}${exec expr `sensors | grep 'Core 2' | cut -d+ -f2 | cut -d\( -f1 | cut -d. -f1`}°C ${color3}Core 3 and 7:${color2} ${cpu cpu3}%${goto 110}${color4}${cpubar cpu3 6,60}${color2}${goto 190}${exec expr `sensors | grep 'Core 3' | cut -d+ -f2 | cut -d\( -f1 | cut -d. -f1`}°C ${color3}CPU Fan Speed: ${color2} ${exec sensors | grep cpu_fan | awk '{ print $2 " tr/mn"; }'} ${color3}MEMORY : ¨¨¨¨¨¨¨¨${color2} ${color3}RAM:${goto 40}${color2} $mem / $memmax ${goto 170}$memperc% ${color3}SWAP:${goto 40}${color2} ${swap} / ${swapmax} ${goto 170} ${swapperc}% ${color3}STORAGE : ¨¨¨¨¨¨¨¨¨${color2} ${color3}Root ${color2}${goto 50}${fs_used /} / ${fs_size /} ${goto 170}${fs_used_perc /}% ${color3}Home ${color2}${goto 50}${fs_used /home} / ${fs_size /home} ${goto 170}${fs_used_perc /home}% ${color3}Var-cl ${color2}${goto 50}${fs_used /var/calculate} / ${fs_size /var/calculate} ${goto 170}${fs_used_perc /var/calculate}% ${color3}DATA ${color2}${goto 50}${fs_used /media/DATA} / ${fs_size /media/DATA} ${goto 170}${fs_used_perc /media/DATA}% # #${color3}Temp HDD : ${color2}${texeci 60 /usr/sbin/hddtemp /dev/sdb 2>/dev/null | grep sdb | awk '{ print $5 }' } ${color3}NETWORK : ¨¨¨¨¨¨¨¨¨${color2} ${color3}eth : ${color2}${addr eth0} ${goto 120}${color3}DL :${color2} ${downspeedf eth0}k/s ${goto 210} ${color3}UP :${color2} ${upspeedf eth0}k/s ${color3}wlan : ${color2}${addr wlan0} ${goto 120}${color3}DL :${color2} ${downspeedf wlan0}k/s ${goto 210} ${color3}UP :${color2} ${upspeedf wlan0}k/s ${color3}Public IP : ${color2}${texeci 1000 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1} ${goto 175} ${color3}Latence : ${color2}${texeci 1 ping 8.8.8.8 -c 1 | grep time= | cut -d"=" -f4} ${color3}EPHEMERIDE : ¨¨¨¨¨¨¨¨¨¨¨¨${color2} ${color3}Date : ${color2}${texeci 1000 date "+%A %d %B %Y"} ${color3}Heure : ${color2}${exec date "+%H:%M"} ${color3}Fête du jour : ${color2}${texeci 1000 wget -O - -q http://fetedujour.fr/ --user-agent="Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0" | grep "<span>Fête du jour" | head -1 | cut -d">" -f4 | cut -d"<" -f1 } ${color3}Mot du jour : ${color2}${texeci 1000 wget -O - -q http://www.wikebec.org/ | grep accueil-mdj-title | cut -d">" -f10 | cut -d"<" -f1} ${color3}: ${color2}${texeci 1000 wget -O - -q http://www.wikebec.org/ | grep accueil-mdj-title | cut -d">" -f13 | cut -d"<" -f1} ${color3}MUSIQUE : ¨¨¨¨¨¨¨¨¨¨${color2} ${color3}Dernièrement sur FUN : ${color2}${texeci 20 wget -O - -q http://www.funradio.fr/quel-est-ce-titre | grep -E '(class="song-artist"|class="song-title")' | head -2 | sed -e 'N;s/\n/ /' -e 's/>/\|/g' -e 's/</\|/g' | awk -F'|' '{ print $3 " - " $7}'}
Retrouvez mon ancienne config de conky dans les anciennes révisions de l'article : 19/10/2014 à 11h40 http://www.linuxtricks.fr/wiki/history.php?id=61