Skip to main content

Module theme

Module theme 

Source
Expand description

Desktop-theme integration for [theme] mode = "system".

In the default custom mode tree-space reads its main.css. In system mode it instead builds the palette from the desktop theme and reuses the theme-independent structure of the shipped stylesheet, so main.css is neither required nor created.

Only Omarchy is implemented today. Its active theme lives at $XDG_STATE_HOME/omarchy/current/theme (~/.local/state/omarchy/current/theme by default) and carries the color palette in colors.toml; the UI font comes from fontconfig, the same source omarchy font current uses.

Structs§

Colors
The subset of Omarchy’s colors.toml that tree-space’s palette maps onto.
OmarchyTheme
The Omarchy theme currently applied, as read from disk.

Functions§

load_omarchy_theme
Read the active Omarchy theme, or None when Omarchy isn’t installed or its state directory is unreadable.
load_omarchy_theme_from
Read an Omarchy theme from an explicit directory (tests). The font is looked up through fontconfig.
omarchy_stylesheet
Build the stylesheet for Omarchy’s active theme, falling back to the shipped default when no theme can be read.
render
Render a full stylesheet from an Omarchy theme: the theme’s palette, then the theme-independent structure, then a font override so the panel follows the desktop font.
syntax_palette
The syntax-highlighting palette for the configured theme. Custom main.css mode is assumed dark (the shipped default); Omarchy mode maps the active theme’s colors so highlighting matches the panel. Falls back to the dark default when no theme can be read.