dot_files/setup.sh

53 lines
1.8 KiB
Bash
Raw Normal View History

2018-01-13 21:32:03 +00:00
#!/bin/bash
2020-08-23 14:48:11 +01:00
set -e
2020-08-22 12:34:33 +01:00
# Get packet manager
2020-08-23 14:48:11 +01:00
if [ -x "$(command -v apk)" ]; then pm=apk
elif [ -x "$(command -v apt)" ]; then pm="apt"
elif [ -x "$(command -v dnf)" ]; then pm="dnf"
elif [ -x "$(command -v zypper)" ];then pm="zypper"
else echo "FAILED TO INSTALL PACKAGE: Package manager not found. You must manually install: zsh tmux wget"
2020-08-22 12:34:33 +01:00
fi
2018-01-13 21:32:03 +00:00
# Install zsh
2020-08-23 14:48:11 +01:00
if which zsh 2>/dev/null > /dev/null && which tmux 2>/dev/null >/dev/null && which wget 2>/dev/null >/dev/null; then
echo "All needed packages are installed. Skipping install step"
else
echo "Installing zsh, tmux and wget..."
sudo $pm install -y zsh tmux wget
fi
2020-08-22 12:34:33 +01:00
2018-01-13 21:32:03 +00:00
# Setup oh-my-zsh
2020-08-23 14:48:11 +01:00
wget -O /tmp/install.sh https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
chmod +x /tmp/install.sh
set +e
echo "exit" | /tmp/install.sh
set -e
rm /tmp/install.sh
2018-01-13 21:32:03 +00:00
2020-08-22 12:34:33 +01:00
# Setup zsh config files
wget -O ~/.zshrc https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.zshrc && \
wget -O ~/.bash_aliases https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.bash_aliases && \
wget -O ~/.zshenv https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.zshenv && \
# Setup tmux
bash -c "cd ~ && git clone https://github.com/gpakosz/.tmux.git && ln -s -f .tmux/.tmux.conf && cp .tmux/.tmux.conf.local ."
2018-01-15 21:53:39 +00:00
2020-08-22 12:34:33 +01:00
wget -O ~/.tmux.conf.local https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.tmux.conf.local && \
2018-01-13 22:52:08 +00:00
2020-08-22 12:34:33 +01:00
# 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 && \
2018-01-13 22:52:08 +00:00
2020-08-23 14:48:11 +01:00
echo '
2018-01-13 22:52:08 +00:00
___ _ _ ___ ___ ___ ___ ___
/ __| | | |/ __/ __/ _ \/ __/ __|
\__ \ |_| | (_| (_| __/\__ \__ \
|___/\__,_|\___\___\___||___/___/
2018-01-13 22:58:15 +00:00
' && \
2020-08-23 14:48:11 +01:00
echo ' Run tmux to enter your newly setup environment!'
2018-01-15 21:53:39 +00:00