commit 4977d43526230a8902b2e7d27302a67811ebe39f Author: Jacob Hrbek Date: Mon Jun 14 20:01:00 2021 +0200 sync diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..06883d6 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,3 @@ +All rights reserved by Jacob Hrbek in 14/06/2021 in 17:19:04 UTC + +This license currently mimics the terms of GPLv3 while reserving the right for license update in the future. \ No newline at end of file diff --git a/NOTES b/NOTES new file mode 100644 index 0000000..e7686e1 --- /dev/null +++ b/NOTES @@ -0,0 +1 @@ +yeah that works, also to make it little safer for bad input you could use special start and end brackets like conky.text .. [-conky-[ text ]-conky-] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e64db12 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Krey's conky config + +![](img/preview.png) \ No newline at end of file diff --git a/daemons/README.md b/daemons/README.md new file mode 100644 index 0000000..2886db3 --- /dev/null +++ b/daemons/README.md @@ -0,0 +1 @@ +Directory holding the invidual daemons who define ancor \ No newline at end of file diff --git a/daemons/bottom_right.lua b/daemons/bottom_right.lua new file mode 100644 index 0000000..a8fee1b --- /dev/null +++ b/daemons/bottom_right.lua @@ -0,0 +1,49 @@ +conky.config = { + -- Remove the gaps + gap_x = 0, + gap_y = 0, + + -- Define ancor + alignment = 'bottom_right', + + -- TODO(Krey): Decide on the implementation + minimum_width = 450, + + -- TODO(Krey): To be processed + background = false, + border_width = 0.5, + cpu_avg_samples = 4, + default_color = 'white', + default_outline_color = 'grey', + default_shade_color = 'black', + draw_borders = true, + draw_graph_borders = true, + draw_outline = false, + draw_shades = false, + use_xft = true, + font = 'Unifont:size=16', + + net_avg_samples = 2, + double_buffer = true, + out_to_console = false, + out_to_stderr = false, + extra_newline = false, + own_window = true, + own_window_colour = '000000', + own_window_class = 'Conky', + own_window_argb_visual = true, + own_window_type = 'dock', + own_window_transparent = true, + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + stippled_borders = 0, + update_interval = 1, + uppercase = false, + show_graph_scale = false, + show_graph_range = false, +} + +conky.text = [[ +${font :size=18}Activate Windows${font} +${font :size=12}Go to Settings to activate Windows.${font} +${voffset 40} +]] \ No newline at end of file diff --git a/daemons/top_left.lua b/daemons/top_left.lua new file mode 100644 index 0000000..6933062 --- /dev/null +++ b/daemons/top_left.lua @@ -0,0 +1,57 @@ +conky.config = { + -- Remove the gaps + gap_x = 0, + gap_y = 0, + + -- Define ancor + alignment = 'top_left', + + -- TODO(Krey): Decide on the implementation + minimum_width = 450, + + -- TODO(Krey): To be processed + background = false, + border_width = 0.5, + cpu_avg_samples = 4, + default_color = 'white', + default_outline_color = 'grey', + default_shade_color = 'black', + draw_borders = true, + draw_graph_borders = true, + draw_outline = false, + draw_shades = false, + use_xft = true, + font = 'Unifont:size=16', + + net_avg_samples = 2, + double_buffer = true, + out_to_console = false, + out_to_stderr = false, + extra_newline = false, + own_window = true, + own_window_colour = '000000', + own_window_class = 'Conky', + own_window_argb_visual = true, + own_window_type = 'dock', + own_window_transparent = true, + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + stippled_borders = 0, + update_interval = 1, + uppercase = false, + show_graph_scale = false, + show_graph_range = false, +} + +conky.text = [[ +${font Entopia:bold:size=24}SYSTEM ${font}${hr 2} +${offset 20}Host: ${alignr}${execi 3600 cat /sys/devices/virtual/dmi/id/product_version | sed s/\ *$//g} [${execi 3600 cat /sys/devices/virtual/dmi/id/product_name | sed s/\ //g}] +${offset 20}OS: ${alignr}${execi 3600 lsb_release -ds | sed s/\"//g} +${offset 20}Kernel: ${alignr}${sysname} ${kernel} +${offset 20}Architecture: ${alignr}${machine} +${offset 20}Process scheduler: ${alignr}Unknown +${offset 20}Uptime: ${alignr}${uptime} +${offset 20}Entropy: ${entropy_avail}/${entropy_poolsize} (${entropy_perc}%) ${alignr}${entropy_bar 5,100} + +${font Entopia:bold:size=24}SERVICES ${font}${hr 2} +${offset 20}Tor relay: ${alignr}[UNKNOWN] +]] diff --git a/daemons/top_middle.lua b/daemons/top_middle.lua new file mode 100644 index 0000000..65b6a15 --- /dev/null +++ b/daemons/top_middle.lua @@ -0,0 +1,48 @@ +conky.config = { + -- Remove the gaps + gap_x = 0, + gap_y = 0, + + -- Define ancor + alignment = 'top_middle', + + -- TODO(Krey): Decide on the implementation + minimum_width = 450, + + -- TODO(Krey): To be processed + background = false, + border_width = 0.5, + cpu_avg_samples = 4, + default_color = 'white', + default_outline_color = 'grey', + default_shade_color = 'black', + draw_borders = true, + draw_graph_borders = true, + draw_outline = false, + draw_shades = false, + use_xft = true, + font = 'Unifont:size=16', + + net_avg_samples = 2, + double_buffer = true, + out_to_console = false, + out_to_stderr = false, + extra_newline = false, + own_window = true, + own_window_colour = '000000', + own_window_class = 'Conky', + own_window_argb_visual = true, + own_window_type = 'dock', + own_window_transparent = true, + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + stippled_borders = 0, + update_interval = 1, + uppercase = false, + show_graph_scale = false, + show_graph_range = false, +} + +conky.text = [[ +${alignc}${font :bold:size=32}${execi 3600 date -u +"%d/%m/%Y"}${font} +${alignc}-- ${exec date -u +"%H:%M:%S %Z"} -- +]] \ No newline at end of file diff --git a/daemons/top_right.lua b/daemons/top_right.lua new file mode 100644 index 0000000..e771703 --- /dev/null +++ b/daemons/top_right.lua @@ -0,0 +1,86 @@ +conky.config = { + -- Remove the gaps + gap_x = 0, + gap_y = 0, + + -- Define ancor + alignment = 'top_right', + + -- TODO(Krey): Decide on the implementation + minimum_width = 450, + + -- TODO(Krey): To be processed + background = false, + border_width = 0.5, + cpu_avg_samples = 4, + default_color = 'white', + default_outline_color = 'grey', + default_shade_color = 'black', + draw_borders = true, + draw_graph_borders = true, + draw_outline = false, + draw_shades = false, + use_xft = true, + font = 'Unifont:size=16', + + net_avg_samples = 2, + double_buffer = true, + out_to_console = false, + out_to_stderr = false, + extra_newline = false, + own_window = true, + own_window_colour = '000000', + own_window_class = 'Conky', + own_window_argb_visual = true, + own_window_type = 'dock', + own_window_transparent = true, + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + stippled_borders = 0, + update_interval = 1, + uppercase = false, + show_graph_scale = false, + show_graph_range = false, +} + +-- |-${alignc}x${alignr}-| + +conky.text = [[ +${alignc}${font :bold:size=42}${execi 3600 hostname | tr [:lower:] [:upper:]}${font} +${alignc}-- ${execi 3600 "hostname --domain"} -- + +${font Entopia:bold:size=24}PERFORMANCE ${font}${hr 2} +${offset 20}${font :bold}CPU:${font} i7-2620M ${freq_g} Ghz (${running_threads}/${threads}) ${cpubar cpu0 8} +${offset 30}0: (${execi 5 sensors | grep "Core 0" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '1p'}] ${cpubar cpu1 10} +${offset 30}1: (${execi 5 sensors | grep "Core 0" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '2p'}] ${cpubar cpu1 10} +${offset 30}2: (${execi 5 sensors | grep "Core 1" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '3p'}] ${cpubar cpu1 10} +${offset 30}3: (${execi 5 sensors | grep "Core 1" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '4p'}] ${cpubar cpu1 10} +${offset 30}${loadgraph} +${offset 30}RAM: ${mem} / ${memmax} (${memperc}%) ${membar 8} +${offset 30}${memgraph 25} +${offset 20}iGPU: ${alignr}Intel HD Graphics 3000 +${offset 20}dGPU: ${alignr}AMD Radeon HD 6650M (${execi 3 env DRI_PRIME=1 sensors | grep radeon-pci-0100 -A 3 | grep temp1 | sed -E "s/(temp1:\s+)(\+|)(\w+.\w+|N\/A).*/\3/g"} C) + +${font Entopia:bold:size=21}TASKS ${hr 2}${font} +${offset 20}Name ${alignr}PID CPU% MEM% +${offset 20}${top name 1} ${alignr}${top pid 1} ${top cpu 1} ${top mem 1} +${offset 20}${top name 2} ${alignr}${top pid 2} ${top cpu 2} ${top mem 2} +${offset 20}${top name 3} ${alignr}${top pid 3} ${top cpu 3} ${top mem 3} +${offset 20}${top name 4} ${alignr}${top pid 4} ${top cpu 4} ${top mem 4} +${offset 20}${top name 5} ${alignr}${top pid 5} ${top cpu 5} ${top mem 5} +${offset 20}${top name 6} ${alignr}${top pid 6} ${top cpu 6} ${top mem 6} +${offset 20}${top name 7} ${alignr}${top pid 7} ${top cpu 7} ${top mem 7} +${offset 20} ${alignc}Procs: $processes Run: $running_processes + +${font Entopia:bold:size=21}NETWORK ${hr 2}${font} +${offset 20}Nameserver: ${alignr}${nameserver} +${offset 20}enp7s0 ${alignr}${addr enp7s0} +${offset 20}${downspeedgraph enp7s0 50,150} ${alignr}${upspeedgraph enp7s0 50,150} +${offset 20}${color green}${font}▼ $color${downspeed enp7s0} ${alignr}${color green}▲ $color${upspeed enp7s0} + +${font Entopia:bold:size=21}DISKS ${hr 2}${font} +${offset 20}${font :bold}/dev/sda:${font} [${ioscheduler sda}] +${offset 30}${fs_used /}/${fs_size /} ${fs_bar 8 /} +${offset 30}${diskiograph_read /dev/sda 25,100} ${alignr}${diskiograph_read /dev/sda 25,100} +${offset 30}Read ${diskio_read /dev/sda} ${alignr}Write: ${diskio_write /dev/sda} +${offset 20}Swap: $swap/$swapmax $swapperc% ${swapbar 4} +]] \ No newline at end of file diff --git a/img/preview.png b/img/preview.png new file mode 100644 index 0000000..c14d582 Binary files /dev/null and b/img/preview.png differ diff --git a/modules/debug.lua b/modules/debug.lua new file mode 100644 index 0000000..b106eab --- /dev/null +++ b/modules/debug.lua @@ -0,0 +1,9 @@ +-- NOTE(Krey): Figure out how to put this in place? +-- os.getenv("CONKY_DEBUG") == 1 +if (true) then + debug = '' + .. "LEFT${alignc}CENTER${alignr}RIGHT\n" +else + debug = '' + .. "disabled?\n" +end \ No newline at end of file diff --git a/old/README.md b/old/README.md new file mode 100644 index 0000000..96e4667 --- /dev/null +++ b/old/README.md @@ -0,0 +1 @@ +Data in this directory is yet to be processed \ No newline at end of file diff --git a/old/config.lua.old b/old/config.lua.old new file mode 100644 index 0000000..31d4d54 --- /dev/null +++ b/old/config.lua.old @@ -0,0 +1,46 @@ +configuration = { + -- common + lua_load = "/home/kreyren/.config/conky/test.lua", + + -- Remove the gaps + gap_x = 0, + gap_y = 0, + + -- Establish fullscreen + --- NOTE(Krey): Has to be changed depending on screen width + minimum_width = 2390, + + -- Define ancor + alignment = 'middle_middle', + + background = false, + border_width = 0.5, + cpu_avg_samples = 4, + default_color = 'white', + default_outline_color = 'grey', + default_shade_color = 'black', + draw_borders = true, + draw_graph_borders = true, + draw_outline = false, + draw_shades = false, + use_xft = true, + font = 'Unifont:size=16', + + net_avg_samples = 2, + double_buffer = true, + out_to_console = false, + out_to_stderr = false, + extra_newline = false, + own_window = true, + own_window_colour = '000000', + own_window_class = 'Conky', + own_window_argb_visual = true, + own_window_type = 'dock', + own_window_transparent = true, + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + stippled_borders = 0, + update_interval = 1, + uppercase = false, + show_graph_scale = false, + show_graph_range = false +} \ No newline at end of file diff --git a/old/conkyrc.lua.old b/old/conkyrc.lua.old new file mode 100644 index 0000000..928d2fd --- /dev/null +++ b/old/conkyrc.lua.old @@ -0,0 +1,88 @@ +-- http://ifxgroup.net/conky.htm#p3 +-- https://github.com/MX-Linux/mx-conky-data +-- https://epsi-rns.github.io/desktop/2019/06/11/modularized-conky.html + +-- FIXME(Krey): Process https://unix.stackexchange.com/questions/313630/is-it-possible-to-loop-in-conky + +-- home = os.getenv("HOME") +-- dofile(home .. '/.config/conky/config.lua') +local dirname = debug.getinfo(1).source:match("@?(.*/)") +dofile(dirname .. '/config.lua') +dofile(dirname .. 'modules/debug.lua') + +conky.config = configuration + +-- ${lua_parse conky_mycpus} + +-- Alignment tool: `|-${alignc}x${alignr}-|` + +-- TODO(Krey): Integrate logic to generate conky.text +conky.text = [[ +|-${alignc}x${alignr}-| +]] + +conky.text = conky.text .. [[ +${font :bold:size=21}SYSTEM ${font}${alignc}${exec date -u +"%Y-%m-%dT%H:%M:%SZ"}${alignr 10}${font :bold}${execi 3600 hostname | tr [:lower:] [:upper:]}${font} +${font :bold}Host:${font} ${execi 3600 cat /sys/devices/virtual/dmi/id/product_version | sed s/\ *$//g} [${execi 3600 cat /sys/devices/virtual/dmi/id/product_name | sed s/\ //g}]${alignc}x${alignr}-- ${execi 3600 "hostname --domain"} -- +${font :bold}OS:${font} ${execi 3600 lsb_release -ds | sed s/\"//g}${alignc}x${alignr}${font :bold:size=21}PERFORMANCE${font} +${font :bold}Kernel:${font} ${sysname} ${kernel}${alignc}x${alignr}-| +${font :bold}Architecture:${font} ${machine}${alignc}x${alignr}-| +${font :bold}Process scheduler:${font} Unknown${alignc}x${alignr}-| +${font :bold}Uptime:${font} ${uptime}${alignc}x${alignr}-| +|--${alignc}x${alignr}--| +]] + +-- conky.text = [[ +-- LEFT${alignc}CENTER${alignr}RIGHT +-- ${alignc 20}+++ 13/06/2021 14:46:51 CET +++ +-- ${alignr 80}${font :size=42:bold}${execi 3600 hostname | tr [:lower:] [:upper:]}${font} +-- ${alignr 80}-- ${execi 3600 "hostname --domain"} -- + +-- ${alignr 300}${font Entopia:bold:size=21}SYSTEM ${font}${hr 2} +-- ${alignr 60}OS: ${alignr}${execi 3600 lsb_release -ds | sed s/\"//g} +-- ${alignr 60}Host: ${alignr}${execi 3600 cat /sys/devices/virtual/dmi/id/product_version | sed s/\ *$//g} [${execi 3600 cat /sys/devices/virtual/dmi/id/product_name | sed s/\ //g}] +-- ${alignr 60}Kernel: ${alignr}${sysname} ${kernel} +-- ${alignr 60}Arch: ${alignr}${machine} +-- ${alignr 60}Procs Sched: ${alignr}CFS +-- ${alignr 60}Uptime: ${alignr}$uptime +-- ${alignr 60}Battery: ${alignr}${battery_percent BAT1}% ${alignr}${battery_bar 4, 130 BAT1} +-- ${alignr 185}${font Entopia:bold:size=21}PERFORMANCE ${font}${hr 2} +-- ${alignr 80}${font :bold}CPU:${font} i7-2620M ${freq_g} Ghz (${running_threads}/${threads}) ${cpubar cpu0 8} +-- ${alignr 75}0: (${execi 5 sensors | grep "Core 0" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '1p'}] ${cpubar cpu1 10} +-- ${alignr 75}1: (${execi 5 sensors | grep "Core 0" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '2p'}] ${cpubar cpu1 10} +-- ${alignr 75}2: (${execi 5 sensors | grep "Core 1" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '3p'}] ${cpubar cpu1 10} +-- ${alignr 75}3: (${execi 5 sensors | grep "Core 1" | cut -c 17-20} C): [${execi 3600 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sed -n '4p'}] ${cpubar cpu1 10} +-- ${alignr 380}${loadgraph} +-- ${alignr 15}RAM: ${mem} / ${memmax} (${memperc}%) ${membar 8} +-- ${alignr 380}${memgraph 25} +-- ${alignr 15}iGPU: ${alignr}Intel HD Graphics 3000 +-- ${alignr 15}dGPU: ${alignr}AMD Radeon HD 6650M (${execi 3 env DRI_PRIME=1 sensors | grep radeon-pci-0100 -A 3 | grep temp1 | sed -E "s/(temp1:\s+)(\+|)(\w+.\w+|N\/A).*/\3/g"} C) +-- ${alignr 15}Entropy: ${entropy_avail}${entropy_poolsize} (${entropy_perc}%) ${alignr}${entropy_bar 5,100} + +-- ${alignr}${font Entopia:bold:size=21}NETWORK ${hr 2}${font} +-- ${alignr 15}Nameserver: ${alignr}${nameserver} +-- ${alignr 15}enp7s0 ${alignr}${addr enp7s0} +-- ${alignr 15}${downspeedgraph enp7s0 50,150} ${alignr}${upspeedgraph enp7s0 50,150} +-- ${alignr 15}${color green}${font}▼ $color${downspeed enp7s0} ${alignr}${color green}▲ $color${upspeed enp7s0} + +-- ${alignr}${font Entopia:bold:size=21}TASKS ${hr 2}${font} +-- ${alignr 15}Name ${alignr}PID CPU% MEM% +-- ${alignr 15}${top name 1} ${alignr}${top pid 1} ${top cpu 1} ${top mem 1} +-- ${alignr 15}${top name 2} ${alignr}${top pid 2} ${top cpu 2} ${top mem 2} +-- ${alignr 15}${top name 3} ${alignr}${top pid 3} ${top cpu 3} ${top mem 3} +-- ${alignr 15}${top name 4} ${alignr}${top pid 4} ${top cpu 4} ${top mem 4} +-- ${alignr 15}${top name 5} ${alignr}${top pid 5} ${top cpu 5} ${top mem 5} +-- ${alignr 15}${top name 6} ${alignr}${top pid 6} ${top cpu 6} ${top mem 6} +-- ${alignr 15}${top name 7} ${alignr}${top pid 7} ${top cpu 7} ${top mem 7} +-- ${alignr 15} ${alignc}Procs: $processes Run: $running_processes + +-- ${alignr}${font Entopia:bold:size=21}DISKS ${hr 2}${font} +-- ${alignr 15}/dev/sda: [${ioscheduler sda}] +-- ${alignr 15}${fs_used /}/${fs_size /} ${fs_bar 8 /} +-- ${alignr 15}${diskiograph_read /dev/sda 25,100} ${alignr}${diskiograph_read /dev/sda 25,100} +-- ${alignr 15}Read ${diskio_read /dev/sda} ${alignr}Write: ${diskio_write /dev/sda} +-- LEFT${alignc}CENTER${alignr}RIGHT +-- ]] + +-- ${offset 15}Swap: $swap/$swapmax $swapperc% ${swapbar 4} + diff --git a/old/test.lua b/old/test.lua new file mode 100644 index 0000000..9ed374f --- /dev/null +++ b/old/test.lua @@ -0,0 +1,11 @@ +local file = io.popen("grep -c processor /proc/cpuinfo") +local numcpus = file:read("*n") +file:close() +listcpus = "" +for i = 1,numcpus +do listcpus = listcpus.."${cpu cpu"..tostring(i).."} " +end + +function conky_mycpus() + return listcpus +end \ No newline at end of file diff --git a/wrappers/conky.sh b/wrappers/conky.sh new file mode 100755 index 0000000..5018897 --- /dev/null +++ b/wrappers/conky.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# shellcheck shell=sh # Written to comply with IEEE Std 1003.1-2017 + +#@ Written by Jacob Hrbek in 14/06/2021 17:39:35 UTC under the terms of GPLv3 license + +conky_conkyDir="${conky_conkyDir:-"${HOME}/.config/conky"}" + +while [ "$#" -ge 0 ]; do case "$1" in + kill) pkill ${CONKY:-"conky"} ;; + *) + ${CONKY:-"conky"} --config="$conky_conkyDir/daemons/top_right.lua" & + ${CONKY:-"conky"} --config="$conky_conkyDir/daemons/top_middle.lua" & + ${CONKY:-"conky"} --config="$conky_conkyDir/daemons/top_left.lua" & + ${CONKY:-"conky"} --config="$conky_conkyDir/daemons/bottom_right.lua" + exit 0 +esac; shift 1; done \ No newline at end of file