Show Us Your Conky

Been bored today, decided to make an “Information Overload” conky for the helluva it. Took me a bit of time to figure out getting the temps for my NVMe drives but I succeeded.

--[[
#==============================================================================#
#==============================================================================#
#                               
# Date    : 20210510
# Editor  : Wade S Grant - sqdnguns@protonmail.com
# Source  : Cherry picked and researched
#==============================================================================#
#==============================================================================#
# Misc Notes:
# Font used ttf-monaco
# Conky designed with 3840x2160 96dpi resolution in mind
# NVMe temps can be acquired via hwmon, using the composite.
#==============================================================================#
#==============================================================================#
]]

conky.config = {
	--Various settings
	background = true,
	cpu_avg_samples = 2,
	diskio_avg_samples = 10,
	double_buffer = true,
	if_up_strictness = 'address',
	net_avg_samples = 2,
	no_buffers = true,
	temperature_unit = 'celsius',
	text_buffer_size = 2048,
	update_interval = 1,
	imlib_cache_size = 0,

	--Placement
	alignment = 'middle_left',
	xinerama_head = 0,
	gap_x = 50,
	gap_y = 0,
	minimum_height = 800,
	minimum_width = 270,
	maximum_width = 270,

	--Graphical
	border_inner_margin = 10,
	border_outer_margin = 1,
	border_width = 0,
	default_bar_width = 280,
	default_bar_height = 10,
	default_gauge_height = 25,
	default_gauge_width =40,
	default_graph_height = 40,
	default_graph_width = 153,
	default_shade_color = '#000000',
	default_outline_color = '#000000',
	draw_borders = false,
	draw_graph_borders = true,
	draw_shades = true,
	draw_outline = false,
	stippled_borders = 0,

	--Text
	extra_newline = false,
	format_human_readable = true,
	font = 'Monaco:size=12',
	max_text_width = 0,
	max_user_text = 16384,
	override_utf8_locale = true,
	short_units = true,
	top_name_width = 21,
	top_name_verbose = false,
	uppercase = false,
	use_spacer = 'none',
	use_xft = true,
	xftalpha = 1,

	--Windows
	own_window = true,
	own_window_argb_value = 100,
	own_window_argb_visual = true,
	own_window_class = 'Conky',
	own_window_colour = '#000000',
	own_window_hints = 'undecorated,below,above,sticky,skip_taskbar,skip_pager',
	own_window_transparent = true,
	own_window_title = 'system_conky',
	own_window_type = 'desktop',

	--Colors
	default_color = '#FFFFFF',
	color1 = '#BF616A',
	color2 = '#dddddd',
	color3 = '#aaaaaa',
	color4 = '#ffff66',
	color5 = '#CCCCCC',
	color6 = '#EBCB8B',
	color8 = '#1F7411',
	color7 = '#5E81AC',
	color9 = '#F1544B',

	--Lua

};
conky.text = [[

${alignc}${color6}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 1-27}${color}

${goto 1}${color7}Speed${alignr}${color1}${freq_g}GHz${color}
${goto 1}${color7}Core 0${color1}${goto 80}${execi 5 sensors|grep 'Core 0'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 0} mhz${alignr}${cpu cpu0}%${color}
${goto 1}${color7}Core 1${color1}${goto 80}${execi 5 sensors|grep 'Core 1'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 1} mhz${alignr}${cpu cpu1}%${color}
${goto 1}${color7}Core 2${color1}${goto 80}${execi 5 sensors|grep 'Core 2'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 2} mhz${alignr}${cpu cpu2}%${color}
${goto 1}${color7}Core 3${color1}${goto 80}${execi 5 sensors|grep 'Core 3'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 3} mhz${alignr}${cpu cpu3}%${color}
${goto 1}${color7}Core 4${color1}${goto 80}${execi 5 sensors|grep 'Core 4'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 4} mhz${alignr}${cpu cpu4}%${color}
${goto 1}${color7}Core 5${color1}${goto 80}${execi 5 sensors|grep 'Core 5'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 5} mhz${alignr}${cpu cpu5}%${color}
${goto 1}${color7}Core 6${color1}${goto 80}${execi 5 sensors|grep 'Core 6'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 6} mhz${alignr}${cpu cpu6}%${color}
${goto 1}${color7}Core 7${color1}${goto 80}${execi 5 sensors|grep 'Core 7'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}°C${goto 150}${freq 7} mhz${alignr}${cpu cpu7}%${color}

${goto 1}${color7}Load${alignr}${color1}$loadavg${color}
${goto 1}${color7}Processes${goto 140}Total${alignr}Running${color}
${goto 140}${color1}$processes${goto 265}$running_processes${color}
${goto 1}${color7}Top CPU${color}
${goto 1}${color1}${top name 1}${alignr}${top cpu 1}${color}
${goto 1}${color1}${top name 2}${alignr}${top cpu 2}${color}
${goto 1}${color1}${top name 3}${alignr}${top cpu 3}${color}
${goto 1}${color1}${top name 4}${alignr}${top cpu 4}${color}
${goto 1}${color1}${top name 5}${alignr}${top cpu 5}${color}

${goto 1}${color7}RAM %${alignr}${color1}${memperc}%${color}
${goto 1}${color7}RAM Total${alignr}${color1}${memmax}${color}
${goto 1}${color7}RAM Used${alignr}${color1}${mem}${color}
${goto 1}${color7}Top RAM${color}
${goto 1}${color1}${top name 1}${alignr}${top mem 1}${color}
${goto 1}${color1}${top name 2}${alignr}${top mem 2}${color}
${goto 1}${color1}${top name 3}${alignr}${top mem 3}${color}
${goto 1}${color1}${top name 4}${alignr}${top mem 4}${color}
${goto 1}${color1}${top name 5}${alignr}${top mem 5}${color}

${alignc}${color6}${exec nvidia-smi --query-gpu=gpu_name --format=csv,noheader,nounits}${color}

${goto 1}${color7}Speed${alignr}${color1}${execi 15 nvidia-settings -q [gpu:0]/GPUCurrentClockFreqs -t} MHz${color}
${goto 1}${color7}VRAM Total${alignr}${color1}${exec nvidia-smi --query-gpu=memory.total --format=csv,noheader}${color}
${goto 1}${color7}VRAM Used${alignr}${color1}${exec nvidia-smi --query-gpu=memory.used --format=csv,noheader}${color}
${goto 1}${color7}Temp${alignr}${color1}${execi 60 nvidia-settings -query [gpu:0]/GPUCoreTemp -t}°C${color}
${goto 1}${color7}Usage${alignr}${color1}${exec nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits}%${color}
${goto 1}${color7}Fan${alignr}${color1}${execi 15 nvidia-settings -q [fan:0]/GPUCurrentFanSpeed -t}%${color}
${goto 1}${color7}Wattage${alignr}${color1}${exec nvidia-smi | grep % | cut -c 22-23}W${color}

${alignc}${color6}Storage${color}

${goto 1}${color6}nvme0n1${goto 140}${color7}Temp${alignr}${color1}${exec cat /sys/class/hwmon/hwmon1/temp1_input|cut -b1-2}°C${color}

${goto 140}${color7}Free${alignr}Total${color}
${goto 1}${color7}Root${goto 140}${color1}${fs_free /}${alignr}${fs_size /}${color}
${goto 1}${color7}Home${goto 140}${color1}${fs_free /home}${alignr}${fs_size /home}${color}
${goto 1}${color7}Crap${goto 140}${color1}${fs_free /crap}${alignr}${fs_size /crap}${color}
${goto 140}${color7}Read${alignr}Write${color}
${goto 1}${color7}I/O${goto 140}${color1}${diskio_read /dev/nvme0n1}${alignr}${diskio_write /dev/nvme0n1}${color}

${goto 1}${color6}nvme1n1${goto 140}${color7}Temp${alignr}${color1}${exec cat /sys/class/hwmon/hwmon2/temp1_input|cut -b1-2}°C${color}

${goto 140}${color7}Free${alignr}Total${color}
${goto 1}${color7}Data_01${goto 140}${color1}${fs_free /data_01}${alignr}${fs_size /data_01}${color}
${goto 140}${color7}Read${alignr}Write${color}
${goto 1}${color7}I/O${goto 140}${color1}${diskio_read /dev/nvme1n1}${alignr}${diskio_write /dev/nvme1n1}${color}

${goto 1}${color6}nvme2n1${goto 140}${color7}Temp${alignr}${color1}${exec cat /sys/class/hwmon/hwmon3/temp1_input|cut -b1-2}°C${color}

${goto 140}${color7}Free${alignr}Total${color}
${goto 1}${color7}Data_02${goto 140}${color1}${fs_free /data_02}${alignr}${fs_size /data_02}${color}
${goto 140}${color7}Read${alignr}Write${color}
${goto 1}${color7}I/O${goto 140}${color1}${diskio_read /dev/nvme2n1}${alignr}${diskio_write /dev/nvme2n1}${color}

${alignc}${color6}Network${color}

${goto 1}${color7}SSID${alignr}${color1}${wireless_essid wlan0}${color}
${goto 1}${color7}WiFi IP${alignr}${color1}${addr wlan0}${color}
${goto 1}${color7}Eth IP${alignr}${color1}${addr eno2}${color}
${goto 1}${color7}WAN IP${alignr}${color1}${exec wget http://ipinfo.io/ip -qO -}${color}

${goto 100}${color7}Down${alignr}Up${color}
${goto 1}${color7}Bitrate${goto 100}${color1}${downspeedf eno2}${alignr}${upspeedf eno2}${color}
${goto 160}${color7}Totals${color}
${goto 1}${color7}Session${goto 100}${color1}${totaldown eno2}${alignr}${totalup eno2}
${goto 1}${color7}Today${goto 100}${color1}${execi 60 vnstat -i eno2 | grep "today" | awk '{print $2 $3}'}${alignr}${execi 60 vnstat -i eno2 | grep "today" | awk '{print $5 $6}'}${color}
${goto 1}${color7}Month${goto 100}${color1}${execi 60 vnstat -i eno2 -m | grep "`date +"%Y-%m"`" | awk '{print $2 $3}'}${alignr}${execi 60 vnstat -i eno2 -m | grep "`date +"%Y-%m"`" | awk '{print $5 $6}'}${color}

${goto 1}${color7}Connections${goto 260}${color1}${tcp_portmon 1 65535 count}${color}
${goto 1}${color7}In / Locale${goto 260}${color1}${tcp_portmon 1 32767 count}${color}
${goto 1}${color7}Out / Locale${goto 260}${color1}${tcp_portmon 32768 61000 count}${color}

]]
3 Likes

