Skip to content

Addition of a simple bash function#30

Open
dungducphan wants to merge 1 commit intotoggle-corp:masterfrom
dungducphan:master
Open

Addition of a simple bash function#30
dungducphan wants to merge 1 commit intotoggle-corp:masterfrom
dungducphan:master

Conversation

@dungducphan
Copy link
Copy Markdown

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

@Zebradil
Copy link
Copy Markdown
Contributor

Zebradil commented Jun 8, 2022

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
Copy link
Copy Markdown
Member

@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
Copy link
Copy Markdown
Contributor

@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
Copy link
Copy Markdown
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants