forked from smuellner/senf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·87 lines (73 loc) · 1.95 KB
/
install.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
###
# python, pip
python_cmd=$(which python)
${python_cmd} --version
${python_cmd} -m ensurepip --default-pip --upgrade --user
${python_cmd} -m pip install --upgrade pip setuptools wheel --user
python_bin_path="${HOME}/Library/Python/*/bin"
pip_cmd="${python_bin_path}/pip"
${pip_cmd} --version
${pip_cmd} install --upgrade pip --user
###
# powerline-shell
powerline_shell="/usr/local/bin/powerline-shell"
if ! test -e "${powerline_shell}"; then
powerline_shell=$(find ${python_bin_path} -name powerline-shell -print | head -n 1)
fi
if test -e "${powerline_shell}"; then
echo "✅ ${powerline_shell} already installed"
else
echo "⚙️ Installing powerline-shell"
echo ${powerline_shell}
${pip_cmd} install powerline-shell --user
fi
###
# powerline fonts
cd ~/Downloads
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts
cd
###
# bash
bashrc="${HOME}/.bashrc"
senf_bashrc="\${HOME}/.senf/bashrc"
! test -e "${bashrc}" && touch "${bashrc}"
if test -e "${bashrc}"; then
if grep -q "${senf_bashrc}" "${bashrc}"; then
echo "✅ ${senf_bashrc} already sourced"
else
echo "⚙️ Sourcing ${senf_bashrc}"
echo "" >>${bashrc}
echo "# Including senf_bashrc" >>${bashrc}
echo "test -e \"${senf_bashrc}\" && source \"${senf_bashrc}\"" >>${bashrc}
fi
else
echo "❌ ${senf_bashrc} does not exist"
fi
###
# zsh
zshrc=${HOME}/.zshrc
senf_zshrrc="\${HOME}/.senf/zshrc"
! test -e "${zshrc}" && touch "${zshrc}"
if test -e "${zshrc}"; then
if grep -q "${senf_zshrrc}" "${zshrc}"; then
echo "✅ ${senf_zshrrc} already sourced"
else
echo "⚙️ Sourcing ${senf_zshrrc}"
echo "" >>${zshrc}
echo "# Including env zshrc" >>${zshrc}
echo "test -e \"${senf_zshrrc}\" && source \"${senf_zshrrc}\"" >>${zshrc}
fi
else
echo "❌ ${zshrc} does not exist"
fi
###
# oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"