toggle-corp / alacritty-colorscheme

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

Crash when using --list-available with no colorschemes installed #18

Closed grodin closed 3 years ago

grodin commented 3 years ago

Having just done pip install alacritty-colorscheme and nothing else, running alacritty-colorscheme -l produces the following output.

> alacritty-colorscheme -l
Traceback (most recent call last):
  File "/home/jscdev/bin/alacritty-colorscheme", line 8, in <module>
    sys.exit(main())
  File "/home/jscdev/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 218, in main
    files = get_files_in_directory(args.colorscheme_dir)
  File "/home/jscdev/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 101, in get_files_in_directory
    onlyfiles = [f for f in (listdir(expanded_path))
FileNotFoundError: [Errno 2] No such file or directory: '/home/jscdev/.config/alacritty/colors/'

The version installed by pip is 0.2.1.

Obviously, this bug is incredibly minor, and has no practical effect on the user, but I thought it would probably be worth reporting it anyway.

tnagorra commented 3 years ago

The error says that you don't have a colors folder where the scripts looks for colorscheme. The default is at ~/.config/alacritty/colors.

I know these error messages aren't exactly user friendly. I am planning to work on polishing the error messages soon.

justinhj commented 3 years ago

It would probably help to add something like this to the instructions, I ran into the same issue.

ln -s /Users/me/.aaron-williamson-alacritty-theme/colors /Users/me/.config/alacritty/colors
ln -s /Users/me/.aaron-williamson-alacritty-theme/templates /Users/me/.config/alacritty/templates
tnagorra commented 3 years ago

The application does have an option to specify the color-scheme directory using -C option.

Maybe a config file would be useful so that people don't need to specify the configuration file and colorscheme directory?

justinhj commented 3 years ago

I think the problem is as a new user you have to figure out to set up links, or to use the -C option. Either is fine but it would be handy in the README.

Works nicely by the way, thanks for making this.