toggle-corp / alacritty-colorscheme

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

toggle between colorschemes not working #34

Closed emilBeBri closed 2 years ago

emilBeBri commented 2 years ago

Hi, so I just installed this, on an up-to-date manjaro linux distro.

pip install --user alacritty-colorscheme

colorschemes:

REPO=https://github.com/eendroroy/alacritty-theme.git git clone $REPO $HOME/.config/alacritty/colors

but when I run

alacritty-colorscheme -V toggle

No colorscheme is changing, and this is the output from terminal:

Traceback (most recent call last): File "/home/emil/.local/bin/alacritty-colorscheme", line 8, in sys.exit(main()) File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorscheme/cli.py", line 158, in main handle_args(args) File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorscheme/cli.py", line 121, in handle_args colorscheme = get_applied_colorscheme(args.config_file) File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorscheme/colorscheme.py", line 32, in get_applied_colorscheme has_comment = _has_comment_token(config_yaml['colors'].ca.comment) TypeError: 'NoneType' object is not subscriptable

Not really sure what to do about that - I emptied my alacritty.yml just to make sure that something wasn't interferring (at first I got an error because I already had a section in the yaml defining colorschemes)

tnagorra commented 2 years ago

Can you try adding a color section on the configuration file?

emilBeBri commented 2 years ago

I got this instead:

Traceback (most recent call last): File "/home/emil/.local/bin/alacritty-colorscheme", line 8, in sys.exit(main()) File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorschem e/cli.py", line 158, in main handle_args(args) File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorschem e/cli.py", line 142, in handle_args replace_colorscheme(colors_path, args.config_file, File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorschem e/colorscheme.py", line 66, in replace_colorscheme colors_yaml = yaml.load(color_file) File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/main.py" , line 343, in load return constructor.get_single_data() File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/construc tor.py", line 111, in get_single_data node = self.composer.get_single_node() File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/composer .py", line 73, in get_single_node self.parser.get_event() File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/parser.p y", line 162, in get_event self.current_event = self.state() File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/parser.p y", line 176, in parse_stream_start token.move_comment(self.scanner.peek_token()) File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/scanner. py", line 1778, in peek_token self._gather_comments() File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/scanner. py", line 1806, in _gather_comments self.fetch_more_tokens() File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/scanner. py", line 283, in fetch_more_tokens return self.fetch_value() File "/home/emil/.local/lib/python3.10/site-packages/ruamel/yaml/scanner. py", line 652, in fetch_value raise ScannerError( ruamel.yaml.scanner.ScannerError: mapping values are not allowed here in "/home/emil/.config/alacritty/colors/LICENSE", line 92, column 33

and this is (the only) content in the config:

schemes:

Palenight

Palenight: &Palenight

Default colors

primary:
  background: '#292d3e'
  foreground: '#d0d0d0'

# Normal colors
normal:
  black:   '#292d3e'
  red:     '#f07178'
  green:   '#c3e88d'
  yellow:  '#ffcb6b'
  blue:    '#82aaff'
  magenta: '#c792ea'
  cyan:    '#89ddff'
  white:   '#d0d0d0'

# Bright colors
bright:
  black:   '#434758'
  red:     '#ff8b92'
  green:   '#ddffa7'
  yellow:  '#ffe585'
  blue:    '#9cc4ff'
  magenta: '#e1acff'
  cyan:    '#a3f7ff'
  white:   '#ffffff'

colors: *Palenight

tnagorra commented 2 years ago

When looking at the tracelog, looks like the program is also reading the LICENSE file.

The ~/.config/alacritty/colors should include the colors yml, but the commands you have used will have the colors yml file at ~/.config/alacritty/colors/themes/

REPO=https://github.com/eendroroy/alacritty-theme.git git clone $REPO $HOME/.config/alacritty/colors/

emilBeBri commented 2 years ago

That did the trick, moving the schemes from the 'themes' folder up one dir. thank you. strange though, I thought that that color repo was made specifically for this program

tnagorra commented 2 years ago

The colors folder is just the default location for the program. You can also set the location for the colors directly using the commandline argument