toggle-corp / alacritty-colorscheme

Change colorscheme of alacritty with ease.
Apache License 2.0
345 stars 35 forks source link

Can't apply scheme: KeyError: 'colors' #11

Closed Seybo closed 4 years ago

Seybo commented 4 years ago

I'm on Ubuntu 18.04 and installed the package with pip3 install --user alacritty-colorscheme

[I] ➜ alacritty-colorscheme -l | grep nord
nord.yaml

But:

[I] ➜ alacritty-colorscheme -a nord.yaml
Traceback (most recent call last):
  File "/home/glaux/.local/bin/alacritty-colorscheme", line 11, in <module>
    sys.exit(main())
  File "/home/glaux/.local/lib/python3.6/site-packages/alacritty_colorscheme/cli.py", line 195, in main
    args.colorscheme, args.base16_vim)
  File "/home/glaux/.local/lib/python3.6/site-packages/alacritty_colorscheme/cli.py", line 143, in replace_colorscheme
    config_yaml['colors'].update(colors_yaml['colors'])
  File "/home/glaux/.local/lib/python3.6/site-packages/ruamel/yaml/comments.py", line 753, in __getitem__
    return ordereddict.__getitem__(self, key)
KeyError: 'colors'

Here is my nord.yml. I have added the surrounding # color_start/end according to #6

# color_start
colors:
  # Default colors
  primary:
    background: '0x2E3440'
    foreground: '0xD8DEE9'

  # Normal colors
  normal:
    black:   '0x3B4252'
    red:     '0xBF616A'
    green:   '0xA3BE8C'
    yellow:  '0xEBCB8B'
    blue:    '0x81A1C1'
    magenta: '0xB48EAD'
    cyan:    '0x88C0D0'
    white:   '0xE5E9F0'

  # Bright colors
  bright:
    black:   '0x4C566A'
    red:     '0xBF616A'
    green:   '0xA3BE8C'
    yellow:  '0xEBCB8B'
    blue:    '0x81A1C1'
    magenta: '0xB48EAD'
    cyan:    '0x8FBCBB'
    white:   '0xECEFF4'
# color_end
tnagorra commented 4 years ago

You don't need to add the markers in the latest version @Seybo

I think you do not have colors section in your alacritty.yml config. Can you try adding this to your alacritty.yml config

colors:
  cursor:
    text: '0x32302f'
    cursor: '0xd5c4a1'

And, try running the tool again.

Seybo commented 4 years ago

thank you @tnagorra . My colors section was commented out :facepalm: