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
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
|
|
|
|
# Reset
|
|
|
|
Color_Off='\033[0m' # Text Reset
|
|
|
|
|
|
|
|
# Regular Colors
|
|
|
|
Black='\033[0;30m' # Black
|
|
|
|
Red='\033[0;31m' # Red
|
|
|
|
Green='\033[0;32m' # Green
|
|
|
|
Yellow='\033[0;33m' # Yellow
|
|
|
|
Blue='\033[0;34m' # Blue
|
|
|
|
Purple='\033[0;35m' # Purple
|
|
|
|
Cyan='\033[0;36m' # Cyan
|
|
|
|
White='\033[0;37m' # White
|
|
|
|
|
|
|
|
# Bold
|
|
|
|
BBlack='\033[1;30m' # Black
|
|
|
|
BRed='\033[1;31m' # Red
|
|
|
|
BGreen='\033[1;32m' # Green
|
|
|
|
BYellow='\033[1;33m' # Yellow
|
|
|
|
BBlue='\033[1;34m' # Blue
|
|
|
|
BPurple='\033[1;35m' # Purple
|
|
|
|
BCyan='\033[1;36m' # Cyan
|
|
|
|
BWhite='\033[1;37m' # White
|
|
|
|
|
|
|
|
export PATH=${MB_ENV_BASE}/bin:$PATH
|
|
|
|
|
2022-06-06 13:13:15 +02:00
|
|
|
# create folders
|
|
|
|
mkdir $MB_ENV_BASE
|
|
|
|
mkdir $INSTALL_TMP_DIR
|
|
|
|
mkdir $XDG_CONFIG_HOME
|
|
|
|
mkdir -p $XDG_DATA_HOME
|
|
|
|
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${BBlue}Downloading and installing packages${Color_Off}\n"
|
2022-06-06 13:13:15 +02:00
|
|
|
# ------------------------------------------- fish shell -----------------------------------------------------------
|
|
|
|
|
|
|
|
# portable fish: https://github.com/xxh/fish-portable
|
2022-06-06 19:29:39 +02:00
|
|
|
|
|
|
|
printf "${Blue}--> fish shell${Color_Off}\n"
|
2022-06-06 13:13:15 +02:00
|
|
|
cd $MB_ENV_BASE
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${White} Downloading...${Color_Off}\n"
|
2022-06-06 13:13:15 +02:00
|
|
|
PORTABLE_FISH=https://github.com/xxh/fish-portable/releases/download/3.4.1/fish-portable-musl-alpine-Linux-x86_64.tar.gz
|
2022-06-06 19:29:39 +02:00
|
|
|
curl -sL $PORTABLE_FISH | tar xz
|
|
|
|
printf "${White} Configuring...${Color_Off}\n"
|
2022-06-06 13:13:15 +02:00
|
|
|
cp -r ${CONFIG_IN}/fish ${XDG_CONFIG_HOME}
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
curl -sfLo "${XDG_CONFIG_HOME}"/fish/completions/tmux.fish \
|
|
|
|
https://raw.githubusercontent.com/fish-shell/fish-shell/master/share/completions/tmux.fish
|
|
|
|
|
2022-06-06 13:13:15 +02:00
|
|
|
# ------------------------------------------- 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
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${White} Installing Oh-My-Fish...${Color_Off}\n"
|
|
|
|
curl -sL https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install > install_omf
|
|
|
|
${FISH_EXE} install_omf --noninteractive &> /dev/null
|
|
|
|
${FISH_EXE} -c "omf install" &> /dev/null
|
2022-06-06 13:13:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------- bat -----------------------------------------------------------
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${Blue}--> bat${Color_Off}\n"
|
2022-06-06 13:13:15 +02:00
|
|
|
cd ${INSTALL_TMP_DIR}
|
2022-06-06 19:29:39 +02:00
|
|
|
curl -sL https://github.com/sharkdp/bat/releases/download/v0.21.0/bat-v0.21.0-x86_64-unknown-linux-musl.tar.gz | tar xz
|
2022-06-06 13:13:15 +02:00
|
|
|
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
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
# -------------------------------------------- neovim ------------------------------------------------------------
|
2022-06-06 13:13:15 +02:00
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${Blue}--> neovim${Color_Off}\n"
|
2022-06-06 13:13:15 +02:00
|
|
|
cd ${INSTALL_TMP_DIR}
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${White} Downloading...${Color_Off}\n"
|
|
|
|
curl -sL https://github.com/neovim/neovim/releases/download/v0.7.0/nvim.appimage > nvim.appimage
|
2022-06-06 13:13:15 +02:00
|
|
|
chmod u+x nvim.appimage
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${White} Extracting AppImage...${Color_Off}\n"
|
|
|
|
./nvim.appimage --appimage-extract &> /dev/null
|
2022-06-06 13:13:15 +02:00
|
|
|
cd squashfs-root/usr
|
|
|
|
cp ./bin/* ${MB_ENV_BASE}/bin/
|
2022-06-06 19:29:39 +02:00
|
|
|
mkdir ${MB_ENV_BASE}/lib
|
2022-06-06 13:13:15 +02:00
|
|
|
cp -r ./lib/* ${MB_ENV_BASE}/lib/
|
|
|
|
cp -r ./share/nvim ${MB_ENV_BASE}/share/
|
|
|
|
cp -r ${CONFIG_IN}/nvim ${XDG_CONFIG_HOME}
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${White} Downloading and installing vim-plug${Color_Off}\n"
|
|
|
|
curl -sfLo "${XDG_DATA_HOME}"/nvim/site/autoload/plug.vim --create-dirs \
|
2022-06-06 13:13:15 +02:00
|
|
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
cd ${MB_ENV_BASE}/bin
|
2022-06-06 13:13:15 +02:00
|
|
|
ln -s nvim vi
|
|
|
|
ln -s nvim vim
|
2022-06-06 19:29:39 +02:00
|
|
|
${MB_ENV_BASE}/bin/nvim +PlugInstall +qall
|
|
|
|
|
|
|
|
# -------------------------------------------- tmux ------------------------------------------------------------
|
|
|
|
|
|
|
|
printf "${Blue}--> tmux${Color_Off}\n"
|
|
|
|
cd ${INSTALL_TMP_DIR}
|
|
|
|
rm -rf ${INSTALL_TMP_DIR}/*
|
|
|
|
curl -sL https://github.com/nelsonenzo/tmux-appimage/releases/download/3.2a/tmux.appimage > tmux.appimage
|
|
|
|
chmod u+x tmux.appimage
|
|
|
|
printf "${White} Extracting AppImage...${Color_Off}\n"
|
|
|
|
./tmux.appimage --appimage-extract &> /dev/null
|
|
|
|
|
|
|
|
cd squashfs-root/usr
|
|
|
|
cp ./bin/* ${MB_ENV_BASE}/bin/
|
|
|
|
cp -r ./lib/* ${MB_ENV_BASE}/lib/
|
|
|
|
cp -r ./share/terminfo ${MB_ENV_BASE}/share/
|
|
|
|
|
|
|
|
cp -r ${CONFIG_IN}/tmux ${XDG_CONFIG_HOME}
|
2022-06-06 13:13:15 +02:00
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
export TERMINFO=${MB_ENV_BASE}/share/terminfo
|
|
|
|
|
|
|
|
printf "${White} Installing tpm package manager...${Color_Off}\n"
|
|
|
|
cd $XDG_DATA_HOME
|
|
|
|
mkdir -p tmux/plugins
|
|
|
|
git clone https://github.com/tmux-plugins/tpm tmux/plugins/tpm &> /dev/null
|
|
|
|
./tmux/plugins/tpm/bin/install_plugins &> /dev/null
|
2022-06-06 13:13:15 +02:00
|
|
|
|
|
|
|
# ------------------------------------------- configs -----------------------------------------------------------
|
|
|
|
|
|
|
|
cp ${CONFIG_IN}/activate.sh $MB_ENV_BASE # activation script
|
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------- pack and cleanup ----------------------------------------------------
|
|
|
|
|
2022-06-06 19:29:39 +02:00
|
|
|
printf "${Blue}Packing archive${Color_Off}\n"
|
2022-06-06 13:13:15 +02:00
|
|
|
cd $BASE
|
|
|
|
tar -cJf mbenv.tar.xz .mbenv
|
2022-06-06 19:29:39 +02:00
|
|
|
#rm -rf ${MB_ENV_BASE}
|
|
|
|
rm -rf ${INSTALL_TMP_DIR}
|
|
|
|
|
|
|
|
printf "${Green}Done${Color_Off}\n"
|