conky.config = {
-- -----------------------------------------------------------------------------
--  # conkyrc_foraz - teoforaz - teoforaz@gmail.com ----------------------------
--  # versión: conkyrc_foraz_theme_1.6.6 - 3/5/2020 ----------------------------
--  # License : Distributed under the terms of GNU GPL version 2 or later
-- -----------------------------------------------------------------------------
-- conkyrc_ivoje
-- Date    : 12/10/2013
-- Author  : IvojeNeotreut
-- Version : v0.1.2
-- License : Distributed under the terms of GNU GPL version 2 or later
-- -----------------------------------------------------------------------------
-- This version is a modification of conkyrc_seamod wich is modification of conkyrc_orange
-- -----------------------------------------------------------------------------
-- conky seamod: http://seajey.deviantart.com/art/Conky-Seamod-v0-1-283461046
-- conkyrc_orange:    http://gnome-look.org/content/show.php?content=137503&forumpage=0
-- conkyrc_lunatico:  http://gnome-look.org/content/show.php?content=142884
-- -----------------------------------------------------------------------------
-- optimizado para 1920x1080
-- -----------------------------------------------------------------------------

	background = true,
	update_interval = 1,
-- update_interval_on_battery = 1,

	cpu_avg_samples = 1,
	net_avg_samples = 1,
	temperature_unit = 'celsius',

	double_buffer = true,
	no_buffers = false,
	text_buffer_size = 2048,

	gap_x = 0,
	gap_y = 0,
	minimum_width = 1920,
	maximum_width = 1920,
	minimum_height = 1080,
	maximum_height = 1080,
	own_window = true,
	own_window_type = 'override',
	own_window_transparent = true,
	own_window_argb_visual = true,
	own_window_argb_value = 50, -- 0-255
	own_window_type = 'normal',
	own_window_class = 'conky-semi',
	own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
	border_inner_margin = 0,
	border_outer_margin = 0,
	alignment = 'top_left',

	override_utf8_locale = true,
	use_xft = true,
	font = 'Ubuntu:size=8',
	xftalpha = 0.5,
	uppercase = false,
	use_spacer = true,
	width = '0',
	max_text_width = 300,

	border_width = 0,
	draw_borders = false,
	default_color = '#000000',
	draw_graph_borders = false,
	draw_outline = false,
	default_outline_color = '111111', -- sombra arrojada textos
	draw_shades = false,
	default_shade_color = '111111', -- perfilado textos

	format_human_readable = true,
	short_units = true,

	top_cpu_separate = false,
	total_run_times = 0,

	show_graph_range = false,
	show_graph_scale = false,

-- colores de fuente
-- titulos
	color1 = '#990000', -- titulos
-- textos
	color2 = '#333333', -- textos

-- imagenes
imlib_cache_size = 0, -- niega la cache de imágenes para que se actualice la img del estado del clima

-- Loading lua script for drawning rings
	lua_load = '/opt/foraz/conky/conkyrc_foraz_rings.lua',
	lua_draw_hook_post = 'main',
	lua_startup_hook = true,
	lua_shutdown_hook = true,

--# System information using conky capabilities

-- Header with base system info
};

