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

Configuration

Two-Face uses TOML files for all configuration. This section provides complete documentation for each configuration file.

Configuration Files

Two-Face loads configuration from these files in your data directory (~/.two-face/):

FilePurposeHot Reload
config.tomlMain settings, connection, behaviorYes
layout.tomlWindow positions, sizes, arrangementYes
keybinds.tomlKeyboard shortcuts and actionsYes
highlights.tomlText highlighting patternsYes
colors.tomlColor theme, presets, palettesYes

Hot Reload: Press F5 to reload all configuration without restarting.


File Locations

Default Location

PlatformPath
Windows%USERPROFILE%\.two-face\
Linux~/.two-face/
macOS~/.two-face/

Custom Location

Override with --data-dir or TWO_FACE_DIR:

# Command line
two-face --data-dir /custom/path

# Environment variable
export TWO_FACE_DIR=/custom/path

Character Profiles

Per-character configuration lives in ~/.two-face/profiles/<CharName>/:

~/.two-face/
├── config.toml           # Global defaults
├── layout.toml
├── keybinds.toml
├── highlights.toml
├── colors.toml
└── profiles/
    ├── Warrior/          # Character-specific overrides
    │   ├── layout.toml
    │   └── highlights.toml
    └── Wizard/
        ├── layout.toml
        └── highlights.toml

Loading Order

  1. Load global defaults from ~/.two-face/
  2. If --character specified, overlay from profiles/<CharName>/
  3. Character files only need to contain overrides, not complete configs

Usage

# Load Warrior's profile
two-face --character Warrior

Configuration Syntax

All config files use TOML syntax:

# Comments start with #

# Simple key-value
setting = "value"
number = 42
enabled = true

# Nested tables
[section]
key = "value"

# Inline tables
point = { x = 10, y = 20 }

# Arrays
list = ["one", "two", "three"]

# Array of tables
[[items]]
name = "first"

[[items]]
name = "second"

Color Values

Colors can be specified as:

# Hex RGB
color = "#FF5500"

# Hex RRGGBB (same as above)
color = "#ff5500"

# Named color (from palette)
color = "bright_red"

# Preset reference
color = "@speech"  # Uses the 'speech' preset color

Size Values

# Fixed pixels
width = 40

# Percentage of parent
width = "50%"

Default Files

Two-Face ships with sensible defaults embedded in the binary. On first run, these are written to your data directory if the files don’t exist.

See Default Files Reference for complete default content.


Validation

Two-Face validates configuration on load:

  • Errors: Invalid syntax or required fields prevent loading
  • Warnings: Unknown keys or deprecated settings log warnings but allow loading
  • Missing files: Created from defaults

Check ~/.two-face/two-face.log for configuration warnings.


Quick Reference

Most Common Settings

SettingFileKey
Connection portconfig.tomlconnection.port
Default characterconfig.tomlconnection.character
Main window sizelayout.toml[[windows]] with name = "main"
Monsterbold colorcolors.toml[presets.monsterbold]
Attack keybindkeybinds.tomlEntry with action = "send"

Reload Configuration

  • F5: Reload all config files
  • Ctrl+M → Reload: Same via menu
  • Restart: Always picks up changes

File Reference

PageContents
config.tomlConnection, sound, TTS, general behavior
layout.tomlWindow definitions, positions, sizes
keybinds.tomlKey mappings, actions, modifiers
highlights.tomlPattern matching, colors, conditions
colors.tomlTheme colors, presets, UI styling
profiles.mdPer-character configuration

See Also