Skip to content

Instantly share code, notes, and snippets.

@l00sed
Created January 27, 2021 16:03
Show Gist options
  • Save l00sed/78dddae4f45e84159fb9744f5e8fc195 to your computer and use it in GitHub Desktop.
Save l00sed/78dddae4f45e84159fb9744f5e8fc195 to your computer and use it in GitHub Desktop.
# ========================== ~/.bashrc
# Alacritty Colors
# --------------------------
# Requires colortty:
# https://github.com/shuhei/colortty
# Requires perl:
# https://learn.perl.org/installing/unix_linux.html
# --------------------------
function theme() {
# Add '## <- START ->' and '## <- END ->' strings to the bottom of your ~/.config/alacritty/alacritty.yml
ColorStart='## <- START ->'
ColorEnd='## <- END ->'
color="$(colortty get "$1")"
perl -0777 -pi -e 's/'"$ColorStart"'.*?'"$ColorEnd"'/'"$ColorStart\n$color\n$ColorEnd"'/sg;' ~/.config/alacritty/alacritty.yml
if [[ "$1" == "Tomorrow" ]]
then
echo "Tomorrow"
fi
if [[ "$1" == "Duotone Dark" ]]
then
echo "wwdc16"
fi
}
export -f theme
# Light Theme
#export VIM_COLOR="$(theme 'Tomorrow')"
# Dark Theme
export VIM_COLOR="$(theme 'Duotone Dark')"
# ================================= ~/.vimrc
# You should have any AirlineThemes installed
# ---------------------------------
if !empty($VIM_COLOR)
colo $VIM_COLOR
if $VIM_COLOR == "Tomorrow"
let g:airline_theme='base16_snazzy'
endif
if $VIM_COLOR == "wwdc16"
let g:airline_theme='base16color'
endif
endif
@l00sed
Copy link
Author

l00sed commented Jan 27, 2021

image
image

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