Themes

Switch with opal theme set NAME; the new theme applies at the next prompt. opal theme preview shows them all in your terminal.

The examples below are generated by opal itself, in zsh, bash, fish and PowerShell. The prompt symbol is green in zsh, red in bash, gold in fish and blue in PowerShell.

fire

The default. Two lines: the path colored along a gradient, git status, and on the right the duration of slow commands, background jobs and the exit code of failed ones.

zsh  ╭─◆ opal/internal/prompt on main ⇡1 +2 !1 ?3                      took 3.2s
     ╰─❯ 
bash ╭─◆ opal/internal/prompt on main ⇡1 +2 !1 ?3 ◇ api
     ╰─❯ 
fish ╭─◆ opal/internal/prompt on main ⇡1 +2 !1 ?3                            ✦ 1
     ╰─❯ 
pwsh ╭─◆ opal\internal\prompt on main ⇡1 +2 !1 ?3                ✘ 127 not found
     ╰─❯ 

black

Colored blocks on a dark background, with the shell's name in the first block. With icons = "nerd" the blocks are joined with powerline separators.

zsh   ◆ zsh  opal/internal/prompt  main ⇡1 +2 !1 ?3  took 3.2s 
     ❯ 
bash  ◆ bash  opal/internal/prompt  main ⇡1 +2 !1 ?3  ◇ api 
     ❯ 
fish  ◆ fish  opal/internal/prompt  main ⇡1 +2 !1 ?3  ✦ 1 
     ❯ 
pwsh  ◆ pwsh  opal\internal\prompt  main ⇡1 +2 !1 ?3  ✘ 127 not found 
     ❯ 

boulder

One line in muted colors, with each folder above the current one shortened to its first letter and git status reduced to the branch, * for changes, and arrows for commits ahead or behind.

zsh  opal/i/prompt main* ⇡ took 3.2s ❯ 
bash opal/i/prompt main* ⇡ ◇ api ❯ 
fish opal/i/prompt main* ⇡ ✦ 1 ❯ 
pwsh opal\i\prompt main* ⇡ ✘ 127 not found ❯ 

Writing a theme

A theme is a TOML file. Copy one of the built-in themes into ~/.config/opal/themes/NAME.toml, change it, and set theme = "NAME".

KeyWhat it does
style"line" for text on the terminal background, "blocks" for colored blocks.
lines1 or 2. With two lines, the right-hand items go on the first line and the prompt symbol on the second.
frameDraw ╭─ and ╰─ in front of a two-line prompt.
dir_style"full" or "short" (folders above the current one shortened to one letter).
git_style"full" (counts) or "compact" (* and arrows).
left, rightThe segments to show: gem, shell, host, dir, git, venv, duration, jobs, status, time.
gradientColors the path is blended across, or [] for a single color.
[colors]Named colors: text, muted, branch, staged, modified, untracked, error and so on.
[hues]The prompt symbol's color for zsh, bash, fish, pwsh and default.
[blocks]Background color for each segment, for style = "blocks".
[syntax]Colors for fish, PSReadLine and zsh-syntax-highlighting: command, parameter, string, comment, suggestion and others. Values are a color name, "hue" or a hex color.
[light]Replacement gradient, [light.colors] and [light.hues] for background = "light".

Colors are blended in the OKLab color space and reduced automatically on terminals with 256 or 16 colors.