--[[
Conky, a system monitor, based on torsmo

Any original torsmo code is licensed under the BSD license

All code written since the fork of torsmo is licensed under the GPL

Please see COPYING for details

Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]

conky.config = {
    alignment = 'top_right',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'font sans-serif:bold:size=8',
    gap_x = 10,
    gap_y = 40,
    minimum_height = 5,
    minimum_width = 5,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_colour = '000000',
    own_window_class = 'Conky',
    own_window_type = 'desktop',
    own_window_transparent = true,
    own_window_hints = 'below',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    temperature_unit = 'celsius',
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
    color1 ='green',
    color2 ='yellow',
    color3 ='orange',
    color4 ='red',
    color5 ='blue',
    color6 ='white',
    color7 ='black',
}

conky.text = [[
${font sans-serif:bold:size=8}
${goto 20}${image /home/toulibre/.config/conky/img/debian-logo.png -p 148,250}
${color6}${texeci 1000 date "+%A %d %B %Y" } ${alignr}${time %H:%M:%S}
Fête du jour : ${color1} ${alignc}${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 | sed -e 's/Nativité/Steeve/' } !${color6}
${hr}
${color5}${alignc}Batterie 
${if_match ${battery_percent BAT0}< 15}${color4}${else}\
${color4}${if_match ${battery_percent BAT0}< 35}${color3}${else}\
${color3}${if_match ${battery_percent BAT0}< 50}${color2}${else}\
${color2}${if_match ${battery_percent BAT0}< 90}${color1}${else}\
${color5}${endif}${endif}${endif}${endif}${battery_bar BAT0}
${battery_percent BAT0}%${if_match ${acpitemp}< 35}${color5}${else}\
${color5}${if_match ${acpitemp}< 45}${color1}${else}\
${color1}${if_match ${acpitemp}< 55}${color2}${else}\
${color2}${if_match ${acpitemp}< 65}${color3}${else}\
${color4}${endif}${endif}${endif}${endif}${alignr}${acpitemp}°C${color6}
${hr}
${color5}Debian Buster: ${color6}${sysname}${nodename}${kernel} 
${color5}Session:${color6}${uptime}
${color5}Charge moyenne du système:${color1}1'${color6} ${loadavg 1}${color1} 5'${color6} ${loadavg 2}${color1} 15'${color6} ${loadavg 3}
${hr}
${color5}${alignc}Connexions
${color5}Entrantes: ${color1}${tcp_portmon 1 32767 count}${alignc}${offset 28}${color5} Sortantes: ${color1}${tcp_portmon 32768 61000 count}${alignr}${color5}Total: ${color1}${tcp_portmon 1 65535 count}
${color5}Filaire: ▲${color1}${upspeed enp3s0}${color5}▼:${color1}${downspeed enp3s0} ${goto 190}${color5}Wi-Fi: ${color5}▲${color1}${upspeed wlp2s0b1}${color5}▼:${color1}${downspeed wlp2s0b1}
${upspeedgraph enp3s0 20,175} ${upspeedgraph wlp2s0b1 20,175}
${color5}Signal Wi-Fi: ${color1}${wireless_link_qual wlp2s0b1}% ${wireless_link_bar 4,250 wlp2s0b1}
${color5}Adresses Locales:${alignr}Adresses Externes:
${color6}${execi 1000 ip a | grep inet | grep -vw lo | grep -v inet6 | cut -d \/ -f1 | sed 's/[^0-9\.]*//g'}  ${alignr}${execi 1000  wget -q -O- http://ipecho.net/plain; echo}

${color5}${alignc}Adresse Serveur
${alignc}${color6}${gw_ip}
${hr}
${color5}CPU:${execi 1000 grep model /proc/cpuinfo | cut -d : -f2 | tail -1 | sed 's/\s//'}
${color5}${alignc}Fréquence:${if_match ${cpu}< 20}${color1}${else}\
${color1}${if_match ${cpu}< 50}${color2}${else}\
${color2}${if_match ${cpu}< 90}${color3}${else}\
${color3}${if_match ${cpu}< 100}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}${freq_g}Ghz
${if_match ${cpu}< 20} ${color1} ${else}\
${color1}${if_match ${cpu}< 50}${color2}${else}\
${color2}${if_match ${cpu}< 90}${color3}${else}\
${color3}${if_match ${cpu}< 110}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}${cpu}% ${cpubar 6}${color6}
${goto 55}${color5}Coeur1:${if_match ${hwmon 1 temp 1}<20}${color1}${else}\
${color1}${if_match ${hwmon 1 temp 1}<30}${color2}${else}\
${color2}${if_match ${hwmon 1 temp 1}<70}${color3}${else}\
${color3}${if_match ${hwmon 1 temp 1}<90}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}+${hwmon 1 temp 1}c°${goto 225}${color5}Coeur2:${if_match ${hwmon 2 temp 2}<20}${color1}${else}\
${color1}${if_match ${hwmon 2 temp 2}<30}${color2}${else}\
${color2}${if_match ${hwmon 2 temp 2}<70}${color3}${else}\
${color3}${if_match ${hwmon 2 temp 2}<90}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}+${hwmon 2 temp 2}c°
${if_match ${cpu}< 20} ${color1} ${else}\
${color1}${if_match ${cpu}< 50}${color2}${else}\
${color2}${if_match ${cpu}< 90}${color3}${else}\
${color3}${if_match ${cpu}< 100}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}${cpugraph cpu0 14,85}${cpugraph cpu1 14,85}${cpugraph cpu2 14,85}${cpugraph cpu3 14,85} 
${color5}1:${if_match ${cpu cpubar}< 20}${color1}${else}\
${color1}${if_match ${cpu cpubar}< 50}${color2}${else}\
${color2}${if_match ${cpu cpubar}< 90}${color3}${else}\
${color3}${if_match ${cpu cpubar}< 100}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}${cpu cpu0}%${cpubar}
${color5}2:${if_match ${cpu cpubar}< 20}${color1}${else}\
${color1}${if_match ${cpu cpubar}< 50}${color2}${else}\
${color2}${if_match ${cpu cpubar}< 90}${color3}${else}\
${color3}${if_match ${cpu cpubar}< 100}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}${cpu cpu1}%${cpubar}
${color5}3:${if_match ${cpu cpubar}< 20}${color1}${else}\
${color1}${if_match ${cpu cpubar}< 50}${color2}${else}\
${color2}${if_match ${cpu cpubar}< 90}${color3}${else}\
${color3}${if_match ${cpu cpubar}< 100}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}${cpu cpu2}%${cpubar}
${color5}4:${if_match ${cpu cpubar}< 20}${color1}${else}\
${color1}${if_match ${cpu cpubar}< 50}${color2}${else}\
${color2}${if_match ${cpu cpubar}< 90}${color3}${else}\
${color3}${if_match ${cpu cpubar}< 100}${color4}${else}\
${color4}${endif}${endif}${endif}${endif}${cpu cpu3}%${cpubar}${color6}
${color5}Processus:${alignr}Total:${color6}${processes} 
${color5}en cours:${alignr}${color6}${cpu}%
${top name 1}${alignr}${top cpu 1}%
${top name 2}${alignr}${top cpu 2}%
${top name 3}${alignr}${top cpu 3}%
${top name 4}${alignr}${top cpu 4}% 
${top name 5}${alignr}${top cpu 5}% 
${top name 6}${alignr}${top cpu 6}%
${top name 7}${alignr}${top cpu 7}%
${hr}
${color5}RAM:${color}${mem}/${memmax}/${memperc}% 
${color1}${membar 5}
${color5}en cours:${alignr} Total:${color6}${mem}
${top_mem name 1}${alignr}${top_mem mem_res 1}
${top_mem name 2}${alignr}${top_mem mem_res 2}
${top_mem name 3}${alignr}${top_mem mem_res 3}
${top_mem name 4}${alignr}${top_mem mem_res 4}
${top_mem name 5}${alignr}${top_mem mem_res 5}
${top_mem name 6}${alignr}${top_mem mem_res 6}
${top_mem name 7}${alignr}${top_mem mem_res 7}
${color5}Mémoire tampon:${color6}${alignr}${buffers}
${color5}Mémoire cache:${color6}${alignr}${cached}
${hr}
${color5}GPU:${color3} +${hwmon 0 temp 1}c°
${color5}SSD:${color6}${fs_type}/${fs_used}/${fs_size}/${fs_used_perc}%
${color1}${fs_bar 5,250} ${diskio sda}/s
${color5}Swap:${color6}${swap}/${swapmax}/${swapperc}% 
${color green}${swapbar 5}
]]