Nice @SqdnGunny

1 Like

The next step is to make it fill half of yr workspace :grin:

2 Likes

I was planning on making a conky that fills all of my vertical monitor. I just haven’t had the time to create one.

1 Like

My almost finished product, not sure if the “Total Usage” section is working properly though as it shows no value.

Config:

conky.config = {
--##  Begin Window Settings  #####################
    own_window = true,
    own_window_type = 'override',
    own_window_transparent = true,
    own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',
    own_window_colour = '000000',
    own_window_class = 'conky',
    own_window_title = 'Now Playing Conky',
--## ARGB can be used for real transparency
--## NOTE that a composite manager is required for real transparency.
--## This option will not work as desired (in most cases) in conjunction with
--## own_window_type normal
-- own_window_argb_visual true # Options: yes or no

--## When ARGB visuals are enabled, this use this to modify the alpha value
--## Use: own_window_type normal
--## Use: own_window_transparent no
--## Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
-- own_window_argb_value 0

alignment =  'middle_right',
minimum_width = 300,
maximum_width = 400, 
minimum_height = 250,

gap_x = 50,--## left | right
gap_y = 50,--## up | down
--######################  End Window Settings  ###
--##  Font Settings  #############################
-- Use Xft (anti-aliased font and stuff)
use_xft = true,
font = 'SF Pro Text:size=8',


-- Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha = 1,
-- Force UTF8? requires XFT ###
override_utf8_locale = true,

uppercase = false,
--########################  End Font Settings  ###
--##  Colour Settings  ###########################
draw_shades = false,--yes
default_shade_color = 'black',

draw_outline = false,-- amplifies text if yes
default_outline_color = 'black',

--default_color = '#fffefe',-- Black
default_color = '#c6c6c6',
--default_color = '#212121',
color0 = '#7a7a7a',-- Grey
color1 = '#bf616a',-- Red
color2 = '#a3be8c',-- Green
color3 = '#ebcb8b',-- Yellow
color4 = '#81a1c1',-- Blue
color5 = '#2d2d2d',
color6 = '#c6c6c6',
--######################  End Colour Settings  ###
--##  Borders Section  ###########################
draw_borders = false,
-- Stippled borders?
stippled_borders = 0,
-- border margins
border_inner_margin = 0,
border_outer_margin = 0,
-- border width
border_width = 0,
-- graph borders
draw_graph_borders = false, --no
--default_graph_size 15 40
--#######################  End Borders Secton  ###
--##  Miscellaneous Section  #####################
-- Boolean value, if true, Conky will be forked to background when started.
background = true,
-- Adds spaces around certain objects to stop them from moving other things
-- around, this only helps if you are using a mono font
-- Options: right, left or none
use_spacer = 'none',

-- Default and Minimum size is 256 - needs more for single commands that
-- "call" a lot of text IE: bash scripts
--text_buffer_size 6144

-- Subtract (file system) buffers from used memory?
no_buffers = true,

-- change GiB to G and MiB to M
short_units = true,

-- change GiB to G and MiB to M
short_units = true,

-- Like it says, ot pads the decimals on % values
-- doesn't seem to work since v1.7.1
pad_percents = 2,

-- Like it says, ot pads the decimals on % values
-- doesn't seem to work since v1.7.1
pad_percents = 2,

-- Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
-- $image lots. Set to 0 to disable the image cache.
imlib_cache_size = 0,

-- Use the Xdbe extension? (eliminates flicker)
-- It is highly recommended to use own window with this one
-- so double buffer won't be so big.
double_buffer = true,

--   Maximum size of user text buffer, i.e. layout below TEXT line in config file
--  (default is 16384 bytes)
-- max_user_text 16384

-- Desired output unit of all objects displaying a temperature. Parameters are
-- either "fahrenheit" or "celsius". The default unit is degree Celsius.
-- temperature_unit Fahrenheit
--################  End Miscellaneous Section  ###

update_interval = 1,

};

