mbenv/buildenv.sh

88 lines
3.0 KiB
Bash
Raw Normal View History

2022-06-06 13:13:15 +02:00
#/bin/bash
# Folder definitions
BASE=$(pwd)
export CONFIG_IN=$(pwd)/config_in
export MB_ENV_BASE=$(pwd)/.mbenv
export INSTALL_TMP_DIR=$(pwd)/tmp_install
export XDG_CONFIG_HOME=${MB_ENV_BASE}/config
export XDG_DATA_HOME=${MB_ENV_BASE}/local/share
# create folders
mkdir $MB_ENV_BASE
mkdir $INSTALL_TMP_DIR
mkdir $XDG_CONFIG_HOME
mkdir -p $XDG_DATA_HOME
# ------------------------------------------- fish shell -----------------------------------------------------------
# portable fish: https://github.com/xxh/fish-portable
cd $MB_ENV_BASE
PORTABLE_FISH=https://github.com/xxh/fish-portable/releases/download/3.4.1/fish-portable-musl-alpine-Linux-x86_64.tar.gz
curl -L $PORTABLE_FISH | tar xz
cp -r ${CONFIG_IN}/fish ${XDG_CONFIG_HOME}
# ------------------------------------------- oh my fish -----------------------------------------------------------
export OMF_CHANNEL=stable
export OMF_PATH=$XDG_DATA_HOME/omf
export OMF_CONFIG=$XDG_CONFIG_HOME/omf
FISH_EXE=${MB_ENV_BASE}/bin/fish
cp -r ${CONFIG_IN}/omf ${XDG_CONFIG_HOME}
cd $INSTALL_TMP_DIR
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install > install_omf
${FISH_EXE} install_omf --noninteractive
${FISH_EXE} -c "omf install"
# ------------------------------------------- bat -----------------------------------------------------------
cd ${INSTALL_TMP_DIR}
curl -L https://github.com/sharkdp/bat/releases/download/v0.21.0/bat-v0.21.0-x86_64-unknown-linux-musl.tar.gz | tar xz
cd bat*
cp bat ${MB_ENV_BASE}/bin
mkdir $XDG_CONFIG_HOME/fish/completions
cp autocomplete/bat.fish $XDG_CONFIG_HOME/fish/completions/bat.fish
# -------------------------------------------- vim ---------------------------------------------------------------
#curl -L https://github.com/dtschan/vim-static/releases/download/v8.1.1045/vim > $MB_ENV_BASE/bin/vim
#chmod u+x $MB_ENV_BASE/bin/vim
#mkdir $XDG_CONFIG_HOME/vim
#cp ${CONFIG_IN}/.vimrc $XDG_CONFIG_HOME/vim/vimrc
#curl -fLo $XDG_CONFIG_HOME/vim/autoload/plug.vim --create-dirs \
# https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
cd ${INSTALL_TMP_DIR}
curl -L https://github.com/neovim/neovim/releases/download/v0.7.0/nvim.appimage > nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage --appimage-extract
cd squashfs-root/usr
cp ./bin/* ${MB_ENV_BASE}/bin/
cp -r ./lib/* ${MB_ENV_BASE}/lib/
cp -r ./share/nvim ${MB_ENV_BASE}/share/
cp -r ${CONFIG_IN}/nvim ${XDG_CONFIG_HOME}
curl -fLo "${XDG_DATA_HOME}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
cd ${MB_ENV_BASE}
ln -s nvim vi
ln -s nvim vim
# ------------------------------------------- configs -----------------------------------------------------------
cp ${CONFIG_IN}/activate.sh $MB_ENV_BASE # activation script
# ------------------------------------------- pack and cleanup ----------------------------------------------------
cd $BASE
tar -cJf mbenv.tar.xz .mbenv
rm -rf ${MB_ENV_BASE}
rm -rf ${INSTALL_TMP_DIR}