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

Config Schema

Complete configuration file reference for Two-Face.

File Overview

FilePurpose
config.tomlMain configuration
layout.tomlWidget layout
colors.tomlColor theme
keybinds.tomlKey bindings
highlights.tomlText patterns
triggers.tomlAutomation triggers

config.toml

Connection Section

[connection]
mode = "lich"           # "lich" or "direct"
host = "127.0.0.1"      # Lich host (lich mode)
port = 8000             # Lich port (lich mode)
auto_reconnect = true   # Auto-reconnect on disconnect
reconnect_delay = 5     # Seconds between reconnect attempts
game = "prime"          # Game instance (direct mode)
KeyTypeDefaultDescription
modestring"lich"Connection mode
hoststring"127.0.0.1"Proxy host
portinteger8000Proxy port
auto_reconnectbooleantrueEnable auto-reconnect
reconnect_delayinteger5Reconnect delay (seconds)
gamestring"prime"Game instance (direct)

TTS Section

[tts]
enabled = false
engine = "default"      # "sapi", "say", "espeak"
voice = "default"
rate = 1.0              # 0.5 to 2.0
volume = 1.0            # 0.0 to 1.0

speak_room_descriptions = true
speak_combat = false
speak_speech = true
speak_whispers = true
speak_thoughts = false
KeyTypeDefaultDescription
enabledbooleanfalseEnable TTS
enginestring"default"TTS engine
voicestring"default"Voice name
ratefloat1.0Speech rate
volumefloat1.0Volume level
speak_*booleanvariesSpeak stream types

Logging Section

[logging]
level = "info"          # "error", "warn", "info", "debug", "trace"
file = "~/.two-face/two-face.log"
max_size = 10485760     # 10MB
rotate = true

Performance Section

[performance]
render_rate = 60        # Target FPS
batch_updates = true
lazy_render = true
max_scrollback = 10000

layout.toml

Widget Definition

[[widgets]]
type = "text"           # Widget type (required)
name = "main"           # Unique name (required)
x = 0                   # X position (0-100)
y = 0                   # Y position (0-100)
width = 100             # Width (0-100)
height = 100            # Height (0-100)

# Optional common properties
title = "Main"          # Widget title
border = true           # Show border
border_color = "white"  # Border color
focus_order = 1         # Tab order
visible = true          # Initial visibility

Widget Types

text

[[widgets]]
type = "text"
streams = ["main", "room"]
scrollback = 5000
auto_scroll = true
show_timestamps = false
wrap = true

tabbed_text

[[widgets]]
type = "tabbed_text"
tabs = [
    { name = "All", streams = ["main", "room", "combat"] },
    { name = "Combat", streams = ["combat"] },
    { name = "Chat", streams = ["speech", "thoughts"] },
]

progress

[[widgets]]
type = "progress"
data_source = "vitals.health"
color = "health"
show_text = true
show_percentage = true

countdown

[[widgets]]
type = "countdown"
data_source = "roundtime"
warning_threshold = 2
critical_threshold = 0

compass

[[widgets]]
type = "compass"
style = "unicode"       # "ascii", "unicode", "minimal"
clickable = true

indicator

[[widgets]]
type = "indicator"
indicators = ["hidden", "stunned", "prone"]
columns = 2

room

[[widgets]]
type = "room"
show_exits = true
show_creatures = true
show_players = false

command_input

[[widgets]]
type = "command_input"
prompt = "> "
history_size = 500
show_roundtime = true

colors.toml

Theme Definition

[theme]
name = "Custom Theme"

# Base colors
background = "#000000"
text = "#ffffff"
text_dim = "#808080"

# Borders
border = "#404040"
border_focused = "#ffffff"

# Vitals
health = "#00ff00"
health_low = "#ffff00"
health_critical = "#ff0000"
mana = "#0080ff"
stamina = "#ff8000"
spirit = "#ff00ff"

# Streams
main = "#ffffff"
combat = "#ff4444"
speech = "#00ffff"
thoughts = "#00ff00"
whisper = "#ff00ff"
room = "#ffff00"

# Indicators
hidden = "#00ff00"
stunned = "#ffff00"
prone = "#00ffff"

Color Values

Colors accept:

  • Preset names: "red", "bright_blue"
  • Hex codes: "#ff0000", "#f00"

keybinds.toml

Keybind Definition

[keybinds."key_name"]
action = "action_name"  # Widget action

# OR

[keybinds."key_name"]
macro = "game command"  # Send command

Key Names

CategoryExamples
Letters"a", "z", "A" (shift+a)
Numbers"1", "0"
Function"f1", "f12"
Navigation"up", "down", "left", "right"
Editing"enter", "tab", "backspace", "delete"
Special"escape", "space", "home", "end"
Numpad"numpad0", "numpad_plus"

Modifiers

Combine with +:

  • "ctrl+a"
  • "shift+f1"
  • "alt+enter"
  • "ctrl+shift+s"

highlights.toml

Highlight Definition

[[highlights]]
pattern = "regex pattern"
fg = "color"            # Foreground color
bg = "color"            # Background color (optional)
bold = false
italic = false
underline = false

# Optional
enabled = true
priority = 100
fast_parse = false      # Use literal matching

triggers.toml

Trigger Definition

[[triggers]]
name = "trigger_name"
pattern = "regex pattern"
command = "action"

# Optional
enabled = true
priority = 100
cooldown = 1000         # Milliseconds
category = "combat"
stream = "main"         # Limit to stream

Type Reference

TypeFormatExample
stringQuoted text"value"
integerWhole number100
floatDecimal number1.5
booleantrue/falsetrue
arrayBrackets["a", "b"]
tableSection[section]

See Also