Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Theme

theme.toml sets how everything looks, for every module at once. Views only use these values, never their own, so a change here restyles the whole shell. mochi reload applies it at once.

The defaults are “Obsidian”: a black island that disappears into the screen’s bezel, graphite cards on it, and one accent color for what’s active or important.

Presets and light mode

preset picks a theme, a color for every role: obsidian, catppuccin, nord, gruvbox, rose-pine, tokyo-night, or one you installed, see Theme packages. Each has a dark and a light version, which appearance picks: "dark", "light", or "auto" to follow the system’s preference through the desktop portal, switching as it changes. What [colors] sets goes over the preset, so you can keep a preset and change only the accent.

preset = "wallpaper" makes the palette from your wallpaper: the accent from its most colorful hue, and the backgrounds from the same hue nearly grey, with lightness chosen so text stays readable. wallpaper = "auto" reads the image, or the plain color, that awww, swww or hyprpaper shows; a path reads that image. mochi reload reads it again after the wallpaper changes.

The settings panel lists the presets with their colors, and applies them as you pick. A preset picked there replaces the colors [colors] sets, in the file and in the panel, so you see that theme. Copy then gives the preset without them, for your own files.

Theme packages

A theme is a directory with a mochi-theme.toml. Installed ones live in ~/.local/share/mochi/themes/<id>/ ($XDG_DATA_HOME/mochi/themes), and preset = "<id>" picks one like the themes Mochi brings, which are written the same way:

[theme]
id = "nord"
name = "Nord"
version = "1.0.0"
mochi = "0.0.8"
description = "Arctic blues and frost"
authors = ["Mochi"]
homepage = "https://www.nordtheme.com"

[dark]
background = "#f52e3440"
surface    = "#3b4252"
raised     = "#434c5e"
highlight  = "#4c566a"
foreground = "#eceff4"
muted      = "#a3abb9"
accent     = "#88c0d0"
on_accent  = "#2e3440"
danger     = "#bf616a"
success    = "#a3be8c"
border     = "#0dffffff"
shadow     = "#59000000"

[light]
background = "#f5eceff4"
surface    = "#e5e9f0"
raised     = "#d8dee9"
highlight  = "#c8d0dc"
foreground = "#2e3440"
muted      = "#4c566a"
accent     = "#5e81ac"
on_accent  = "#eceff4"
danger     = "#bf616a"
success    = "#6f8f55"
border     = "#1a000000"
shadow     = "#26000000"

[theme] says what it is. id is lowercase letters, digits, - and _, starting with a letter, and must match the directory’s name. name is what the settings panel shows, and mochi is the oldest Mochi it works with: a newer one is refused, and mochi config check says so. description, authors and homepage are optional.

[dark] and [light] give each role a color, the roles of [colors] below. A theme with only one of them uses it for both appearances, so a dark theme stays dark, and a role it leaves out takes Obsidian’s of the same version, so a theme can be as short as an accent. Like every theme, it holds no views or code, so it can’t run anything. A typo, like an unknown role or a color that isn’t #rrggbb or #aarrggbb, is an error naming the key.

A theme can also set the rest of the look, with the sections theme.toml has below: [text] for its fonts and sizes, [layout] for the island’s shape and spacing, and [motion] for how things move. What your theme.toml sets goes over them, and the settings panel shows the theme’s values where you set nothing:

[text]
family = "IBM Plex Sans"

[motion]
speed = 1.5

They’re checked like theme.toml, so a typo or a value out of range is an error naming its section. A font the theme names that isn’t installed is drawn in another font Qt picks, so install the fonts a theme names.

mochi bento add <directory or repository> installs a theme, and mochi bento try tries it until you keep it or drop it: see Bento.

Layout

[layout] mode picks the island’s shape. "island" floats it margin away from the edge, rounded all around. "notch" attaches it to the edge, square there, with concave corners, the ears, flaring into the edge. "bar" draws a strip idle_height tall along the whole edge, like GNOME’s or macOS’s top bar: the bubbles sit on it without a background of their own and light up under the pointer, and the island sits in it, so the idle clock reads as part of the bar. A notice or a panel grows out of the bar like a notch, with ears where it leaves it. Windows keep out of the strip, and switching modes morphs from one to the other.

Motion

[motion] sets how things move. reduced = true turns animations off: views appear and change at once, and the island takes its shape without a spring. speed makes every animation faster or slower, 2 being twice as fast.