conky.text = [[

# Network data (my desktop have only LAN). ETHERNET ring is mostly useless but looks pretty, main info is in the graphs
${voffset 85}
${offset 140}${font Astro867:size=8:bold}${color1}INTERNET
${voffset -5}${font Ubuntu:size=8}
${offset 150}$color2${upspeed _ETH_} / ${totalup}
${offset 150}$color2${downspeed _ETH_} / ${totaldown}

# Showing disk partitions: root, home and Data
${voffset 123}
${offset 145}${font Astro867:size=8:bold}${color1}_DISKS_
${voffset -15}${font Ubuntu:size=8}
${offset 210}${font Ubuntu:size=8:bold}${color2}Free: ${fs_free /}
${offset 210}${font Ubuntu:size=8:bold}${color2}Free: ${fs_free /home}
${offset 210}${font Ubuntu:size=8:bold}${color2}Free: ${fs_free /mnt/archivo}
${offset 210}${font Ubuntu:size=8:bold}${color2}Free: ${fs_free /mnt/multimedia}
${offset 210}${font Ubuntu:size=8:bold}${color2}Free: ${fs_free /mnt/trabajo}
${voffset 10}${offset 130}${font Astro867:size=8:bold}${color1}sda:
${voffset -20}${offset 170}${diskiograph /dev/sda 15,105 #990000 #990000 0 -t}
${voffset 10}${offset 130}${font Astro867:size=8:bold}${color1}sdb:
${voffset -20}${offset 170}${diskiograph /dev/sdb 15,105 #990000 #990000 0 -t}
${voffset 10}${offset 130}${font Astro867:size=8:bold}${color1}sdc:
${voffset -20}${offset 170}${diskiograph /dev/sdc 15,105 #990000 #990000 0 -t}

#Showing memory part with TOP 5
${voffset -279}${offset 320}${font Astro867:size=8:bold}${color1}RAM
${voffset 0}${font Ubuntu:size=8}
${offset 350}${color2}${top_mem name 1}${alignr}${offset -1450}${top_mem mem 1}%
${offset 350}${color2}${top_mem name 1}${alignr}${offset -1450}${top_mem mem 2}%
${offset 350}${color2}${top_mem name 2}${alignr}${offset -1450}${top_mem mem 3}%
${offset 350}${color2}${top_mem name 3}${alignr}${offset -1450}${top_mem mem 4}%
${offset 350}${color2}${top_mem name 4}${alignr}${offset -1450}${top_mem mem 5}%

# swap
${voffset -110}${offset 400}${font Ubuntu:size=8}${color2}SWAP $swap / $swapmax - $swapperc%

${voffset 470}
# Showing CPU Graph
${voffset -2}${offset 204}${font Astro867:size=14:bold}${color1}CPU
${voffset -190}${offset 270}${voffset 180}${cpugraph cpu0 20,144 #990000 #990000 0 -t}

# procesos
${voffset -40}${font Ubuntu:size=8}
${voffset 0}${offset 280}${color2}$processes _PROCESSES_ ($running_processes activos)

# Showing TOP 5 CPU-consumers
${voffset -10}${font Ubuntu:size=8}
${offset 280}${color2}${top name 1}${alignr}${offset -1510}${top cpu 1}%
${offset 280}${color2}${top name 2}${alignr}${offset -1510}${top cpu 2}%
${offset 280}${color2}${top name 3}${alignr}${offset -1510}${top cpu 3}%
${offset 280}${color2}${top name 4}${alignr}${offset -1510}${top cpu 4}%
${offset 280}${color2}${top name 5}${alignr}${offset -1510}${top cpu 5}%
${offset 280}${color2}${top name 6}${alignr}${offset -1510}${top cpu 6}%
${offset 280}${color2}${top name 7}${alignr}${offset -1510}${top cpu 7}%
${offset 280}${color2}${top name 8}${alignr}${offset -1510}${top cpu 8}%

# lm-sensors
${voffset -10}${font Ubuntu:size=8}
# ${offset 280}${color2}Temp: ${hwmon 1 temp 2} | ${hwmon 1 temp 3} | ${hwmon 1 temp 4} | ${hwmon 1 temp 5} | ${hwmon 1 temp 6} | ${hwmon 1 temp 7}
${offset 280}${color2}_TEMPERATURE_ CPU: Core 1: ${execi 1 sensors | grep 'Core 0' | cut -c17-22}${color2} | Core 2: ${execi 1 sensors | grep 'Core 1' | cut -c17-22}${color2} | Core 3: ${execi 1 sensors | grep 'Core 2' | cut -c17-22}${color2} | Core 4: ${execi 1 sensors | grep 'Core 3' | cut -c17-22}${color2} | Core 5: ${execi 1 sensors | grep 'Core 4' | cut -c17-22}${color2} | Core 6: ${execi 1 sensors | grep 'Core 5' | cut -c17-22}
# ventiladores
${offset 280}${color2}_SPEEDFANS_: Fan1:${execi 1 sensors | grep 'fan1' | cut -c23-31}${color2} | Fan2:${execi 1 sensors | grep 'fan2' | cut -c23-31}${color2} | Fan3:${execi 1 sensors | grep 'fan3' | cut -c23-31}${color2} | Fan4:${execi 1 sensors | grep 'fan4' | cut -c23-31}${color2} | Fan5:${execi 1 sensors | grep 'fan5' | cut -c23-31}


${voffset -10}
${offset 230}${font Astro867:size=14:normal}${color1}UP: ${upspeedgraph _ETH_ 15,250 #990000 #990000 0 -t}   DOWN: ${downspeedgraph _ETH_ 15,250 #990000 #990000 0 -t}

# IP
# ip publica
${voffset -54}
${offset 1070}${font Astro867:size=14:normal}${color1}IP: ${color2}${execi 1200 curl https://ipinfo.io/ip}
# ip local
${voffset -36}
${offset 1430}${font Astro867:size=14:normal}${color1}LOCAL: ${color2}${addr _ETH_}

# RELOJ
${voffset -910}
${font Astro867:size=48}$color1${goto 1550}${time %H:%M}
${voffset -100}
$color1${goto 1550}${font Amerika Sans:size=18}$color2${time %A %d %B %Y}${font}

# Informacion de sistema
${voffset 0}
${goto 1550}${font Astro867:size=12:bold}${color1}_SYSTEM_
${voffset 0}
${goto 1550}${font Ubuntu:size=10:normal}${color2}${exec lsb_release -sd || cat /etc/*release}
${goto 1550}${color2}$sysname $kernel
${goto 1550}${color2}Uptime: $uptime

# Clima
${voffset -30}
${if_existing /proc/net/route _ETH_}
${goto 1550}${font Astro867:size=12}${color1}_WEATHER_: ${voffset -3}${font Ubuntu:size=10:normal}${color2}${execi 1200 curl -s "http://api.openweathermap.org/data/2.5/weather?id=_CITYID_&appid=5a5f5c41f2a740927c87b0f7b06add13&lang=_LANGUAGE_&units=metric" | jq -r '.weather[].description' | tr "\\n" " "} | ${execi 1200 curl -s "http://api.openweathermap.org/data/2.5/weather?id=_CITYID_&appid=5a5f5c41f2a740927c87b0f7b06add13&lang=_LANGUAGE_&units=metric" | jq -r '.main.temp'}ºC | _HUMIDITY_ ${execi 1200 curl -s "http://api.openweathermap.org/data/2.5/weather?id=_CITYID_&appid=5a5f5c41f2a740927c87b0f7b06add13&lang=_LANGUAGE_&units=metric" | jq -r '.main.humidity'}%
${goto 1550}${execi 1200 curl -s "http://api.openweathermap.org/data/2.5/weather?id=_CITYID_&appid=5a5f5c41f2a740927c87b0f7b06add13&lang=_LANGUAGE_&units=metric" | jq -r '.name'}, ${execi 1200 curl -s "http://api.openweathermap.org/data/2.5/weather?id=_CITYID_&appid=5a5f5c41f2a740927c87b0f7b06add13&lang=_LANGUAGE_&units=metric" | jq -r '.sys.country'}
${goto 1550}${image /opt/foraz/conky/clima/icon_clima.png -p 1680,145 -s 180x180}
${else}
${voffset 36}
${endif}

# Conexiones
${voffset 275}
# Podrian modificarse los parametros de tcp_portmon, por ejemplo para controlar el puerto 22 cambiando el rango de puertos 1 65535
${if_match ${tcp_portmon 1 65535 count} > 0}
${if_match ${tcp_portmon 1 65535 count} > 0}${offset 450}${font Astro867:size=8:bold}${color1}_CONNECTIONS_: ${tcp_portmon 1 65535 count}${endif}
${voffset 5}${font Ubuntu:size=8}${color2}
${if_match ${tcp_portmon 1 65535 count} > 0}${offset 450}$color2 1 | ${tcp_portmon 1 65535 lip 0}:${tcp_portmon 1 65535 lport 0} > ${tcp_portmon 1 65535 rip 0}:${tcp_portmon 1 65535 rport 0} | ${tcp_portmon 1 65535 rservice 0} | ${tcp_portmon 1 65535 rhost 0}${endif}
${if_match ${tcp_portmon 1 65535 count} > 1}${offset 450}$color2 2 | ${tcp_portmon 1 65535 lip 1}:${tcp_portmon 1 65535 lport 1} > ${tcp_portmon 1 65535 rip 1}:${tcp_portmon 1 65535 rport 1} | ${tcp_portmon 1 65535 rservice 1} | ${tcp_portmon 1 65535 rhost 1}${endif}
${if_match ${tcp_portmon 1 65535 count} > 2}${offset 450}$color2 3 | ${tcp_portmon 1 65535 lip 2}:${tcp_portmon 1 65535 lport 2} > ${tcp_portmon 1 65535 rip 2}:${tcp_portmon 1 65535 rport 2} | ${tcp_portmon 1 65535 rservice 2} | ${tcp_portmon 1 65535 rhost 2}${endif}
${if_match ${tcp_portmon 1 65535 count} > 3}${offset 450}$color2 4 | ${tcp_portmon 1 65535 lip 3}:${tcp_portmon 1 65535 lport 3} > ${tcp_portmon 1 65535 rip 3}:${tcp_portmon 1 65535 rport 3} | ${tcp_portmon 1 65535 rservice 3} | ${tcp_portmon 1 65535 rhost 3}${endif}
${if_match ${tcp_portmon 1 65535 count} > 4}${offset 450}$color2 5 | ${tcp_portmon 1 65535 lip 4}:${tcp_portmon 1 65535 lport 4} > ${tcp_portmon 1 65535 rip 4}:${tcp_portmon 1 65535 rport 4} | ${tcp_portmon 1 65535 rservice 4} | ${tcp_portmon 1 65535 rhost 4}${endif}
${if_match ${tcp_portmon 1 65535 count} > 5}${offset 450}$color2 6 | ${tcp_portmon 1 65535 lip 5}:${tcp_portmon 1 65535 lport 5} > ${tcp_portmon 1 65535 rip 5}:${tcp_portmon 1 65535 rport 5} | ${tcp_portmon 1 65535 rservice 5} | ${tcp_portmon 1 65535 rhost 5}${endif}
${if_match ${tcp_portmon 1 65535 count} > 6}${offset 450}$color2 7 | ${tcp_portmon 1 65535 lip 6}:${tcp_portmon 1 65535 lport 6} > ${tcp_portmon 1 65535 rip 6}:${tcp_portmon 1 65535 rport 6} | ${tcp_portmon 1 65535 rservice 6} | ${tcp_portmon 1 65535 rhost 6}${endif}
${if_match ${tcp_portmon 1 65535 count} > 7}${offset 450}$color2 8 | ${tcp_portmon 1 65535 lip 7}:${tcp_portmon 1 65535 lport 7} > ${tcp_portmon 1 65535 rip 7}:${tcp_portmon 1 65535 rport 7} | ${tcp_portmon 1 65535 rservice 7} | ${tcp_portmon 1 65535 rhost 7}${endif}
${if_match ${tcp_portmon 1 65535 count} > 8}${offset 450}$color2 9 | ${tcp_portmon 1 65535 lip 8}:${tcp_portmon 1 65535 lport 8} > ${tcp_portmon 1 65535 rip 8}:${tcp_portmon 1 65535 rport 8} | ${tcp_portmon 1 65535 rservice 8} | ${tcp_portmon 1 65535 rhost 8}${endif}
${if_match ${tcp_portmon 1 65535 count} > 9}${offset 450}$color2 * | ${tcp_portmon 1 65535 lip 9}:${tcp_portmon 1 65535 lport 9} > ${tcp_portmon 1 65535 rip 9}:${tcp_portmon 1 65535 rport 9} | ${tcp_portmon 1 65535 rservice 9} | ${tcp_portmon 1 65535 rhost 9}${endif}
${endif}

### Reproductores de Musica ###

# _MPLAYER_
${if_running _MPLAYER_}
${voffset -540}
${goto 1550}${font Astro867:size=12}${color1}_MPLAYER_
${voffset 10}${goto 1550}${font Ubuntu:size=10:normal}${color2}Artist : ${execi 1 dbus-send --print-reply --dest=org.mpris.MediaPlayer2._MPLAYER_ /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | egrep -A 2 "artist" | egrep -v "artist" | egrep -v "array" | cut -b 27- | cut -d '"' -f 1 | egrep -v ^$ | tr -d "\n"}
${voffset 0}${goto 1550}${font Ubuntu:size=10:normal}${color2}Title : ${execi 1 dbus-send --print-reply --dest=org.mpris.MediaPlayer2._MPLAYER_ /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | egrep -A 1 "title" | egrep -v "title" | cut -b 44- | cut -d '"' -f 1 | egrep -v ^$ | tr -d "\n"}
${voffset 0}${goto 1550}${font Ubuntu:size=10:normal}${color2}Album: ${execi 1 dbus-send --print-reply --dest=org.mpris.MediaPlayer2._MPLAYER_ /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | egrep -A 1 "album" | egrep -v "album" | cut -b 44- | cut -d '"' -f 1 | egrep -v ^$ | tr -d "\n"}
${voffset 0}${goto 1550}${font Ubuntu:size=10:normal}${color2}Track: ${execi 1 dbus-send --print-reply --dest=org.mpris.MediaPlayer2._MPLAYER_ /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | egrep -A 1 "trackNumber" | egrep -v "trackNumber" | cut -b 42- | cut -d '"' -f 1 | egrep -v ^$ | tr -d "\n"}
${execi 1 /opt/foraz/conky/music_art.sh _MPLAYER_}
${goto 1750}${image /opt/foraz/conky/music/img_art.png -n -p 1550,490 -s 180x180}
${endif}

### Fin Reproductores ###

### RSS ###
# ${voffset 0}
# ${execi 1200 conky -c /opt/foraz/conky/conkyrc_rss_foraz}

### citas ###
# ${voffset 0}
# ${execi 1200 conky -c /opt/foraz/conky/conkyrc_citas_foraz}

# descarga imagen del clima
${voffset 0}
${execi 1200 /opt/foraz/conky/conky_icons_clima_download.sh}




]];
