Skip to content

aspatari/iterm2-karma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

iTerm2 Karma

CI License: MIT

Karma color theme by Sreetam Das β€” ported to iTerm2.

Karma is a VS Code theme inspired by Ayu, Lucy, and Andromeda β€” vibrant accents on both dark and light backgrounds. This repository ports its palette into the .itermcolors format so your terminal matches your editor.

Preview

Karma Dark theme in iTerm2
πŸŒ™ Karma Dark

Karma Light theme in iTerm2
β˜€οΈ Karma Light

Variants showcase

Karma Dark HC
Karma Dark HC
Karma Light HC
Karma Light HC
Karma Dark Dimmed
Karma Dark Dimmed
Karma Light Dimmed
Karma Light Dimmed

Installation

Two ways, pick one:

Option A β€” Drop-in Dynamic Profile (zero-click, recommended)

# Clone or download just the profiles you want, then:
mkdir -p ~/Library/Application\ Support/iTerm2/DynamicProfiles
cp profiles/karma-*.json ~/Library/Application\ Support/iTerm2/DynamicProfiles/

iTerm2 picks up the new profiles immediately β€” no restart, no clicks. All six variants appear in the Profiles menu (and in the iTerm2 β–Ά Open β–Ά … profile list). Each profile is identified by a stable Guid, so re-installing later updates the existing profile rather than duplicating it.

To switch: Profiles menu β†’ choose the variant. Set one as default via Settings β†’ Profiles β†’ "Other Actions" β†’ Set as Default.

To uninstall: just delete the JSON files from ~/Library/Application Support/iTerm2/DynamicProfiles/. iTerm2 reverts to your previous setup.

Option B β€” Color Preset import (the classic flow)

If you want to apply a Karma palette to an existing profile (keeping its font, behaviour, key bindings), use the .itermcolors color presets:

  1. Download a variant from colors/ β€” see the table below for guidance.
  2. Launch iTerm2 and open Settings (⌘ + ,).
  3. Go to Profiles β†’ select the profile you want to edit.
  4. On the Colors tab, click Color Presets β†’ Import….
  5. Pick the .itermcolors file you downloaded.
  6. Open Color Presets again and select the imported preset.
  7. Done. ✨

You can also grab pre-built .itermcolors directly from the latest GitHub Release.

Which to choose

Goal Use
Switch entire profile (font, colors, behavior) with one click Dynamic Profile (Option A)
Apply Karma colors to your already-configured profile Color Preset (Option B)
Want all six variants visible at once in Profiles menu Dynamic Profile (Option A)
Sync via dotfiles / install script / CI Dynamic Profile (Option A β€” cp is scriptable)
Distribute via iterm2colorschemes.com lookup Color Preset (Option B β€” that site indexes presets)

Variants

Variant File When to use
πŸŒ™ Karma Dark karma-dark.itermcolors Default β€” Karma's signature dark theme
β˜€οΈ Karma Light karma-light.itermcolors Karma Light from VS Code β€” for bright environments
Karma Dark HC karma-dark-hc.itermcolors High-contrast Dark β€” pure black background, amplified accents (outdoor / accessibility)
Karma Light HC karma-light-hc.itermcolors High-contrast Light β€” pure white background, deepened accents (projector / accessibility)
Karma Dark Dimmed karma-dark-dimmed.itermcolors Dimmed Dark β€” softer accents, lifted background (OLED / late-night)
Karma Light Dimmed karma-light-dimmed.itermcolors Dimmed Light β€” off-white background, gentler accents (long reading sessions)

All presets use the refined ANSI 16 mapping documented in the source comments of src/palette/dark.ts and src/palette/light.ts β€” it sidesteps two quirks of Karma's verbatim terminal.ansi* ship values:

  • Dark: terminal.ansiBlue and ansiBrightBlue are both set to orange in the upstream theme, which makes directories show as orange in ls --color=auto. The refined mapping uses Karma's cyan-blue instead.
  • Light: terminal.ansiBlack is set to white (inverted ANSI 0/7 polarity), which breaks several CLI tools. The refined mapping uses dark for ANSI 0 and a mid-gray for ANSI 7.

Visual proof: directories in ls --color=auto

Comparison: upstream Karma ansiBlue=orange (left) vs refined ansi.blue=cyan (right) when running ls --color=auto

