toggle-corp / alacritty-colorscheme

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

Addition of a simple bash function #30

Open dungducphan opened 2 years ago

dungducphan commented 2 years ago

Adding a bash function to quickly choose and change the colorscheme for alacritty.

Zebradil commented 2 years ago

Maybe it makes sense to open wiki section and place such snippets there?
I also have something to propose, but it's a bit opinionated:

function chct() (
  local alclr=alacritty-colorscheme
  $alclr list \
    | fzf "$@" --preview "
      $alclr apply {}
      bat --color=always --plain --line-range 52:68 ~/.zshrc
      echo
      exa -l /tmp"
)

This shows a preview window with some colorized output and applies currently selected theme on the fly. Looks like this:

image

tnagorra commented 2 years ago

@Zebradil It's quite nice to see the preview of the colors but it is indeed quite opinionated. Not everybody uses zsh and have a .zshrc file. I propose something like this.

alacritty-colorscheme list | fzf "$@" --preview "alacritty-colorscheme apply {}
echo 'Colorscheme yml'
echo
bat --color=always --plain --line-range 1:30 ~/.config/alacritty/colors/{}
echo
echo 'Contents of root'
echo
ls --color"
Zebradil commented 2 years ago

@tnagorra exactly, it won't fit everyone's needs. That's why I'm proposing to open a Wiki in this repo — to be able to collect such kinds of snippets for bash, zsh, fish, or whatever else is used. Adding a bash snippet to the readme could also be helpful for me because I can learn from it and adapt to zsh. But having Wiki open gives more opportunities for people to share their ideas, tips and tricks. Take an example of the fzf's wiki.

tnagorra commented 9 months ago

@Zebradil Just started the Wiki so that we can add snippets and examples. https://github.com/toggle-corp/alacritty-colorscheme/wiki

Sorry, it took so long.