Conky Basic

Conky

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

1
Score 58.0%
Description:

Conky Basic displays only the most basic information about your system.
In the lua file you can change the color scheme used by Conky Basic, show all CPU cores or not and set a battery alert level.
You can also choose what to display, only CPU, storage, memory , details about storage etc..

Thanks to autocrosser1 and soundrolf for their ideas and code contributions

When using a laptop don't forget to set the show_battery option to yes.

If you modified Conky Basic make a backup of your files first before installing this version !!!

Installation
- unpack source file
- copy the file .conkybasic to your home directory
- copy the file .conkybasic_c110 to your home directory
- copy the basic folder into ~/.lua
- install the Unique font in ~/.lua/basic

Start conky via 'conky -c .conkybasic -q'
If you are using Conky version 1.10.0 start conky via 'conky -c .conkybasic_c110 -q'

Keep in mind that Conky 1.10.0 uses a new configuration file format and is still work in progress. That's why I used some work-arounds to get things working, so your mileage may vary.
Last changelog:

Version 1.6 2 years ago

- Changed network and battery detection

C

Moob

4 years ago

Nice addition soundrolf

Report

C

Moob

4 years ago

hi soundrolf, I have just put a new version online which has a Radiotray tab. Just enable the user preference to make the tab visible.

Report

C

Moob

4 years ago

hi soundrolf, I have a raw version working at the moment, still need to do some fine-tuning though about displaying text.

When it's ready I put it in the next version.

Report

C

Moob

4 years ago

Well, spoke to soon. v0.5 still does work with ${cpu cpu2). Strange things is that if you put that same command in the TEXT [[]] in the rc file, the lua part works. Don't ask me why.

I will look if the radio part is possible autocrosser :)

Report

C

Moob

4 years ago

Well, a quick and dirty workaround did the trick. In the .conkybasic_c110 file I put a ${cpu cpu1} call and set it offscreen. Then the lua part gets correctly processed and displays the CPU cores in Conky 1.10.0

Report

autocrosser1

4 years ago

Yes--that works :) I have 8 showing...Now a "odd one" and a couple of questions.

For some reason my /home is being shown as a separate "Root"--not sure why.

I wrote a couple of additional segments "CPU_Processes" & MEM_Processes"...they work, but when I move them around I get errors..Not sure how to add extra segments in....The cpu segment looks like this:

-- parameters idem conky_wired_tab_cpu_proc
function conky_wired_tab_cpu_proc(x,y,width,height,text,font,font_size,r,g,b)
local vuheight=15 --VU barheight
local onebarheight=vuheight+8
local basey=y
local barfs=12 -- VU bar fontsize

if height <= 60 then
print("ERROR conky_wired_tab_cpu_proc: insufficient height. Must be higher than 60")
return
end

local aspect=math.floor(height/60)
local corner_radius = height / 10.0
local radius = corner_radius / aspect
local degrees = math.pi / 180.0

-- draw text
conky_lctexta(x+width,y+15,text,font,font_size,r,g,b)
-- draw tab
cairo_new_sub_path (cr)
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
cairo_set_source_rgba (cr, r,g,b,.6)
cairo_set_line_width (cr, 2)
cairo_stroke (cr)

