Update setup-env script
This commit is contained in:
parent
25608f27eb
commit
70b4be187f
1 changed files with 33 additions and 40 deletions
73
setup-env.sh
73
setup-env.sh
|
|
@ -3,54 +3,47 @@
|
||||||
echo "Enter root password:"
|
echo "Enter root password:"
|
||||||
read -s password
|
read -s password
|
||||||
|
|
||||||
|
|
||||||
|
# Get packet manager
|
||||||
|
declare -A osInfo;
|
||||||
|
osInfo[/etc/redhat-release]=dnf
|
||||||
|
osInfo[/etc/arch-release]=pacman
|
||||||
|
osInfo[/etc/gentoo-release]=emerge
|
||||||
|
osInfo[/etc/SuSE-release]=zypp
|
||||||
|
osInfo[/etc/debian_version]=apt
|
||||||
|
|
||||||
|
# for f in "${!osInfo[@]}" # bash version
|
||||||
|
for f in "${(@k)osInfo}" # zsh version
|
||||||
|
do
|
||||||
|
if [[ -f $f ]];then
|
||||||
|
pm=${osInfo[$f]}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "$pm" == "apt" ]]; then
|
||||||
|
sudo $pm update
|
||||||
|
fi
|
||||||
|
|
||||||
# Install zsh
|
# Install zsh
|
||||||
sudo apt update
|
sudo $pm install -y zsh tmux wget && \
|
||||||
sudo apt upgrade --assume-yes
|
|
||||||
sudo apt install zsh \
|
|
||||||
python-pip --assume-yes
|
|
||||||
# Setup oh-my-zsh
|
# Setup oh-my-zsh
|
||||||
wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh && chmod +x install.sh && echo "$password" | ./install.sh && \
|
wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh && chmod +x install.sh && echo "$password" | ./install.sh && \
|
||||||
|
|
||||||
# Setup config files
|
# Setup zsh config files
|
||||||
cp .zshrc ~/ && \
|
wget -O ~/.zshrc https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.zshrc && \
|
||||||
cp .bash_aliases ~/ && \
|
wget -O ~/.bash_aliases https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.bash_aliases && \
|
||||||
sudo cp virtualenvwrapper.sh /usr/local/bin/ && \
|
wget -O ~/.zshenv https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.zshenv && \
|
||||||
cp .zshenv ~/ && \
|
|
||||||
cp bira.zsh-theme ~/.oh-my-zsh/themes/
|
|
||||||
|
|
||||||
# Configure j (jump)
|
|
||||||
# Debian like
|
|
||||||
wget https://github.com/gsamokovarov/jump/releases/download/v0.18.0/jump_0.18.0_amd64.deb && \
|
|
||||||
sudo dpkg -i jump_0.18.0_amd64.deb && \
|
|
||||||
|
|
||||||
# RHEL like
|
|
||||||
# wget https://github.com/gsamokovarov/jump/releases/download/v0.18.0/jump-0.18.0-1.x86_64.rpm
|
|
||||||
# sudo rpm -i jump-0.18.0-1.x86_64.rpm
|
|
||||||
# Setup vim
|
|
||||||
|
|
||||||
|
|
||||||
# Setup pyenv
|
# Setup tmux
|
||||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \
|
bash -c "cd ~ && git clone https://github.com/gpakosz/.tmux.git && ln -s -f .tmux/.tmux.conf && cp .tmux/.tmux.conf.local ."
|
||||||
# Install python
|
|
||||||
# pyenv install 3.6.4 # throws some error? :/
|
|
||||||
|
|
||||||
# Install pip
|
wget -O ~/.tmux.conf.local https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.tmux.conf.local && \
|
||||||
sudo pip install --upgrade pip && \
|
|
||||||
sudo pip install virtualenvwrapper && \
|
|
||||||
|
|
||||||
source ~/.zshrc && \
|
|
||||||
|
|
||||||
# Check whether to install vim
|
|
||||||
read -p "Setup vim? (Y/n)?" CONT
|
|
||||||
if [ "$CONT" = "n" ]; then
|
|
||||||
echo Skipping vim installation
|
|
||||||
else
|
|
||||||
# Run vim installation script
|
|
||||||
./setup-vim.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo '
|
|
||||||
|
|
||||||
|
# Configure z (jump)
|
||||||
|
# git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z && \
|
||||||
|
git clone https://github.com/agkozak/zsh-z ~/.oh-my-zsh/plugins/zsh-z && \
|
||||||
|
|
||||||
___ _ _ ___ ___ ___ ___ ___
|
___ _ _ ___ ___ ___ ___ ___
|
||||||
/ __| | | |/ __/ __/ _ \/ __/ __|
|
/ __| | | |/ __/ __/ _ \/ __/ __|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue