Magic Toolbox: A Modular "Mini-OS" Architecture (Launcher + Global Widget + Backend API) #8194
Unanswered
Userwei0418
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Trilium Community ,
I've been a long-time user of Trilium. With the UI changes in recent versions (removal of the custom toolbar), I found it challenging to organize my growing collection of custom scripts and buttons in the sidebar.
To solve this, I developed a modular architecture I call the "Magic Toolbox". I believe this pattern might offer some inspiration for future plugin/widget integrations in Trilium.
💡 The Concept
Instead of adding multiple buttons to the Launchbar, I created a single Global Widget (Host). This Host reads its child notes as Plugins.
Trilium = OS: The main note acts as a lightweight operating system.
Child Notes = Apps: Each child note (Text/Code) contains the logic for a specific tool.
This keeps the interface clean while allowing infinite extensibility.
✨ Features
Currently implemented modules
A centralized panel containing various utilities to boost your note-taking efficiency.
default.mp4
default.mp4
default.mp4
$symbols into renderable math formulas.default.mp4
default.mp4
default.mp4
AI.mp4
AI.mp4
AI.mp4
AI.mp4
default.mp4
default.mp4
🛠️ Technical Implementation
Architecture: Host-Plugin pattern.
Safety: Uses new Function sandbox for plugin execution.
Stability: Solved CKEditor unexpected-error crashes (when modifying complex DOMs like video widgets) by using a combination of document.execCommand and editor.setData() with smart content detection.
Shortcuts: Supports global shortcuts (e.g., Alt+F) defined via attributes (#shortcut) on child notes, utilizing capture-phase event listeners to handle browser conflicts.
🚀 Try it out
I have open-sourced this configuration. Users can import it as a zip file and start using it immediately (No complex coding required).
Repository / Download: https://github.com/Userwei0418/trilium-Magic-Toolbox
I hope this "Global Widget + Backend API" approach provides a new perspective on how we can extend Trilium's functionality!
Beta Was this translation helpful? Give feedback.
All reactions