conky_lctext(x+6,y+onebarheight+8,conky_parse("${top name 1}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+onebarheight+8,conky_parse("${top cpu 1}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+44,conky_parse("${top name 2}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+44,conky_parse("${top cpu 2}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+56,conky_parse("${top name 3}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+56,conky_parse("${top cpu 3}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+68,conky_parse("${top name 4}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+68,conky_parse("${top cpu 4}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+80,conky_parse("${top name 5}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+80,conky_parse("${top cpu 5}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)

return (x+width),(y+height)

end -- conky_wired_tab_cpu_proc

Second question is what is the easiest way to shuffle the order of the segments?

Report

C

Moob

4 years ago

[For some reason my /home is being shown as a separate "Root"--not sure why.]
I only checked for the existance of a forward slash in a mountpoint name so it also caught /home as well.
On row 866 change the if statement in "if string.len(v) == 1 and r == 1 then" should fix that.
I will add this fix in the next release.

[what is the easiest way to shuffle the order of the segments?]
At the top of the code you find several "if show_memory == "yes" then [[code]] end" blocks to determine if a tab must be shown or not.
To rearrange the order of the tabs just cut and past a "if show_* then [[code]] end" block and place it below or above an other if/end block.

If you want to put a tab above the 'Processor' tab change the starty variable in the conky_wired_tab_cpu call to "rety+tabvsep"
I will add this change in the next release

I will add the "own_window_argb_visual = true" configuration option in the next release

Thanks for your feedback.

Report

autocrosser1

4 years ago

??? I just downloaded again & the basic.lua only goes to line 848.....line 866?

I also did a string search & that one is not showing up.


Clarify please.

Report

autocrosser1

4 years ago

Never mind---found the line to replace......

Report

autocrosser1

4 years ago

Thanks..I'll give it a try...

Report

autocrosser1

4 years ago

For a few moments it will display with 8 CPUs & try to start working, then it throws the "trying to use more cpus than you have" error & folds... Looked great while it was trying to work...Maybe someone playing with 1.10 over at Arch or Siduction might have a idea....If I find out anything I'll post it.

Thanks for trying!!!!

Report

autocrosser1

4 years ago

Tried with the option -1 & conky did not like that :( without it I get a cpu error:

dean@linux:~$ '/home/dean/.conky/conky-startup.sh'
conky: invalid option -- '1'
dean@linux:~$ '/home/dean/.conky/conky-startup.sh'
conky: no process found
conky: desktop window (a00033) is subwindow of root window (293)
conky: window type - desktop
conky: drawing to created window (0x1000001)
conky: drawing to double buffer
conky: obj->data.i 6 info.cpu_count 0
conky: attempting to use more CPUs than you have!

Report

C

Moob

4 years ago

To bad :(
I had the same error about 'conky: attempting to use more CPUs than you have!' and thought I had it fixed. It does seem to work on my Ubuntu 15.10 though. You could try to set the squash_cpu option.

Otherwise it's time to go back to version 1.9.0

Report

autocrosser1

4 years ago

this conky config works for 1.10 (throws no errors at the start) Still has the line 670 error for the lua script.

Mod for 1.10 (anointed for editing):

conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = true,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,

double_buffer = true,
background = false,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.1,
override_utf8_locale = true,
font = 'DejaVu Sans Mono:size=12',
uppercase = false,

draw_borders = false,
draw_outline = false,
draw_shades = false,
border_width = 0,
stippled_borders = 0,

-- ------------------------- Color
default_color = 'white',

-- ------------------------- Other
update_interval = 1,
cpu_avg_samples = 2,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_stderr = false,
extra_newline = false,
show_graph_scale = false,
show_graph_range = false,
draw_graph_borders = false,

-- ------------------------- Position
alignment = 'top_right',

minimum_width = 200,
minimum_height = 750,
maximum_width = 200,
gap_x = 5,
gap_y = 30,

-- ------------------------- Lua scripts
lua_load = '~/.conky/basic.lua',
lua_draw_hook_pre = 'main',
};

conky.text = [[
]]

Report

C

Moob

4 years ago

I've just put the new version online which I tested on Ubuntu 15.10 with Conky 1.10.0 Should work on your system also, hopefully :)

Report

autocrosser1

4 years ago

Looks like this:

conky.config = {
alignment = top_right,
background = no,
double_buffer = yes,
border_width = 0,
cpu_avg_samples = 2,
default_color = white,
draw_borders = no,
draw_graph_borders = no,
draw_outline = no,
draw_shades = no,
use_xft = yes,
font = 'DejaVu Sans Mono:size=12',
gap_x = 5,
gap_y = 30,
minimum_height = 5,
minimum_width = 5,
net_avg_samples = 2,
no_buffers = yes,
out_to_console = no,
out_to_stderr = no,
extra_newline = no,
own_window = yes,
own_window_class = Conky,
own_window_type = desktop,
own_window_transparent = yes,
stippled_borders = 0,
update_interval = 1.0,
uppercase = no,
use_spacer = no,
show_graph_scale = no,
show_graph_range = no,
maximum_width = 200,
--lua_load ~/.lua/basic/basic.lua,
--lua_draw_hook_pre main,
}
conky.text = [[
]]

The errors I get are:

dean@linux:~$ '/home/dean/.conky/conky-startup.sh'
conky: no process found
conky: desktop window (a00033) is subwindow of root window (293)
conky: drawing to desktop window
conky: can't load font 'DejaVu Sans Mono:size=12'
conky: can't load font 'DejaVu Sans Mono:size=12'
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 55 (X_CreateGC)
Serial number of failed request: 196
Current serial number in output stream: 198

Report

autocrosser1

4 years ago

I just turned this up from a Arch forum: https://bbs.archlinux.org/viewtopic.php?id=199217

Looks promising.

Report

autocrosser1

4 years ago

Forgot to edit the conky file for my location(s).

REAL problem is now:

$ '/home/dean/.conky/conky-startup.sh'
conky: Syntax error (/home/dean/.conky/conkyrc_basic:1: '=' expected near 'top_right') while reading config file.
conky: Assuming it's in old syntax and attempting conversion.
conky: desktop window (a00037) is subwindow of root window (293)
conky: window type - desktop
conky: drawing to created window (0xe00001)
conky: drawing to double buffer
conky: unknown variable '$pre_exec'
conky: unknown variable '$pre_exec'
conky: llua_do_call: function conky_main execution failed: /home/dean/.conky/basic.lua:670: 'for' limit must be a number
conky: unknown variable '$pre_exec'
conky: unknown variable '$pre_exec'
conky: llua_do_call: function conky_main execution failed: /home/dean/.conky/basic.lua:670: 'for' limit must be a number

This repeats until conky is killed.

Report

autocrosser1

4 years ago

I just remembered from my programming in python---

conky: llua_do_call: function conky_main execution failed: /home/dean/.conky/basic.lua:670: 'for' limit must be a number

Is referring to for i=1,tonumber(hardware.cpucores) do
cpucores[i]=i

is not converting to a number-staying as text?

Report

C

Moob

4 years ago

Well, it's definitively a conky version problem. Just updated my test system to Ubuntu15.10 which has conky 1.10.0 and I've got all the errors you described, $pre_exec, for 'limit must be a number' etc.

I will look in to it to see what needs to be changed.

In the mean time this script will only function correctly with conky version 1.9

Report

autocrosser1

4 years ago

Ah Well--it's what I pay for doing testing work...I have to admit that Sid has been very stable of late. I had to rebuild my install about a month ago & nothing has gone "wrong" lately (crossing my fingers as I say this). I keep a second install updated every week as a backup. It is "fun" to get software that needs to be debugged--I do enjoy the challenge.

Report

C

Moob

4 years ago

Yep, that's the price of living on the edge :-)

The $pre_exec, for 'limit must be a number' errors I solved but now it keeps giving me errors on cpu. For some reason ${cpu cpu0} works wel but ${cpu cpu1} keeps on exiting conky

Still busy testing on conky 1.10.0

Report

autocrosser1

4 years ago

Looking forward to checking it out....

Report

C

Moob

4 years ago

If you change the code into the following:
hardware.cpucores =tonumber(conky_parse("${pre_exec cat /proc/cpuinfo | grep 'processor' | wc -l}"))
for i=1,hardware.cpucores do
cpucores[i]=i
end

Do you still get the 'as a number' error message than ?

Report

C

Moob

4 years ago

Strange that you get all those error messages while on my system I get no error message at all.

I will see if I can test my script with conky 1.10 as it complains about the top_right parameter in the conkyrc file. My guess is that it has something to do with a difference between conky versions.

Report

Version 1.6 2 years ago

- Changed network and battery detection

Changelog 1.5 2 years ago

v 1.5 Added network interface display. Rearranged high CPU temperature check
v 1.4 IP address fix, distribution name fix, some minor fixes.
v 1.3 Changed disk detection so CD/DVD devices are also shown correctly

Version 1.2 3 years ago

Changed CPU high temperature limit detection

Changelog v1.1 3 years ago

Added check for eth1 and wlan1
Changed own_prexec function to prevent running out of file handles
Limit displayed diskname to 15 characters

Changelog v 1.0
Added system CPU speed and temperature details
Added disk details
Added network details

4 years ago

Version 0.9
Changed text scroller
Changed system information
Added Audacious extended information

Version 0.8.1
Added Audacious detection in Radiotray

Version 0.8
Added LAN text to fixed network
Changed Radiotray text
Added clock to radiotray when not active
Added system information to the radiotray. This is visible when not listening to music
Added user preference for showing system information or not.
Added user preference for the maximum number of processes to show
Added rhythmbox detection in Radiotray
Changed text_buffer_size to 512 in .conkyrc to accommodate Rhythmbox metadata
Added extra battery location
Minor cosmetic changes

Version 0.7
Added process tab

Version 0.6
Moved Conky 1.10.0 CPU workaround from configuration file to lua file
Change / detection as it also displayed /home as / instead of home
Minor cosmetic changes
Added Radio Tray tab as per request by soundrolf

Version 0.5.1
Change CPU display code. Should work fine in Conky 1.10 now, with a work-around in the conkybasic_c110 file

Version 0.4
Minor change in CPU detect function
Corrected display for only 1 CPU present
Changed CPU value pass-through to other functions
Tested with conky 1.10.0
Add conky version detection and 1.10.0 workarounds

Version 0.3
Major code overhaul. Every tab now has it's own function
Added disklabel length check
Changed battery display
Changed CPU detection from 'core id' to 'processor'. Core i7 processors should be correctly shown now.

Version 0.1 new

12345678910
1
product-maker soundrolf Nov 10 2015 9 excellent
product-maker Base: 4 x 5.0 Ratings
no95typem
May 09 2019
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
Version 1.6
updated Sep 11 2017
added Oct 24 2015
downloads 24h
1
mediaviews 24h 0
pageviews 24h 6