#utility #parser #config

app dyna

Convert a colorscheme from one terminal emulator to another

1 unstable release

0.1.0 Jan 18, 2022

#214 in #parsing

MIT license

16KB
333 lines

dyna

Convert a colorscheme from one terminal emulator to another.

Supported terminal emulators

You can currently convert a colorscheme between:

Usage

Issue the following:

dyna --from alacritty --to foot

You will now be prompted to input a colorscheme, such as this one:

colors:
  bright:
    black: '#000000'
    blue: '#96cbfe'
    cyan: '#85befd'
    green: '#94fa36'
    magenta: '#b9b6fc'
    red: '#fd5ff1'
    white: '#e0e0e0'
    yellow: '#f5ffa8'
  cursor:
    cursor: '#d0d0d0'
    text: '#151515'
  normal:
    black: '#000000'
    blue: '#85befd'
    cyan: '#85befd'
    green: '#87c38a'
    magenta: '#b9b6fc'
    red: '#fd5ff1'
    white: '#e0e0e0'
    yellow: '#ffd7b1'
  primary:
    background: '#161719'
    foreground: '#c5c8c6'
  selection:
    background: '#444444'
    text: '#c5c8c6'

The output should look something like:

[cursor]
color=151515 d0d0d0
[colors]
background=161719
foreground=c5c8c6
regular0=000000
regular1=fd5ff1
regular2=87c38a
regular3=ffd7b1
regular4=85befd
regular5=b9b6fc
regular6=85befd
regular7=e0e0e0
bright0=000000
bright1=fd5ff1
bright2=94fa36
bright3=f5ffa8
bright4=96cbfe
bright5=b9b6fc
bright6=85befd
bright7=e0e0e0
selection-background=444444
selection-foreground=c5c8c6

Next time you run dyna, try piping your input to the program, e.g. "cat ... | dyna --from --to ". It's a lot faster than copying and pasting.

Installation

cargo install dyna

Building from source

git clone https://git.sr.ht/~grtcdr/dyna
cd dyna
cargo build --release

Dependencies

~4.5MB
~84K SLoC