Skip to content

Instantly share code, notes, and snippets.

@HorlogeSkynet

HorlogeSkynet/conkyrc.lua

Last active Dec 26, 2018
Embed
What would you like to do?
My ConkyRC adapted to LUA syntax (deprecated)
-- HorlogeSkynet's Conky Script
-- <https://blog.samuel.domains/blog/tutorials/paramtrer-conky-sous-crunchbang>
-- Fonts needed (download and move them in `~/.fonts/`) :
-- * <https://www.dafont.com/radio-space.font>
-- * <https://www.dafont.com/style-bats.font>
-- * <https://www.dafont.com/pizzadude-bullets.font>
-- THIS CONKYRC IS DEPRECATED. MAINTAINED VERSION : <https://git.forestier.app/HorlogeSkynet/SimpleConkyScript>
conky.config = {
alignment = 'top_right',
background = false,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'black',
default_outline_color = 'black',
default_shade_color = 'black',
draw_borders = true,
draw_graph_borders = true,
draw_shades = false,
draw_outline = false,
use_xft = true,
font = 'verdana:size=9',
gap_x = 20,
gap_y = 60,
minimum_height = 240,
minimum_width = 240,
net_avg_samples = 2,
double_buffer = true,
out_to_console = false,
out_to_stderr = false,
extra_newline = false,
own_window = false,
own_window_transparent = true,
--own_window_type = override,
--own_window_argb_visual = false,
--own_window_hints = 'undecorated, below, sticky, skip_taskbar, skip_pager',
--own_window_class = 'Conky',
--own_window_type = 'desktop',
stippled_borders = 0,
update_interval = 1.5,
uppercase = false,
use_spacer = none,
total_run_times = 0,
override_utf8_locale = true,
xftalpha = 1,
if_up_strictness = link
}
conky.text =
[[
${font Radio Space:size=10}${alignc}${time %H:%M}
${alignc}${time %A %d %B %Y}${font}
${hr}
Host:$alignr$nodename
Desktop:$alignc$desktop_name$alignr$desktop / $desktop_number
$sysname:$alignr$kernel $machine
${execi 86400 lsb_release -si}:$alignr${execi 86400 lsb_release -sr} ${execi 86400 lsb_release -sc}
${font StyleBats:size=18}P${font} Uptime:$alignr$uptime
${font StyleBats:size=16}8${font} Battery:$alignr${battery_time BAT0}
${if_match ${battery_percent BAT0} > 50}${color #22780F}${battery_bar 10,170 BAT0}$alignr${battery_percent BAT0}$else${if_match ${battery_percent BAT0} < 20}${color #ED0000}${battery_bar 10,170 BAT0}$alignr${battery_percent BAT0}$else${color #ED7F10}${battery_bar 10,170 BAT0}$alignr${battery_percent BAT0}$endif$endif %
${color}${stippled_hr 2}
${color}${voffset 3}${font StyleBats:size=16}l${font}${voffset -3} Temperature:
${color} Core 1:${alignr}${if_match ${exec sensors | grep "Core 0:" | cut -c 16-17} < 70}${color #22780F}${exec sensors | grep "Core 0:" | cut -c 16-17}$else${if_match ${exec sensors | grep "Core 0:" | cut -c 16-17} > 90}${color #ED0000}${exec sensors | grep "Core 0:" | cut -c 16-17}$else${color #ED7F10}${exec sensors | grep "Core 0:" | cut -c 16-17}$endif$endif °C
${color} Core 2:${alignr}${if_match ${exec sensors | grep "Core 1:" | cut -c 16-17} < 70}${color #22780F}${exec sensors | grep "Core 1:" | cut -c 16-17}$else${if_match ${exec sensors | grep "Core 1:" | cut -c 16-17} > 90}${color #ED0000}${exec sensors | grep "Core 1:" | cut -c 16-17}$else${color #ED7F10}${exec sensors | grep "Core 1:" | cut -c 16-17}$endif$endif °C
${color} Virtual Device:${alignr}${if_match ${exec sensors | grep "temp1:" -m 1 | cut -c 16-17} < 70}${color #22780F}${exec sensors | grep "temp1:" -m 1 | cut -c 16-17}$else${if_match ${exec sensors | grep "temp1:" -m 1 | cut -c 16-17} > 90}${color #ED0000}${exec sensors | grep "temp1:" -m 1 | cut -c 16-17}$else${color #ED7F10}${exec sensors | grep "temp1:" -m 1 | cut -c 16-17}$endif$endif °C
${color} Graphic Card:${alignr}${if_match ${exec sensors | sort -r | grep -m 1 "temp1:" | cut -c 16-17} < 70}${color #22780F}${exec sensors | sort -r | grep -m 1 "temp1:" | cut -c 16-17}$else${if_match ${exec sensors | sort -r | grep -m 1 "temp1:" | cut -c 16-17} > 90}${color #ED0000}${exec sensors | sort -r | grep -m 1 "temp1:" | cut -c 16-17}$else${color #ED7F10}${exec sensors | sort -r | grep -m 1 "temp1:" | cut -c 16-17}$endif$endif °C
${color} Hard Drive:${alignr}${if_match ${execi 30 nc localhost 7634 | cut -c 23-24} < 70}${color #22780F}${execi 30 nc localhost 7634 | cut -c 23-24}$else${if_match ${execi 30 nc localhost 7634 | cut -c 23-24} > 90}${color #ED0000}${execi 30 nc localhost 7634 | cut -c 23-24}$else${color #ED7F10}${execi 30 nc localhost 7634 | cut -c 23-24}$endif$endif °C
${color}${voffset 3}${font StyleBats:size=16}q${font}${voffset -3} Luminosity:${alignr}${exec cat /sys/class/backlight/acpi_video0/brightness} / ${exec cat /sys/class/backlight/acpi_video0/max_brightness}
${stippled_hr 2}
${color}${voffset 3}${font StyleBats:size=16}A${font}${voffset -3} CPU usage:
${color} Core 1:$alignr${freq_g 0} GHz
${if_match ${cpu cpu0} < 50}${color #22780F}${cpubar cpu0 10,170}$alignr${cpu cpu0}$else${if_match ${cpu cpu0} > 80}${color #ED0000}${cpubar 10,170}$alignr${cpu cpu0}$else${color #ED7F10}${cpubar 10,170}$alignr${cpu cpu0}$endif$endif %
${color} Core 2:$alignr${freq_g 1} GHz
${if_match ${cpu cpu1} < 50}${color #22780F}${cpubar cpu1 10,170}$alignr${cpu cpu1}$else${if_match ${cpu cpu1} > 80}${color #ED0000}${cpubar 10,170}$alignr${cpu cpu1}$else${color #ED7F10}${cpubar 10,170}$alignr${cpu cpu1}$endif$endif %
${color}
${voffset -1}${font PizzaDude Bullets:size=16}J${voffset 1}${font} RAM usage:$alignr${mem} / ${memmax}
${if_match ${memperc} < 50}${color #22780F}${membar 10,145}$alignr${memperc}$else${if_match ${memperc} > 80}${color #ED0000}${membar 10,145}$alignr${memperc}$else${color #ED7F10}${membar 10,145}$alignr${memperc}$endif$endif % used
${voffset -1}${color}${font PizzaDude Bullets:size=16}J${voffset 1}${font} Swap usage:$alignr$swap / $swapmax
${if_match ${swapperc} < 50}${color #22780F}${swapbar 10,145}$alignr${swapperc}$else${if_match ${swapperc} > 80}${color #ED0000}${swapbar 10,145}$alignr${swapperc}$else${color #ED7F10}${swapbar 10,145}$alignr${swapperc}$endif$endif % used
${color}
${color}${font StyleBats:size=16}U${font} /home/ usage:$alignr${fs_used /home/} / ${fs_size /home/}
${if_match ${fs_free_perc /home/} > 50}${color #22780F}${fs_bar 10,145 /home/}$alignr${fs_free_perc /home/}$else${if_match ${fs_free_perc /home/} < 20}${color #ED0000}${fs_bar 10,145 /home/}$alignr${fs_free_perc /home/}$else${color #ED7F10}${fs_bar 10,145 /home/}$alignr${fs_free_perc /home/}$endif$endif % free
${color}${font StyleBats:size=16}U${font} / usage:$alignr${fs_used /} / ${fs_size /}
${if_match ${fs_free_perc /} > 50}${color #22780F}${fs_bar 10,145 /}$alignr${fs_free_perc /}$else${if_match ${fs_free_perc /} < 20}${color #ED0000}${fs_bar 10,145 /}$alignr${fs_free_perc /}$else${color #ED7F10}${fs_bar 10,145 /}$alignr${fs_free_perc /}$endif$endif % free
${color}${font StyleBats:size=16}U${font} Flow Disk:$alignr${diskiograph /dev/sda 22,150 003366 003366}
${stippled_hr 2}
${color}${voffset 15}${font PizzaDude Bullets:size=16}S${font}${voffset -15} Download:$alignr${voffset -5}${if_up wlp12s0}${downspeedgraph wlp12s0 22,150 22780F 22780F}$else${downspeedgraph enp0s25 22,150 22780F 22780F}$endif${voffset 5}
${offset 30}${voffset -23}${if_up wlp12s0}${downspeedf wlp12s0}$else${if_up enp0s25}${downspeedf enp0s25}$endif$endif k/s
Total Downloaded:${alignr}${totaldown wlp12s0} / ${totaldown enp0s25}
${color}${voffset 15}${font PizzaDude Bullets:size=16}M${font}${voffset -15} Upload:$alignr${voffset -5}${if_up wlp12s0}${upspeedgraph wlp12s0 22,150 cc5500 cc5500}$else${upspeedgraph enp0s25 22,150 cc5500 cc5500}$endif${voffset 5}
${offset 30}${voffset -23}${if_up wlp12s0}${upspeedf wlp12s0}$else${if_up enp0s25}${upspeedf enp0s25}$endif$endif k/s
Total Uploaded:${alignr}${totalup wlp12s0} / ${totalup enp0s25}
${voffset 3}${font FreeSans:size=16}@${font}${voffset -3} Wlan0: ${alignr}${addr wlp12s0}
${voffset 3}${font FreeSans:size=16}@${font}${voffset -3} Eth0: ${alignr}${addr enp0s25}
${voffset 3}${font FreeSans:size=16}@${font}${voffset -3} Public: ${alignr}${if_up wlp12s0}${texeci 1200 wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}$else${if_up enp0s25}${texeci 3600 wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}$else No Address$endif$endif
${stippled_hr 2}
${color}${voffset 3}${font StyleBats:size=16}V${font}${voffset -3} Upgrade(s): $alignr${texeci 60 cat /tmp/nbUpgrade.txt} Available
${color}${voffset 3}${font StyleBats:size=16}V${font}${voffset -3} Dist-Upgrade(s): $alignr${texeci 60 cat /tmp/nbDistUpgrade.txt} Available
${stippled_hr 2}
${color}${voffset 3}${font StyleBats:size=16}j${font}${voffset -3} Processes:${alignr}${running_processes} running / ${processes}
${color}${voffset 3}${font StyleBats:size=16}x${font}${voffset -3} Threads:${alignr}${threads} active
${voffset 2}${color}${font StyleBats:size=16}5${font}${voffset -2} NAME${alignr} PID CPU MEM
${color #ED0000}${top name 1} ${alignr}${top pid 1} ${top cpu 1} ${top mem 1}
${color #F23800}${top name 2} ${alignr}${top pid 2} ${top cpu 2} ${top mem 2}
${color #F76F00}${top name 3} ${alignr}${top pid 3} ${top cpu 3} ${top mem 3}
${color #FCA700}${top name 4} ${alignr}${top pid 4} ${top cpu 4} ${top mem 4}
${color #FFFF33}${top name 5} ${alignr}${top pid 5} ${top cpu 5} ${top mem 5}
${color}${hr}
${alignc}${font FreeSans:size=9}Horloge's script 4.0 on Conky ${conky_version string}${font}
]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment