contrib: add a lua module allowing to display cdba board status with conky - #99
Open
brgl wants to merge 1 commit into
Open
contrib: add a lua module allowing to display cdba board status with conky#99brgl wants to merge 1 commit into
brgl wants to merge 1 commit into
Conversation
…conky Conky is a light-weight system monitor that can be easily customized with lua scripts. This adds a module that can be directly loaded via conky.conf and be used to display information about current usage of boards controlled by cdba. Put the script under a new directory: contrib/. It'll be used to store misc files that don't fit anywhere else. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
lumag
reviewed
Sep 3, 2026
| local unistd = require("posix.unistd") | ||
|
|
||
| local function read_cdba_cfg() | ||
| local fd = assert(io.open("/home/cdba/.cdba", "r")) |
Contributor
There was a problem hiding this comment.
System-specific details. Also cdba might be using a central db (/etc/cdba) instead.
Author
There was a problem hiding this comment.
Any suggestion on how to handle that?
Contributor
There was a problem hiding this comment.
Use posix.getpwnam to locate cdba's home dir. If ~cdba/.cdba doesn't exist, resort to /etc/cdba.
lumag
reviewed
Sep 3, 2026
| return "ERROR: " .. err | ||
| end | ||
|
|
||
| local lock = match_lock(locks, st) |
Contributor
There was a problem hiding this comment.
Would it be easier to use luaflock instead of parsing /proc/locks?
Author
There was a problem hiding this comment.
No, that requires CAP_SYS_PTRACE, my solution does not as it uses info available to an unprivileged user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conky is a light-weight system monitor that can be easily customized with lua scripts.
I'm running my cdba lab with a small display using conky to display system information. I wrote this lua script that uses the information about the cdba lock files and the cdba config to determine which boards are being used and for how long.
It can be easily integrated into conky.conf like so:
I figured it may be useful to others and it makes sense to carry it in the cdba repo.