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

Migrating from Profanity

Guide for Profanity users transitioning to Two-Face.

Overview

Profanity and Two-Face are both terminal-based clients. Many concepts translate directly, though configuration syntax differs.

Key Similarities

FeatureProfanityTwo-Face
Terminal-based
Lich support
Text windows
Macros
Triggers
Highlights

Key Differences

AspectProfanityTwo-Face
Config formatCustom formatTOML
LanguageRubyRust
Widget systemFixed typesFlexible types
LayoutRelativePercentage-based

Configuration Translation

Window Layout

Profanity (in configuration):

window main 0 0 80 20
window health 81 0 20 3

Two-Face (layout.toml):

[[widgets]]
type = "text"
name = "main"
x = 0
y = 0
width = 80
height = 75

[[widgets]]
type = "progress"
name = "health"
x = 81
y = 0
width = 19
height = 5
data_source = "vitals.health"

Highlights

Profanity:

highlight "stunned" bold yellow
highlight /whispers,/ magenta

Two-Face (highlights.toml):

[[highlights]]
pattern = "stunned"
fg = "bright_yellow"
bold = true

[[highlights]]
pattern = "whispers,"
fg = "magenta"

Macros

Profanity:

macro F1 attack target
macro ctrl-1 "prep 101;cast"

Two-Face (keybinds.toml):

[keybinds."f1"]
macro = "attack target"

[keybinds."ctrl+1"]
macro = "prep 101;cast"

Triggers

Profanity:

trigger "You are stunned" echo "STUNNED!"
trigger /falls dead/ "search;loot"

Two-Face (triggers.toml):

[[triggers]]
pattern = "You are stunned"
command = ".notify STUNNED!"

[[triggers]]
pattern = "falls dead"
command = "search;loot"

Colors

Profanity:

color health green
color mana blue
color background black

Two-Face (colors.toml):

[theme]
health = "#00ff00"
mana = "#0080ff"
background = "#000000"

Lich Integration

Both clients connect through Lich the same way. Your Lich scripts continue to work:

# Same connection method
two-face --host 127.0.0.1 --port 8000

Feature Comparison

Text Windows

ProfanityTwo-Face
main windowtext widget with streams = ["main"]
thoughts windowtext widget with streams = ["thoughts"]
Multiple windowsMultiple text widgets

Progress Bars

ProfanityTwo-Face
Built-in health barprogress widget with data_source = "vitals.health"
Fixed appearanceCustomizable colors and style

Compass

ProfanityTwo-Face
ASCII compasscompass widget with style = "ascii" or "unicode"
Fixed locationAny position

Step-by-Step Migration

1. Document Your Profanity Setup

List:

  • Window positions
  • Macros
  • Triggers
  • Highlights
  • Color preferences

2. Create Two-Face Config Directory

mkdir -p ~/.two-face

3. Create Layout

Translate window positions to layout.toml:

# Approximate your Profanity layout

[[widgets]]
type = "text"
name = "main"
x = 0
y = 0
width = 80
height = 80
streams = ["main", "room"]

# Add other widgets...

4. Create Colors

Translate color preferences:

[theme]
background = "#000000"
text = "#c0c0c0"
health = "#00ff00"
# Add more...

5. Migrate Macros

# keybinds.toml

[keybinds."f1"]
macro = "attack target"

[keybinds."f2"]
macro = "hide"

# Add more...

6. Migrate Triggers

# triggers.toml

[[triggers]]
name = "stun_alert"
pattern = "You are stunned"
command = ".notify STUNNED!"

# Add more...

7. Migrate Highlights

# highlights.toml

[[highlights]]
pattern = "stunned"
fg = "bright_yellow"
bold = true

# Add more...

Common Adjustments

Layout Units

Profanity uses character columns/rows. Two-Face uses percentages (0-100).

Converting:

  • Estimate percentage of screen
  • Or: (columns / terminal_width) * 100

Regex Patterns

Both support regex, but syntax may vary:

  • Test patterns in Two-Face
  • Adjust escaping as needed

Macro Syntax

ProfanityTwo-Face
; separates commands; separates commands
$input for prompt$input for prompt
Delays{ms} for delays

What’s New in Two-Face

Features you might not have in Profanity:

  • Tabbed windows: Multiple tabs in one widget
  • Unicode compass: Modern arrow characters
  • Percentage layout: Adapts to terminal size
  • Active effects widget: Track spell durations
  • Browser system: Popup editors

Troubleshooting

Macros Not Working

  • Check key name format ("f1" not "F1")
  • Verify TOML syntax (quotes around keys with special chars)

Colors Different

  • Two-Face uses hex colors or preset names
  • Verify color name mappings

Layout Looks Wrong

  • Check percentage calculations
  • Widgets shouldn’t overlap (x + width ≤ 100)

See Also