Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omarchy-logseq-theming

Themes Logseq with your current Omarchy theme, and re-themes it whenever you switch themes.

Works with every Omarchy theme that ships a colors.toml, including your own. No fork of Omarchy, no patched files inside Omarchy's own install directory, nothing that an omarchy update can undo.

Supports Omarchy 4 ("Quattro"), which moved the generated theme into ~/.local/state/omarchy, and earlier releases, which kept it in ~/.config/omarchy.

Screenshots

The same page in the same Logseq, one theme switch apart.

SpaceX Terrafab Theme

Logseq themed with SpaceX Terrafab

Get it: omarchy-spacex-terrafab-theme

Quattro Theme

Logseq themed with Quattro

Get it: omarchy-quattro-theme

Install

git clone https://github.com/AlexZeitler/omarchy-logseq-theming \
  ~/.local/share/omarchy-logseq-theming

~/.local/share/omarchy-logseq-theming/install.sh

That is it. Logseq watches custom.css and repaints itself, so a running instance picks up the theme without a restart. Same on every later theme switch.

To update later:

git -C ~/.local/share/omarchy-logseq-theming pull

No reinstall needed. The installer links the files instead of copying them.

How it works

Omarchy already has both hooks this needs. install.sh only creates two symlinks:

~/.config/omarchy/themed/logseq.css.tpl : A template with Logseq's --ls-* CSS variables and Omarchy's colour placeholders. On every theme switch, omarchy-theme-set-templates fills it from the theme's colors.toml and writes the result into the current theme directory as logseq.css. This is the same mechanism Omarchy uses for Obsidian, Alacritty and btop.

~/.config/omarchy/hooks/theme-set.d/logseq : A hook that omarchy-theme-set runs at the end of every theme switch. It copies the generated CSS into <graph>/logseq/custom.css for every graph.

Both symlinks live under ~/.config/omarchy, which belongs to you. Omarchy updates never write there, so the setup survives them.

The current theme directory is ~/.local/state/omarchy/current/theme on Omarchy 4 and ~/.config/omarchy/current/theme on earlier releases. The hook tries the first path and falls back to the second.

Your own CSS is safe

The hook writes into a marked section at the end of custom.css:

/* >>> omarchy-logseq: begin, do not edit >>> */
...
/* <<< omarchy-logseq: end <<< */

Everything outside those markers is left alone. On the next theme switch, only the section between them is replaced.

Graphs

By default the hook derives graph paths from the file names under ~/.logseq/graphs/. If a graph is missed, list the paths explicitly, one per line:

mkdir -p ~/.config/omarchy-logseq
cat > ~/.config/omarchy-logseq/graphs <<'EOF'
~/Documents/notes
/mnt/data/second-brain
EOF

That file takes precedence over auto-detection.

Per-theme overrides

A theme may ship its own logseq.css. Omarchy copies theme files before it renders templates and never overwrites what is already there, so a theme's own file wins over this template.

Uninstall

~/.local/share/omarchy-logseq-theming/uninstall.sh

This unlinks both files and removes the marked section from every custom.css.

Notes

  • Logseq has no global stylesheet. CSS lives per graph, in <graph>/logseq/custom.css. That is why this needs a hook and not just a template.
  • The template targets both html[data-theme="dark"] and html[data-theme="light"], so Logseq's own light/dark toggle no longer changes the palette. The Omarchy theme decides.
  • Shades are built with color-mix(), which Logseq's Electron runtime supports.

About

Omarchy theming support for LogSeq

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages