A lightweight, self-contained JavaScript frontend script for Trilium Notes that gives each instance a clear visual identity inside your browser.
This is especially useful if you run multiple Trilium server instances (e.g., Work, Personal, Lab) and often have several browser tabs open at once. If you only run the desktop app, you may not benefit from this script.
Trilium Notes makes it easy to run multiple server instances (for example: Work, Personal, and Lab), and to open them in separate browser tabs. The downside is that all of those tabs can look very similar at a glance.
This script was created to solve one simple problem:
βWhen I have several Trilium tabs open, I want to instantly see which one is which.β
By adding a bold text prefix, optional border, and optional custom favicon per instance, it becomes much easier to distinguish:
- which tab is Work
- which tab is Personal
- which tab is Lab
- which tab is your βprimaryβ instance vs. others
If you only use the standalone desktop app, you may not need this script. Itβs primarily intended for browser-based access to multiple Trilium server instances.
- β Bold tab prefix showing which instance you're looking at
- π Per-instance color branding
- π€ Optional custom favicon (colored background + letter)
- πΌ Optional browser-wide colored border
- βοΈ Fully customizable through a simple config block
- π§± Pure JavaScript (frontend) β no server modifications
- π Works in any browser where the Trilium UI loads
- In Trilium, create a new note anywhere you like (I like to sub them under a "Trilium Add-Ons" note to keep things tidy.
- Set the note type to Code
- Set the language to JavaScript (frontend)
Copy the contents of trilium-instance-identity.js from this repository
and paste it into the new Code note.
Edit this block at the top of the script:
// ==== CONFIG PER INSTANCE ====
// Type this in NORMAL letters. Script will bold it for you.
const PLAIN_PREFIX_TEXT = "INSTANCE NAME"; // becomes [ππ‘π¦π§ππ‘ππ π‘ππ π] in the browser tab
const COLOR = "#1e88e5"; // border + favicon background
const LETTER = "C"; // favicon letter
const LETTER_COLOR = "#ffffff"; // favicon letter color
const USE_FAVICON = true; // true = custom icon, false = default Trilium icon
const USE_BORDER = true; // true = draw border
const BORDER_THICKNESS = 6; // border width in pixels
// =============================Use a different prefix and color for each instance so the tabs are easy to distinguish.
This step can be confusing.
That may NOT work.**
Instead:
- Select the Code note
- Click the Attributes sidebar
- Click the + button
- Add a new attribute
- Name:
run - Value:
frontendStartup
- Name:
- Save the attribute
Trilium will automatically display it as:
#run=frontendStartup
For best results, users should follow this exact method as copy/pasting the text might not create a real attribute.
Press Ctrl + F5.
You should now see:
- The tab label
- Optional colored border
- Optional custom favicon
Repeat the process for each instance you run.
If you use the desktop app and connect it to a server instance that has this script enabled:
- The border will also appear around the desktop app window, because the script runs inside the embedded browser engine.
- If you prefer your desktop app to have no border, simply:
- Keep
USE_BORDER = falsefor that instance - Or create a separate βdesktop copyβ of the script with a different config
- Keep
This is normal behavior.
const PLAIN_PREFIX_TEXT = "WORK";
const COLOR = "#1e88e5";
const LETTER = "W";
const LETTER_COLOR = "#ffffff";
const USE_FAVICON = true;
const USE_BORDER = true;
const BORDER_THICKNESS = 6;const PLAIN_PREFIX_TEXT = "PERSONAL";
const COLOR = "#43a047";
const LETTER = "P";
const LETTER_COLOR = "#ffffff";
const USE_FAVICON = true;
const USE_BORDER = true;
const BORDER_THICKNESS = 6;const PLAIN_PREFIX_TEXT = "LAB";
const COLOR = "#f27d30";
const LETTER = "L";
const LETTER_COLOR = "#000000";
const USE_FAVICON = true;
const USE_BORDER = true;
const BORDER_THICKNESS = 8;- Ensure the note actually has the attribute
(created using the + button as described above) - Hard-refresh (
Ctrl + F5) - Make sure it's a JavaScript (frontend) Code note
- Browsers cache favicons aggressively
- Close and reopen the tab
- Verify
USE_FAVICON = true
- Confirm
USE_BORDER = true - Try increasing thickness
- Confirm the color is valid (
#RRGGBB)
This script was developed and tested with:
- Trilium Notes: 0.99.5
- Browsers:
- Firefox (latest)
- Microsoft Edge (latest)
- Google Chrome (latest)
Because the script runs entirely in the browser UI, it should work in any browser that can load the Trilium web interface.
Behavior in older Trilium versions has not been tested.
A few visual examples of how the script customizes each Trilium instance.
This project is provided as-is.
Youβre welcome to open GitHub issues for bugs or suggestions but you might be on your own.
Pull requests are welcome.
Created by Br0kenSilos with assistance from ChatGPT.
Huge thanks to the people who make Trilium possible:
-
@zadam, the original author of Trilium Notes, for creating one of the most powerful, flexible, and life-changing personal knowledge management systems available today.
-
@eliandoran and the Trilium Next team, for picking up the project, modernizing it, and keeping the ecosystem healthy and moving forward.
-
If you are user of Trilium notes, please consider donating to the dev team to help them keep it going!
This script is an unofficial user customization and is not affiliated with or endorsed by the Trilium or Trilium Next projects. It was built simply because Trilium is awesome β and because running multiple instances in browser tabs can get confusing without some extra visual identity.
This project is licensed under the MIT License.