conky.text = [[
${alignc}${font Digital Readout Thick Upright:size=50}${time %k}:${time %M}${font}
${color0}${alignc}${font Digital Readout Thick Upright:size=20}${time %A %d %B %Y}${color}
${alignc}${font Roboto Condensed:pixelsize=10}System: ${exec lsb_release -si} Linux
${alignc}Host: ${nodename}
${alignc}Kernel: ${kernel}
${alignc}Uptime: ${uptime}
${alignc}Packages: ${execi 60 /usr/bin/pkgnum}
${alignc}Pending Updates: ${execpi 3600 checkupdates | wc -l}
${alignc}Last Updated: ${execi 60 /usr/bin/lastupdate}
#${alignc}GPU Temp: ${execi 15 sensors | head -n 10 | grep -i "temp1" | cut -c 15-22}
#${alignc}MoBo Temp: ${hwmon 0 temp 2}
#${alignc}Fan Speed: ${execi 15 sensors | grep -i "fan1" | cut -c 14-21}

${alignc}${font Roboto Condensed:pixelsize=10}CPU Gen: ${exec cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 1-25}
${alignc}CPU Arch: ${machine}
${alignc}CPU Usage: ${cpu cpu0}%
${alignc}CPU Load: ${loadavg}
${alignc}CPU Speed: ${freq cpu0}MHz
${alignc}CPU Temp: ${hwmon temp 1}°C
${alignc}${cpugraph cpu0 40,250 c6c6c6 a7a7a7}
${font Roboto Condensed:Bold:pixelsize=11}Top CPU:${font}
${font Roboto Condensed:pixelsize=10}${top name 1} ${alignc -15}${top cpu 1}%${alignr}${top pid 1}
${font Roboto Condensed:pixelsize=10}${top name 2} ${alignc -15}${top cpu 2}%${alignr}${top pid 2}
${font Roboto Condensed:pixelsize=10}${top name 3} ${alignc -15}${top cpu 3}%${alignr}${top pid 3}
${font Roboto Condensed:pixelsize=10}${top name 4} ${alignc -15}${top cpu 4}%${alignr}${top pid 4}
${font Roboto Condensed:pixelsize=10}${top name 5} ${alignc -15}${top cpu 5}%${alignr}${top pid 5}

${font Roboto Condensed:pixelsize=10}${color6}Core 1: ${freq cpu1}MHz ${alignr}Core 2: ${freq cpu2}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu1}% ${goto 17}${cpubar 8,100 cpu1} ${alignr 6}${cpu cpu2}% ${alignr}${cpubar 8,100 cpu2}
${color6}Core 3: ${freq cpu3}MHz ${alignr}Core 4: ${freq cpu4}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu3}% ${goto 17}${cpubar 8,100 cpu3} ${alignr 6}${cpu cpu4}% ${alignr}${cpubar 8,100 cpu4}
${color6}Core 5: ${freq cpu5}MHz ${alignr}Core 6: ${freq cpu6}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu5}% ${goto 17}${cpubar 8,100 cpu5} ${alignr 6}${cpu cpu6}% ${alignr}${cpubar 8,100 cpu6}
${color6}Core 7: ${freq cpu7}MHz ${alignr}Core 8: ${freq cpu8}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu7}% ${goto 17}${cpubar 8,100 cpu7} ${alignr 6}${cpu cpu8}% ${alignr}${cpubar 8,100 cpu8}
${color6}Core 9: ${freq cpu9}MHz ${alignr}Core 10: ${freq cpu10}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu9}% ${goto 17}${cpubar 8,100 cpu9} ${alignr 6}${cpu cpu10}% ${alignr}${cpubar 8,100 cpu10}
${color6}Core 11: ${freq cpu11}MHz ${alignr}Core 12: ${freq cpu12}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu11}% ${goto 17}${cpubar 8,100 cpu11} ${alignr 6}${cpu cpu12}% ${alignr}${cpubar 8,100 cpu12}
${color6}Core 13: ${freq cpu13}MHz ${alignr}Core 14: ${freq cpu14}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu13}% ${goto 17}${cpubar 8,100 cpu13} ${alignr 6}${cpu cpu14}% ${alignr}${cpubar 8,100 cpu14}
${color6}Core 15: ${freq cpu15}MHz ${alignr}Core 16: ${freq cpu16}MHz
${color0}${font Roboto Condensed:pixelsize=10}${cpu cpu15}% ${goto 17}${cpubar 8,100 cpu15} ${alignr 6}${cpu cpu16}% ${alignr}${cpubar 8,100 cpu16}