Some progress lines and rings wave while something goes on: the media line while a track plays, the battery ring while it charges, the timer’s ring while it runs, and the performance rings. waves = false draws every one of them flat. To keep some and not others, leave it on and turn off a module’s own: wavy = false in [module.media], [module.battery] or [module.performance]. With reduced = true the waves stay, but the media line’s stops drifting.

Text is set in Inter and icons in Material Symbols Rounded, which the Nix and Arch packages bring; text.family picks another font. Sizes follow one scale: four text sizes and one for big numbers, five spacings and three corner sizes, so every module lines up. text.label and text.subtitle, from before the scale, still work as text.caption and text.body, and mochi config check says so.

# Mochi's look. mochid wrote this file because there was none, and it never
# overwrites it. A line like "# accent = ..." shows a default: remove the
# "# " to change it. `mochi reload` applies changes at once.
#
# Colors are #rrggbb or #aarrggbb (aa is the opacity, ff for opaque).

# A theme: obsidian, catppuccin, nord, gruvbox, rose-pine, tokyo-night, one
# installed in ~/.local/share/mochi/themes, or wallpaper, made from your
# wallpaper. What [colors] sets below goes over it, until the settings panel
# picks another preset, which replaces those colors.
# preset = "obsidian"
# "dark" or "light", or "auto" to follow the system's preference.
# appearance = "dark"
# The image the wallpaper preset reads, or "auto" for the one awww, swww or
# hyprpaper shows. A new image there counts once the settings apply again.
# wallpaper = "auto"

[colors]
# The island and the control center panel.
# background = "#f5000000"
# Cards and tiles on the background.
# surface = "#1c1c1e"
# Buttons, tracks and dividers, one step above surface.
# raised = "#2c2c2e"
# Hovered buttons, one step above raised.
# highlight = "#3a3a3c"
# Text and icons.
# foreground = "#ffffff"
# Secondary text and icons.
# muted = "#8e8e93"
# What is active or important, and nothing else.
# accent = "#ff9f0a"
# Text and icons on the accent color.
# on_accent = "#000000"
# Destructive actions, like a shut down waiting for its second click.
# danger = "#ff453a"
# success = "#30d158"
# The hairline around the island and the bubbles; transparent for none.
# border = "#0dffffff"
# The soft shadow under them; transparent for none.
# shadow = "#59000000"

[layout]
# "island" floats apart from the screen edge; "notch" attaches to it with
# curved corners; "bar" is a strip along the whole edge with the bubbles on
# it, and the island grows out of it.
# mode = "island"
# "top" or "bottom".
# anchor = "top"
# The area the island sits in: left, center-left, center, center-right or right.
# island = "center"
# Gap to the screen edges in island mode, in pixels.
# margin = 6
# Gap between the island and bubbles.
# spacing = 8
# Height of the idle island and of bubbles. Windows make room for this much.
# idle_height = 34
# padding = 14
# The island's largest corner radius; short islands become round pills.
# max_radius = 34
# Corners of small controls, of rows and buttons, and of cards and tiles.
# radius_small = 8
# radius_medium = 14
# radius_large = 20
# The tallest the island can grow, in pixels.
# surface_height = 640

[layout.notch]
# Size of the curves where the notch meets the edge, and where the island
# leaves the bar.
# ear_radius = 10

[motion]
# Turn animations off: views appear and change at once, and the island takes
# its new shape without a spring.
# reduced = false
# How fast every animation runs: 2 is twice as fast, 0.5 half as fast.
# speed = 1.0
# The island's resize spring: stiffness, and damping between 0 and 1
# (lower bounces more).
# spring = 4.0
# damping = 0.32
# How views fade when the island changes, in milliseconds.
# fade_in_ms = 220
# fade_out_ms = 120
# fade_delay_ms = 90
# Color and hover changes.
# fast_ms = 150
# Things moving inside a view, with a slight overshoot.
# move_ms = 350
# Progress lines and rings wave while something goes on, like the media line
# while a track plays. Off draws every one of them flat.
# waves = true
# How far a mouse wheel's step scrolls a list, in pixels.
# scroll_step = 120
# A wheel's steps glide instead of jumping, and a touchpad's scroll coasts on
# after the fingers lift.
# smooth_scroll = true

[text]
# A font family name; empty uses Inter, which Mochi's packages bring, or
# the system font without it.
# family = ""
# The font of the clocks, on the idle island and in the control center;
# empty uses the font above.
# display_family = ""
# The type scale, in pixels: labels and fine print, everything else, titles,
# page titles, and big numbers like a clock.
# caption = 11
# body = 13
# title = 15
# headline = 20
# display = 42