Left side: upstream Karma β€” directories render as orange because terminal.ansiBlue = #fd9353. Right side: this port β€” directories render as cyan because ansi.blue = #5ad4e6. Same ls --color=auto invocation, same theme intent, no terminal config changes β€” just a different ANSI 4 mapping in the preset.

The HC and Dimmed variants are derived from the Dark/Light bases via TypeScript object-spread overrides β€” only the cells that differ are listed explicitly. See src/palette/dark-hc.ts etc. for the exact deltas.

Recommended font

Karma's screenshots use Iosevka (Iosevka Term or Iosevka). For the closest match to the original theme, configure the same font in iTerm2. Any other monospace font works correctly β€” the palette does not depend on the font.

Building from source

The presets are produced by a Deno build script from a single TypeScript palette source in src/palette/. End users do not need Deno β€” all six .itermcolors files are committed to the repository.

# Requires Deno >= 2.0
deno task build

The script generates files in colors/ deterministically: a second run produces no changes (this is enforced in CI via git diff --exit-code colors/). Full pipeline:

deno task fmt:check    # formatting
deno task lint         # linting
deno task check        # type-check (strict mode)
deno task test         # unit tests
deno task build        # generate all 6 .itermcolors

Architecture

A small Layered + Functional-Core / Imperative-Shell pipeline. Hex codes live in exactly one place (src/palette/); everything downstream is a pure transformation.

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚  src/palette/  β€”  the only place    β”‚
                 β”‚  hex literals exist                 β”‚
                 β”‚                                     β”‚
                 β”‚  β”œβ”€ types.ts (Palette, AnsiColors)  β”‚
                 β”‚  β”œβ”€ dark.ts        ┐                β”‚
                 β”‚  β”œβ”€ light.ts       β”‚  base         β”‚
                 β”‚  β”œβ”€ dark-hc.ts     ─  +            β”‚
                 β”‚  β”œβ”€ light-hc.ts    β”‚  spread       β”‚
                 β”‚  β”œβ”€ dark-dimmed.ts ─  overrides    β”‚
                 β”‚  └─ light-dimmed.tsβ”˜                β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ Palette objects
                              β–Ό
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚  src/render/  β€”  pure transforms    β”‚
                 β”‚                                     β”‚
                 β”‚  β”œβ”€ color.ts          (hexβ†’RGB)     β”‚
                 β”‚  β”œβ”€ itermcolors.ts    (β†’ XML plist) β”‚
                 β”‚  └─ preview-data.ts   (β†’ shell vars)β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ rendered strings
                              β–Ό
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚  build.ts  β€”  the only file with I/Oβ”‚
                 β”‚  (Deno.writeTextFile, Deno.mkdir)   β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β–Ό             β–Ό                      β–Ό
       colors/karma-*    assets/_preview-data.sh    (stdout logs)
       .itermcolors      (sourced by preview.sh)
       (Γ—6)              (sourced by preview.sh)
                                  β”‚
                                  β–Ό
                              freeze + cwebp
                                  β”‚
                                  β–Ό
                            assets/karma-*.webp

Determinism contract: a second deno task build produces zero git diff (CI enforces). Top-level plist keys are lex-sorted, RGB components use Number.toString() (locale-independent), inner color dicts are alphabetically ordered. See AGENTS.md for the full architectural invariants.

Screenshots

Recipe for reproducing the preview screenshots: assets/SCREENSHOTS.md. The pipeline is fully automated β€” freeze renders the colored ANSI output of assets/preview.sh into a PNG without any GUI capture.

References

Acknowledgements

Huge thanks to Sreetam Das for the original Karma theme. This port translates his palette into the iTerm2 format β€” every color choice and aesthetic decision is his.

The repository structure and build pipeline are inspired by catppuccin/iterm.

Contributing

PRs welcome β€” see CONTRIBUTING.md for development setup, project conventions, and the verification gates the CI enforces. Bug reports and feature requests have issue templates ready to go.

License

MIT β€” compatible with the original Karma project's license.

About

🎨 Karma color theme by Sreetam Das, ported to iTerm2 β€” six variants (Dark/Light + High-Contrast + Dimmed) generated from a typed Deno pipeline.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors