-
-
Notifications
You must be signed in to change notification settings - Fork 1
Theme Layout
Every theme Conky Studio installs or builds lives as a folder under ~/.config/conky/<Name>/ (and optionally ~/.conky/). Two files at the root of that folder matter most for the Manager and for day-to-day use:
| File | Role |
|---|---|
start.sh |
How the HUD is launched and stopped (Conky + background pollers) |
theme.json |
How the Manager names, describes, and lists the theme |
Neither file is required for Conky itself to draw if you run conky -c conky.conf by hand, but Studio’s Manager, install flow, and generated themes all assume this layout.
~/.config/conky/<ThemeName>/
├── theme.json # metadata for Manager/library
├── start.sh # single entry point to run the HUD
├── conky.conf # Conky config (window, lua-draw-hook, …)
├── render.lua # Cairo draw + data glue (Studio codegen)
├── preview.png # optional thumbnail in Manager
├── README.md # optional; viewable/editable in Manager
├── LICENSE # optional
├── images/ # assets referenced by the theme
├── fonts/ # optional; auto-installed on import
├── scripts/ # sensors, weather, custom, album-art helpers
└── .runtime-cache/ # created at run time (key=value caches, art)
Themes without theme.json still appear in the Manager if they have start.sh or conky.conf; metadata is then guessed from the folder name until you generate or edit theme.json.
Purpose: one command that starts the whole HUD cleanly: Conky plus any daemon-mode background scripts (GPU/CPU sensors, weather, public IP, Now Playing, album art, unwired Custom Script daemons, etc).
Studio generates start.sh at Build time (codegen/start_sh_gen.py). Hand-written themes can use the same pattern.
-
Conky alone is not enough when data comes from external scripts that write cache files. Those scripts must keep running on a timer;
${execi}handles only the “Conky polls a one-shot command” case. - Single instance. Launching the same theme twice should replace the old run, not stack two HUDs and two poller sets.
- Clean shutdown. Stopping the theme should kill Conky and the poller loops together.
-
Manager/double-click. The Manager’s Start button runs
start.sh(viaQProcess.startDetached). Users can also run~/.config/conky/<Name>/start.shfrom a terminal or.desktopfile with no Studio open.
-
setsidre-exec
First launch re-executes undersetsidso Conky and every background loop share one process group. Killing that group stops everything. -
PID lock file
Path like$XDG_RUNTIME_DIR/<theme-name>.pid(or/tmp/…). If a previous instance is still alive, it is sentTERM(thenKILL) to the process group before the new instance continues. -
Runtime cache dir
mkdir -p "$DIR/.runtime-cache"— where daemon scripts write*.cacheand album-art images. -
chmod scripts
Ensuresscripts/*.share executable. -
Daemon families
For each daemon-mode family the project actually needs:- one immediate run (
script.sh &) so the first frame is not empty - one
while true; do sleep N; script.sh; donebackground loop
Interval
Ncomes from the shortestpoll_intervalamong nodes in that family.Included even when unwired: daemon Custom Script nodes (legacy pure-Lua themes still read
sensors.cache/weather.cachefrom Custom Lua). Album Art is always treated as daemon-style (writes an image file, not a single stdout value). - one immediate run (
-
exec conky -c "$DIR/conky.conf"
Replaces the shell with Conky so the lock PID is the session leader the Manager can track.
- It does not draw anything itself.
- It does not poll execi-mode sources (Conky’s
${execi N …}does that). - It does not install fonts or edit
theme.json.
-
Manager → Stop (or a second Start of the same theme): uses the lock PID and kills the process group (
killpg/same idea as insidestart.sh). - Deleting the lock file after a crash is enough for the next Start to proceed;
start.shalso overwrites a stale lock when the old PID is gone.
Purpose: a small metadata manifest so the Manager can show a library without scanning conky.conf or guessing from Lua.
Defined by model/theme_meta.py. Filename is always theme.json at the theme root.
- Library UI — name, author, version, description, resolution in the list and detail pane.
-
Search/tags — optional
tags[]for filtering later or in docs. -
Dependencies — optional
requires[](e.g.lua-cairo, tools a README might also mention) for pre-launch checks or documentation. -
Store/updates — optional
store_id/sha256when a theme came from a catalogue (not required for local builds). -
Stable identity — folder name can differ from display
name; Manager preferstheme.json.
| Field | Meaning |
|---|---|
name |
Display name in Manager |
author |
Credit line |
version |
Theme version string (not Conky Studio’s app version) |
description |
Short blurb under the title |
resolution |
Target/design resolution hint (e.g., 1920x1080) |
requires |
List of human-oriented dependency tokens (default includes lua-cairo) |
tags |
Optional keywords |
created_with |
e.g., conky-studio
|
store_id / sha256
|
Optional; omitted from tidy hand-authored files when unset |
Example:
{
"name": "Night Ops",
"author": "you",
"version": "1.0.0",
"description": "Compact system + weather strip",
"resolution": "1920x1080",
"requires": ["lua-cairo"],
"tags": ["dark", "minimal"],
"created_with": "conky-studio"
}-
Scan (
manager/scanner.py): each subdirectory of~/.config/conkyand~/.conkythat looks like a theme is listed. Withtheme.json, metadata is loaded from disk; without it, name is the folder name and description notes that metadata was guessed. -
Install archive (
manager/installer.py): after extract, prefersnamefromtheme.jsonfor the destination folder title when present. -
Generate / Edit: Manager can create a starter
theme.jsonor open an in-place JSON editor (validates JSON on Save). -
Duplicate: copies the tree and updates
nameinsidetheme.jsonwhen possible.
- It is not read by Conky or
render.luaat draw time. - It does not control FPS, gaps, or node graph (those live in the Studio project /
conky.conf/render.lua). - Changing
theme.jsondoes not require rebuilding the theme unless you also change assets or scripts.
| Action | start.sh |
theme.json |
|---|---|---|
| Build from Studio | Generated next to conky.conf / render.lua / scripts/
|
Written or updated as theme metadata for export/install |
Install .zip / .tar.gz
|
Made executable; used for Start | Drives display name when present |
| Manager Start/Stop | Executed/process-group killed | Only for listing and detail text |
| Run without Studio |
./start.sh from the theme folder |
Unused by Conky |
| Hand-made classic theme | Optional but recommended if you use daemon scripts | Optional; Manager still lists the folder |
Rule of thumb:
-
start.sh= run the living theme (process tree + Conky). -
theme.json= describe the theme in the library (identity and docs).
| Path / module | Role |
|---|---|
codegen/start_sh_gen.py |
Builds start.sh from daemon families in the project |
codegen/shell_gen.py |
Dual-mode (--key / full cache) scripts under scripts/
|
model/theme_meta.py |
ThemeMeta schema and load/save |
manager/scanner.py |
Finds installed themes |
manager/installer.py |
Extract, font install, duplicate, export zip |
manager/process.py |
Start/Stop via lock PID and process group |
ui/manager_tab.py |
Manager UI: list, Start/Stop, theme.json & README editors |
See also: Theme Architecture & Codegen Pipeline, Node Reference — Sources (daemon vs execi), Legacy Import.