Linux - Member Desktop ScreenshotsThis forum is for the discussion and display of Linux Desktop screenshots. Please remember that many members browse LQ from work, so NSFW screenshots are not appropriate.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My conky is super simple, just a now playing for MPD. I am using Kunst to display the image as I find this a little more reliable than Conky for this. I also have a version of this conky that displays the cover too, but like I said it is a little hit and miss.
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824
Rep:
anyone with knowledge of LUA ?
my lua script is here :
Code:
--[[
Ring Meters by 1 (2009)
This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
lua_load ~/scripts/rings-v1.2.1.lua
lua_draw_hook_pre ring_stats
Changelog:
+ v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)
]]
settings_table = {
{
name='acpitemp',
arg='',
max=110,
bg_colour=0xE1E4E7,
bg_alpha=0.8,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=200, y=120,
radius=97,
thickness=4,
start_angle=0,
end_angle=240
},
{
name='cpu',
arg='cpu1',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.8,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=200, y=120,
radius=86,
thickness=13,
start_angle=0,
end_angle=240
},
{
name='cpu',
arg='cpu2',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.7,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=200, y=120,
radius=71,
thickness=12,
start_angle=0,
end_angle=240
},
{
name='cpu',
arg='cpu3',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.6,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=200, y=120,
radius=57,
thickness=11,
start_angle=0,
end_angle=240
},
{
name='cpu',
arg='cpu4',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.5,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=200, y=120,
radius=44,
thickness=10,
start_angle=0,
end_angle=240
},
{
name='memperc',
arg='',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.8,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=340, y=234,
radius=60,
thickness=15,
start_angle=180,
end_angle=420
},
{
name='swapperc',
arg='',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.4,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=340, y=234,
radius=45,
thickness=10,
start_angle=180,
end_angle=420
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.8,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=220, y=280,
radius=40,
thickness=10,
start_angle=0,
end_angle=240
},
{
name='fs_used_perc',
arg='/home',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.6,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=220, y=280,
radius=28,
thickness=10,
start_angle=0,
end_angle=240
},
{
name='fs_used_perc',
arg='/boot',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.4,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=220, y=280,
radius=16,
thickness=10,
start_angle=0,
end_angle=240
},
{
name='downspeedf',
arg='enp3s0','wlan0',
max=12500,
bg_colour=0xE1E4E7,
bg_alpha=0.8,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=290, y=346,
radius=30,
thickness=12,
start_angle=180,
end_angle=420
},
{
name='upspeedf',
arg='enp3s0','wlan0',
max=2500,
bg_colour=0xE1E4E7,
bg_alpha=0.6,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=290, y=346,
radius=18,
thickness=8,
start_angle=180,
end_angle=420
},
{
name='time',
arg='%S',
max=60,
bg_colour=0xE1E4E7,
bg_alpha=0.8,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=230, y=410,
radius=30,
thickness=12,
start_angle=0,
end_angle=240
},
{
name='time',
arg='%M',
max=60,
bg_colour=0xE1E4E7,
bg_alpha=0.6,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=230, y=410,
radius=18,
thickness=8,
start_angle=0,
end_angle=240
},
{
name='time',
arg='%H',
max=24,
bg_colour=0xE1E4E7,
bg_alpha=0.4,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=230, y=410,
radius=10,
thickness=4,
start_angle=0,
end_angle=240
},
--[[
{
name='battery_percent',
arg='BAT1',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.6,
fg_colour=0x5294E2,
fg_alpha=0.8,
x=274, y=464,
radius=18,
thickness=10,
start_angle=180,
end_angle=420
},
{
name='',
arg='',
max=100,
bg_colour=0xE1E4E7,
bg_alpha=0.6,
fg_colour=0x5294E2,
fg_alpha=0.6,
x=274, y=464,
radius=3,
thickness=13,
start_angle=0,
end_angle=360
},
]]
}
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 draw_ring(cr,t,pt)
local w,h=conky_window.width,conky_window.height
local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
local angle_0=sa*(2*math.pi/360)-math.pi/2
local angle_f=ea*(2*math.pi/360)-math.pi/2
local t_arc=t*(angle_f-angle_0)
-- Draw background ring
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)
-- Draw indicator ring
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)
end
function conky_ring_stats()
local function setup_rings(cr,pt)
local str=''
local value=0
str=string.format('${%s %s}',pt['name'],pt['arg'])
str=conky_parse(str)
value=tonumber(str)
if value == nil then value = 0 end
pct=value/pt['max']
draw_ring(cr,pct,pt)
end
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
local cr=cairo_create(cs)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
for i in pairs(settings_table) do
setup_rings(cr,settings_table[i])
end
end
cairo_surface_destroy(cs)
cairo_destroy(cr)
end
...
conky: llua_do_call: function conky_ring_stats execution failed: attempt to call a nil value
conky: llua_do_call: function conky_ring_stats execution failed: attempt to call a nil value
...
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824
Rep:
Quote:
Originally Posted by Bindestreck
I think your battery arg is fishy. Try change
Code:
arg='BAT1',
to
Code:
arg='BAT0',
As a note, I see your acpitemp is set to 0 as well as your cpu usage. Is that really right? Do you have 4 CPUs/threads?
sorry guys, i were just trying to get lua scripts to work with my conkyrc, i managed to get those "rings" working after reading few lua scripts and experimenting with conky, i had to change conky to conky-lua-nv.
i actually have 12 core ryzen, i tried to make conky to show usage of 12 cores, it looked really ugly so i made conky to show average usage % of the cpu.
like this :
Code:
${font Play:normal:size=8}${voffset 50}${goto 100}${color1}Average use ${alignr 320}${color1}${cpu cpu0}%
is there a way to get conky to show traffic in kilobytes - megabytes (using lua) ?
i have tried to RTFM but i haven't found good tutorials. i am mostly interested in lua atm.
this is how it looks now, i havent finished it , just trying to learn to use lua scripts with conky.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.