-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
132 lines (105 loc) · 3.48 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
sudo echo "Sudo mode" > /dev/null
# Vars
dot=${HOME}/.dot
wmanager=""
# Prompt help
confirm () {
read -p "${1}? [y|n]" yn
echo
if [[ $yn =~ ^[yY]$ ]]; then
return 0
else
return 1
fi
}
# Copy misc
ln -sfn ${dot}/rcfiles/.xinitrc ${HOME}/.xinitrc
# Zsh
if confirm "zsh"; then
echo "Getting oh-my-zsh"
wget -O ./ohmyzsh_install_script https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
chmod +x ./ohmyzsh_install_script
./ohmyzsh_install_script
rm ./ohmyzsh_install_script
echo "Getting autosuggestions and syntax hilighting"
if [[ -z $ZSH_CUSTOM ]]; then
ZSH_CUSTOM=${HOME}/.oh-my-zsh/custom
fi
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions &1>/dev/null
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting &1>/dev/null
echo "Linking"
ln -sfn ${dot}/.config/zsh/.zshenv ${HOME}/.zshenv
ln -sfn ${dot}/.config/zsh ${HOME}/.config/zsh
chsh -s /usr/bin/zsh
fi
# Kitty
if confirm "kitty"; then
echo "Installing kitty through pacman"
( command -v kitty > /dev/null 2>&1 || sudo pacman -Su kitty --noconfirm --needed)
echo "Linking"
ln -sfn ${dot}/.config/kitty ${HOME}/.config/kitty
fi
# Rofi
if confirm "rofi"; then
echo "Installing"
( command -v rofi > /dev/null 2>&1 && sudo pacman -Su rofi --noconfirm --needed)
echo "Linking"
ln -sfn ${dot}/.config/rofi ${HOME}/.config/rofi
fi
# i3
if confirm "i3"; then
echo "Installing"
( pacman -Qg xorg > /dev/null 2>&1 || sudo pacman -Su xorg --noconfirm --needed)
( pacman -Qg i3 > /dev/null 2>&1 || sudo pacman -Su i3 --noconfirm --needed)
fi
# qtile
if confirm "qtile"; then
echo "Installing"
( pacman -Qg qtile > /dev/null 2>&1 || sudo pacman -Su qtile --noconfirm --needed)
fi
# python
if confirm "pyenv"; then
echo "Installing"
sudo pacman -Su base-devel openssl zlib xz --noconfirm --needed
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
fi
# firefox
if confirm "firefox"; then
echo "Installing"
( command -v firefox > /dev/null 2>&1 || sudo pacman -Su firefox --noconfirm --needed)
fi
# picom
if confirm "picom"; then
echo "Installing"
( command -v picom > /dev/null 2>&1 || sudo pacman -Su picom --noconfirm --needed)
echo "Linking"
ln -sfn ${dot}/.config/picom ${HOME}/.config/picom
fi
# bluetooth
if confirm "bluetooth"; then
echo "Installing"
( pacman -Q bluez > /dev/null 2>&1 || sudo pacman -Su bluez --noconfirm --needed)
( pacman -Q bluez-util > /dev/null 2>&1 || sudo pacman -Su bluez-util --noconfirm --needed)
echo "Enabling bluetooth services"
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
echo "Linking for auto-startup"
sudo ln -sfn ${dot}/misc/bluetooth/main.conf /etc/bluetooth/main.conf
fi
# qtile
if confirm "nvim"; then
echo "Installing"
sudo pacman -Su base-devel cmake unzip ninja tree-sitter curl --noconfirm --needed
if [ ! -d "${HOME}/software" ]; then
mkdir ${HOME}/software
fi
git clone https://github.com/neovim/neovim ${HOME}/software/neovim
here=$(pwd)
cd ${HOME}/software/neovim
sudo make CMAKE_BUILD_TYPE=Release
sudo make install
cd $here
ln -sfn ${dot}/.config/nvim/.vimrc ${HOME}/.vimrc
ln -sfn ${dot}/.config/nvim ${HOME}/.config/nvim
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
fi