-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·52 lines (40 loc) · 1.76 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
# Get packet manager
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"
fi
# Install zsh
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
# Setup oh-my-zsh
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
# 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 ."
wget -O ~/.tmux.conf.local https://raw.githubusercontent.com/ViktorBarzin/dot_files/master/.tmux.conf.local && \
# 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 && \
echo '
___ _ _ ___ ___ ___ ___ ___
/ __| | | |/ __/ __/ _ \/ __/ __|
\__ \ |_| | (_| (_| __/\__ \__ \
|___/\__,_|\___\___\___||___/___/
' && \
echo ' Run tmux to enter your newly setup environment!'