AVLinux wrote: Mon Sep 26, 2022 3:23 pm
Very nice and formatted in a way I'd like to use as a template with an existing Conky I'm working on for Enlightenment, care to share your .conkyrc also please?
Sure!
Note that best formatting is achieved when using a (preferrably narrow) mono font. Below conkyrc calls for the
NK-57 Monospace condensed font, but of course any mono-font will do.
The dark rounded transparent background is drawn using a lua script called 'draw_bg.lua' (current path is ~/.conky/LUA/draw_bg.lua). If you have no need for it, then comment out the two respective lines 53+54 in the conkyrc .
system-inxi.conkyrc
Code: Select all
--[[
System-inxi
Web-find @wdscharff <https://forum.mxlinux.org/viewtopic.php?p=696967#p696967>
mod @ceeslans | Sept 2022
--]]
conky.config = {
update_interval = 1.0,
total_run_times = 0,
double_buffer = true,
no_buffers = true,
cpu_avg_samples = 1,
net_avg_samples = 1,
text_buffer_size = 4096,
use_spacer = 'none',
uppercase = false,
background = true,
own_window = true,
own_window_type = 'override',
own_window_transparent = true,
--own_window_argb_visual = true,
--own_window_argb_value = 0,
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager', --sticky,
own_window_class = 'Conky',
own_window_title = 'SysInxiConky',
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
stippled_borders = 0,
border_inner_margin = 15,
border_width = 1,
default_color = '#eeeeee',
default_shade_color = 'black',
default_outline_color = 'black',
use_xft = true,
font = 'Liberation Sans Narrow:size=9',
xftalpha = 1,
override_utf8_locale = true,
minimum_width = 0,
--minimum_height = 200,
gap_x = 160,
gap_y = 160,
alignment = 'bottom_right',
color2 = 'ffe068',
lua_load = '~/.conky/LUA/draw_bg.lua',
lua_draw_hook_pre = 'draw_bg',
};
conky.text = [[
${font nk57 monospace:regular:size=9}${execpi 10 inxi -v2 -p | sed 's@\x03@__COLOR__@g'| sed 's@__COLOR__12@\${color}@g' | sed -r 's@__COLOR__(04)?@\${color2}@g' | sed 's@Battery\s@Battery:@' }
]];
draw_bg.lua
Code: Select all
--[[
Background by londonali1010 (2009)
This script draws a background to the Conky window. It covers the whole of
the Conky window, but you can specify rounded corners, if you wish.
To call this script in Conky, use (if script is saved to ~/.conky/scripts/):
lua_load ~/.conky/scripts/draw_bg.lua
lua_draw_hook_pre draw_bg
Changelog:
+ v1.0 -- Original release (07.10.2009)
]]
-- ==============
-- == Settings ==
-- ==============
-- Change these settings to affect your background. "corner_r" is the radius
-- of rounded corners, in pixels. If you don't want rounded corners, use 0.
-- corner_r=0
-- corner_r=10
corner_r=16
-- Set the colour of your background.
bg_colour=0x000000
-- Set the transparency (alpha) of your background.
-- bg_alpha=0.10
-- bg_alpha=0.20
-- bg_alpha=0.25
bg_alpha=0.15
-- ==================
-- == Start script ==
-- ==================
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg()
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
cairo_fill(cr)
end