${font Roboto Condensed:Bold:pixelsize=11}${color6}Memory:${font} ${alignc -35}${color0}${font Roboto Condensed:pixelsize=10}$mem / $memmax ${alignr}${font Roboto Condensed:Bold:pixelsize=11}${color6}Used: ${font Roboto Condensed:pixelsize=10}${font}$memperc%
${color0}${alignc}${membar 8,250}${color6}

${font Roboto Condensed:Bold:pixelsize=11}Top Memory:${font}
${font Roboto Condensed:pixelsize=10}${top_mem name 1}${alignc -25}${top_mem mem 1}%${alignr}${top_mem pid 1}
${font Roboto Condensed:pixelsize=10}${top_mem name 2}${alignc -25}${top_mem mem 2}%${alignr}${top_mem pid 2}
${font Roboto Condensed:pixelsize=10}${top_mem name 3}${alignc -25}${top_mem mem 3}%${alignr}${top_mem pid 3}
${font Roboto Condensed:pixelsize=10}${top_mem name 4}${alignc -25}${top_mem mem 4}%${alignr}${top_mem pid 4}
${font Roboto Condensed:pixelsize=10}${top_mem name 5}${alignc -25}${top_mem mem 5}%${alignr}${top_mem pid 5}

${font Roboto Condensed:Bold:pixelsize=11}Root:${font} ${alignc -35}${color0}${font Roboto Condensed:pixelsize=10}${fs_used /} / ${fs_size /} ${alignr}${font Roboto Condensed:Bold:pixelsize=11}${color6}Free:${font} ${font Roboto Condensed:pixelsize=10}${fs_free_perc /}%
${color0}${alignc}${fs_bar 8,250 /}
${font Roboto Condensed:Bold:pixelsize=11}${color6}Home:${font} ${alignc -35}${color0}${font Roboto Condensed:pixelsize=10}${fs_used /home} / ${fs_size /home} ${alignr}${font Roboto Condensed:Bold:pixelsize=11}${color6}Free:${font} ${font Roboto Condensed:pixelsize=10}${fs_free_perc /home}%
${color0}${alignc}${fs_bar 8,250 /home}
${font Roboto Condensed:Bold:pixelsize=11}${color6}Music:${font} ${alignc -35}${color0}${font Roboto Condensed:pixelsize=10}${fs_used /run/media/dobbie/Music/} / ${fs_size /run/media/dobbie/Music/} ${alignr}${font Roboto Condensed:Bold:pixelsize=11}${color6}Free:${font} ${font Roboto Condensed:pixelsize=10}${fs_free_perc /run/media/dobbie/Music/}%
${color0}${alignc}${fs_bar 8,250 /run/media/dobbie/Music/}${color6}

${font Roboto Condensed:Bold:pixelsize=11}Top Processes:${font}
${font Roboto Condensed:Bold:pixelsize=11}Load:${font} ${font Roboto Condensed:pixelsize=10}${loadavg} ${alignr}${font Roboto Condensed:Bold:pixelsize=11}Processes:${font} ${font Roboto Condensed:pixelsize=10}$processes ($running_processes running)

${font Roboto Condensed:Bold:pixelsize=10}Name: ${font Roboto Condensed:Bold:pixelsize=10} ${font Roboto Condensed:Bold:pixelsize=10}${alignc -25}PID:     ${alignr}CPU:
${font Roboto Condensed:pixelsize=10}${top name 1} ${alignc -25}${top pid 1}   ${alignr}${top cpu 1}
${top name 2} ${alignc -25}${top pid 2}   ${alignr}${top cpu 2}
${top name 3} ${alignc -25}${top pid 3}   ${alignr}${top cpu 3}
${top name 4} ${alignc -25}${top pid 4}   ${alignr}${top cpu 4}
${top name 5} ${alignc -25}${top pid 5}   ${alignr}${top cpu 5}
${top name 6} ${alignc -25}${top pid 6}   ${alignr}${top cpu 6}
${top name 7} ${alignc -25}${top pid 7}   ${alignr}${top cpu 7}
${top name 8} ${alignc -25}${top pid 8}   ${alignr}${top cpu 8}

${font Roboto Condensed:Bold:pixelsize=11}Network:${font}
${font Roboto Condensed:pixelsize=10}Private IP: ${alignr}${addr eno1}
${font Roboto Condensed:pixelsize=10}Public: IP ${alignr}${execi 3600 wget -O - -q icanhazip.com}
${font Roboto Condensed:pixelsize=10}Pas IP: ${alignr}${gw_ip}

Inbound Connection: ${alignr}${downspeed eno1} kb/s
${alignc}${downspeedgraph eno1 40,250 c6c6c6 a7a7a7}

Outbound Connection: ${alignr}${upspeed eno1} kb/s
${alignc}${upspeedgraph eno1 40,250 c6c6c6 a7a7a7}

${font Roboto Condensed:Bold:pixelsize=11}Downloaded:${font} ${font Roboto Condensed:pixelsize=10}${totaldown eno1} ${alignr}${font Roboto Condensed:Bold:pixelsize=11}Uploaded:${font} ${font Roboto Condensed:pixelsize=10}${totalup eno1}

${font Roboto Condensed:Bold:pixelsize=11}Total Usage:${font} ${alignr}${font Roboto Condensed:Bold:pixelsize=11}Connections:${font}
${font Roboto Condensed:pixelsize=10}Today: ${alignc -25}${execi 300 vnstat -i en01 | grep "today" | awk '{print $8" "substr ($9)}'} ${alignr}${font Roboto Condensed:pixelsize=10}In / Locale: ${tcp_portmon 1 32767 count}
${font Roboto Condensed:pixelsize=10}Yesterday: ${alignc -25}${execi 300 vnstat -i eno1 | grep "yesterday" | awk '{print $8" "substr ($9)}'} ${alignr}${font Roboto Condensed:pixelsize=10}Out / Locale: ${tcp_portmon 32768 61000 count}
${font Roboto Condensed:pixelsize=10}Week: ${alignc -25}${execi 300 vnstat -i eno1 -w | grep "current week" | awk '{print $9" "substr ($10)}'}
${font Roboto Condensed:pixelsize=10}Month: ${alignc -25}${execi 300 vnstat -i eno1 -m | grep "`date +"%b '%y"`" | awk '{print $9" "substr ($10)}'}

${font Roboto Condensed:Bold:pixelsize=11}Disk Activity:${font}
${font Roboto Condensed:pixelsize=10}sda2 Activity /home
${font Roboto Condensed:Bold:pixelsize=11}Read:${font} ${font Roboto Condensed:pixelsize=10}${diskio_read sda2}${alignr}${font Roboto Condensed:Bold:pixelsize=11}Write:${font} ${font Roboto Condensed:pixelsize=10}${diskio_write sda2}
${diskiograph_read sda2 40,130 c6c6c6 a7a7a7}${alignr}${diskiograph_write sda2 40,130 c6c6c6 a7a7a7}
${font Roboto Condensed:pixelsize=10}sde1 Activity /music
${font Roboto Condensed:Bold:pixelsize=11}Read:${font} ${font Roboto Condensed:pixelsize=10}${diskio_read sde1}${alignr}${font Roboto Condensed:Bold:pixelsize=11}Write:${font} ${font Roboto Condensed:pixelsize=10}${diskio_write sde1}
${diskiograph_read sde1 40,130 c6c6c6 a7a7a7}${alignr}${diskiograph_write sde1 40,130 c6c6c6 a7a7a7}

]];

4 Likes

Nice.

Vnstat has to run for the specified time before it will display a value; it does not display “0”. Start that conky from a terminal I think there is a “not enough data” type of message @Sector11 can provide details on vnstat in conky.

2 Likes

I found the below have ever used vnstat myself.

sudo systemctl enable vnstat.service

${voffset -5}${color1}${goto 75}${font ubuntu:size=11:regular}Received ${alignr 5}Sent
${color1}${font ubuntu:size=11:regular}Session:${font}${color6}${goto 75}${totaldown enp2s0} ${alignr 5}${totalup enp2s0}
${color1}${font ubuntu:size=11:regular}Today:${font}${color6}${goto 75}${execi 60 vnstat -i enp2s0 | grep "today" | awk '{print $2 $3}'}${alignr 5}${execi 60 vnstat -i enp2s0 | grep "today" | awk '{print $5 $6}'}
${color1}${font ubuntu:size=11:regular}Week:${font}${color6}${goto 75}${execi 60 vnstat -i enp2s0 -w | grep "current week" | awk '{print $3 $4}'}${alignr 5}${execi 60 vnstat -i enp2s0 -w | grep "current week" | awk '{print $6 $7}'}
${color1}${font ubuntu:size=11:regular}Month:${font}${color6}${goto 75}${execi 60 vnstat -i enp2s0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}${alignr 5}${execi 60 vnstat -i enp2s0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'
${voffset -5}${color1}${goto 75}${font ubuntu:size=11:regular}Received ${alignr 5}Sent  ${color6}
Session:${goto 75}${totaldown enp2s0} ${alignr 5}${totalup enp2s0}
Today:${goto 75}${execi 60 vnstat -i enp2s0 | grep "today" | awk '{print $2 $3}'}${alignr 5}${execi 60 vnstat -i enp2s0 | grep "today" | awk '{print $5 $6}'}
Week:${goto 75}${execi 60 vnstat -i enp2s0 -w | grep "current week" | awk '{print $3 $4}'}${alignr 5}${execi 60 vnstat -i enp2s0 -w | grep "current week" | awk '{print $6 $7}'}
Month:${goto 75}${execi 60 vnstat -i enp2s0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}${alignr 5}${execi 60 vnstat -i enp2s0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'
1 Like

Hey Dobbie03 …

  1. Did you start the service as per above?

  2. You have a big OOPS! in your conky

${execi 300 vnstat -i eno1 | grep "yesterday"

not eno1 → → → but en01

Also once you initialise vnstat you no longer need to tell it where to look (en01):

 29 Oct 21 @ 10:00:22 ~
   $ vnstat
Database updated: Fri Oct 29 09:58:42 2021

   enp6s0 since 2021-03-21

          rx:  45.05 GiB      tx:  9.50 GiB      total:  54.55 GiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       Sep '21      6.89 GiB |    1.58 GiB |    8.47 GiB |   28.08 kbit/s
       Oct '21      7.61 GiB |    1.40 GiB |    9.01 GiB |   31.39 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated      8.27 GiB |    1.52 GiB |    9.79 GiB |

   daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday    107.49 MiB |   26.31 MiB |  133.80 MiB |   12.99 kbit/s
         today     51.90 MiB |    5.15 MiB |   57.04 MiB |   13.32 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated       122 MiB |      12 MiB |     134 MiB |
 
 29 Oct 21 @ 10:00:27 ~
   $ 

I get an error using your code:

 29 Oct 21 @ 10:17:14 ~
   $ vnstat -i enp6s0 -w | grep "current week" | awk '{print $9" "substr ($10)}'
awk: cmd. line:1: {print $9" "substr ($10)}
awk: cmd. line:1:                        ^ 1 is invalid as number of arguments for substr

Here’s what works for me:

${alignc}${color9}${swapbar 0,30}${color} ↓ Conky v${conky_version} test code ↓ ${color9}${swapbar 0,30}${color}
${color9}${swapbar 0}${color}

en01 = enp6s0
   ${color}Yours:
Today: ${alignc -25}${execi 300 vnstat -i enp6s0 | grep "today" | awk '{print $8" "substr ($9)}'}
   Mine:
${color5}Hoy\
${alignr 5}${execpi 10 vnstat -d | tail -n 3 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
   ${color}Yours
Yesterday: ${alignc -25}${execi 300 vnstat -i enp6s0 | grep "yesterday" | awk '{print $8" "substr ($9)}'}
   Mine
${color5}${execpi 86400 date --date="-1 day" | awk '{print $3" "$2}'}\
${alignr 5}${execpi 86400 vnstat -d | tail -n 4 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
   ${color}Yours
Week: ${alignc -25}${execi 300 vnstat -i enp6s0 -w | grep "current week" | awk '{print $9" "substr ($10)}'}
   Mine
${color5}Curr Wk${alignr 5}${execpi 10 vnstat -w | grep "current week" | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}
   ${color}Yours
Month: ${alignc -25}${execi 300 vnstat -i enp6s0 -m | grep "`date +"%b '%y"`" | awk '{print $9" "substr ($10)}'}
   Mine
${color5}${execpi 86400 date --date="-0 month" +"%b %y"}\
${alignr 5}${execpi 3600 vnstat -m | tail -n 3 | head -n 1 | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}

${font}${color9}${swapbar 0}${color}
${alignc}${color9}${swapbar 0,30}${color} ↑ between lines ↑ ${color9}${swapbar 0,30}${color}

1 Like

My “vnstat conky” as seen in the scrot above. I keep it in a box because I don’t need to see it 24/7.
Call it, read it, close it.

S11_VNSTAT_2.conky

# pkill -xf "conky -c /media/5/Conky/S11_VNSTAT_2.conky" &
###  Begin Window Settings  ##################################################
own_window yes
own_window_type normal
own_window_transparent no #yes
own_window_hints skip_taskbar,skip_pager
own_window_class Conky
own_window_title VNSTAT
own_window_colour 000000
### ARGB can be used for real transparency
### own_window_transparent no
 own_window_argb_visual yes
 own_window_argb_value 175 #255

# Use the Xdbe extension? (eliminates flicker)
double_buffer yes

minimum_size 170 0   ## w|h
maximum_width 170   ## w

gap_x 80 # l|r
gap_y 0 # u|d

alignment ml
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Fira Mono:medium:size=11

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

### WARNING ### These do NOT play well with /media/5/Conky/LUA/draw-bg.lua ###
draw_shades yes ### <<<--- yes: To see it easier on lighter screens.
default_shade_color 000000
draw_outline no ### <<<--- yes: To see it easier on lighter screens.
default_outline_color 000000
uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
#default_color DCDCDC #220 220 220	Gainsboro
#default_color C0C0C0 #192 192 192 Silver
default_color B0E0E6 #176 224 230 PowderBlue
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 DCDCDC #220 220 220	Gainsboro
color3 9ACD32 #154 205  50	YellowGreen
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 5F9EA0 # 95 158 160	CadetBlue
color8 BDB76B #189 183 107	DarkKhaki
color9 CD5C5C #205  92  92	IndianRed  #FF0000 #255   0   0	Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#default_graph_size 15 40

#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
##text_buffer_size 1536

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

## Imlib2 image cache size, in bytes. Defaults to 4MiB. Increase this value
## if you use $image lots.		Set to 0 to disable the image cache.
imlib_cache_size 0

##############################################  End Miscellaneous Section  ###

update_interval 1
TEXT
${color}${alignc}${membar 1,19} Net Speed ${membar 1,19}
Totals${alignr 10}Speed
${color} ${totalup enp6s0}${goto 80}↑${alignr 10}${upspeed enp6s0}
${color6} ${totaldown enp6s0}${goto 80}↓${alignr 10}${downspeed enp6s0}
${color}${alignc}${membar 1,33} Daily ${membar 1,33}
${color5}Hoy\
${alignr 5}${execpi 10 vnstat -d | tail -n 3 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
${color5}${execpi 86400 date --date="-1 day" | awk '{print $3" "$2}'}\
${alignr 5}${execpi 86400 vnstat -d | tail -n 4 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
${color5}${execpi 86400 date --date="-2 day" | awk '{print $3" "$2}'}\
${alignr 5}${execpi 86400 vnstat -d | tail -n 5 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
${color5}${execpi 86400 date --date="-3 day" | awk '{print $3" "$2}'}\
${alignr 5}${execpi 86400 vnstat -d | tail -n 6 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
${color5}${execpi 86400 date --date="-4 day" | awk '{print $3" "$2}'}\
${alignr 5}${execpi 86400 vnstat -d | tail -n 7 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
${color5}${execpi 86400 date --date="-5 day" | awk '{print $3" "$2}'}\
${alignr 5}${execpi 86400 vnstat -d | tail -n 8 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
${color5}${execpi 86400 date --date="-6 day" | awk '{print $3" "$2}'}\
${alignr 5}${execpi 86400 vnstat -d | tail -n 9 | head -n 1 | awk '{print $8" "$9 "\n\
${color}tx ↑${alignr 5}" $5" "$6 "\n\
${color6}rx ↓${alignr 5}" $2" "$3}'}
${color}${alignc}${membar 1,29} Weelky ${membar 1,29}
${color5}←7 Days${alignr 5}${execpi 10 vnstat -w | grep "last 7" | awk '{print $10" "$11 "\n\
${color}tx ↑${alignr 5}" $7" "$8 "\n\
${color6}rx ↓${alignr 5}" $4" "$5}'}
${color5}Last Wk${alignr 5}${execpi 86400 vnstat -w | grep "last week" | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}
${color5}Curr Wk${alignr 5}${execpi 10 vnstat -w | grep "current week" | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}
${color}${alignc}${membar 1,25} Monthly ${membar 1,25}
${color5}${execpi 86400 date --date="-0 month" +"%b %y"}\
${alignr 5}${execpi 3600 vnstat -m | tail -n 3 | head -n 1 | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}
${color5}${execpi 86400 date --date="-1 month" +"%b %y"}\
${alignr 5}${execpi 86400 vnstat -m | tail -n 4 | head -n 1 | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}
${color5}${execpi 86400 date --date="-2 month" +"%b %y"}\
${alignr 5}${execpi 86400 vnstat -m | tail -n 5 | head -n 1 | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}
${color5}${execpi 86400 date --date="-3 month" +"%b %y"}\
${alignr 5}${execpi 86400 vnstat -m | tail -n 6 | head -n 1 | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}
${color5}${execpi 86400 date --date="-4 month" +"%b %y"}\
${alignr 5}${execpi 86400 vnstat -m | tail -n 7 | head -n 1 | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}

Also take a good look at this line - and the many like it:

${alignr 5}${execpi 86400 vnstat -m | tail -n 6 | head -n 1 | awk '{print $9" "$10 "\n\
${color}tx ↑${alignr 5}" $6" "$7 "\n\
${color6}rx ↓${alignr 5}" $3" "$4}'}

vnstat is called ONCE
awk is called ONCE

  • a little something I learned back in my CrunchBang days.
    By who - forget
    “My forgetter is getting better”
2 Likes

Top @Sector11

I share what I learn/beg/borrow or steal from others.

Hmmm pardon me, never steal, “long term borrow” yes, steal no.

Ah, lol, what loads of companies did/do!

Hey S11! Okay:

  1. *Yes indeed, started and enabled.
  2. No oops there my friend, usually enough my ethernet connect is actually called eno1, see below snapshot:
❯ vnstat
Database updated: 2021-10-30 06:10:00

   eno1 since 2021-10-29

          rx:  337.03 MiB      tx:  79.06 MiB      total:  416.09 MiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       2021-10    337.03 MiB |   79.06 MiB |  416.09 MiB |    1.38 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated    355.05 MiB |   81.74 MiB |  436.79 MiB |

   daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday    261.39 MiB |   78.12 MiB |  339.51 MiB |   32.96 kbit/s
         today     75.64 MiB |  958.98 KiB |   76.58 MiB |   28.94 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated    294.39 MiB |    3.64 MiB |  298.04 MiB |

i will check out your changes and let you know!!

Thanks again.

Thanks for the help, All seems to be working okay, when I have been running vnstat for long enough I’ll add the month/weekly sections.

Oh how about that, then the other line where I saw en01 was wrong :slight_smile:
Or was that just my bad eyesight ?¡?

Yea, when I install a new system that conky takes a bit to fill out properly :slight_smile:
Enjoy

1 Like

It was probably me. Though I did use a find and replace to change them all…oh well it doesn’t matter.

Yeah, and I haven’t used a conky of this type for such a long time either.
Thanks again for the help.

Awesome stuff Sector11 wish I had a bigger bar for some vnstat stats. :upside_down_face:

1 Like

Sometime “copy-n-paste” has a mind of it’s own.

As I said before, I don’t know much but what I do know I share because I got it from people like you that do know.

Conky I know, and will always help when I can.

bash, lua, python not so much but I can bend fold and mutilate them into doing things - or break them beyond repair.

Nice thing about Linux; help is just a search/question away.

2 Likes

That sounds like me.

Exactly. The issue was I found numerous different answers to my question, none of them worked except yours :smiley:

And “mine” isn’t even 100% mine, just my answer to your call for help is mine. :smiley:

My vnstats conkys:
/media/5/Conky/S11_VNSTAT.conky
/media/5/Conky/S11_VNSTAT_2.conky
/media/5/Conky/S11_VNSTAT_2.conky_old
/media/5/Conky/S11_Vnstats
/media/5/Conky/S11_Vnstats.conky
/media/5/Conky/S11_Vnstats-orig

from the S11_Vnstats-orig for today (Hoy)

${goto 10}   ${color5}Hoy:${color7} ${execi 300 vnstat | grep "today" | awk '{print $2 $3}'}${goto 140}${color0}${execi 300 vnstat | grep "today" | awk '{print $5 $6}'}${goto 205}${color5}${execi 300 vnstat | grep "today" | awk '{print $8 $9}'}

Look at all those execi’s and greps and awks … heavy, OK heavier, on resources.

What really made my day was “I finally got to help Dobbie03 with something.”

LOL! I need help all the time :smiley: It was very much appreciated.