-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·79 lines (62 loc) · 1.97 KB
/
install.sh
File metadata and controls
executable file
·79 lines (62 loc) · 1.97 KB
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
# !/bin/bash
# https://github.com/mattjmorrison/dotfiles/blob/master/install-scripts/Linux/
# https://github.com/nickjj/dotfiles/blob/master/install
# ./install.sh
PACKAGES="git vim-gtk3 neovim zsh zinit"
DOT=${HOME}/.dotfiles
OS_TYPE="$(uname | tr "[:upper:]" "[:lower:]")"
ZSH_INSTALL_SCRIPT=${HOME}/.dotfiles/zsh/zsh_install.sh
if [[ ! -d $DOT ]]; then
echo "Dotfiles directory not found! Please check your installation."
exit
fi
if [[ ! -d $ZSH_INSTALL_SCRIPT ]]; then
echo "Zsh install file not found! Please check your installation."
exit
fi
echo "Dotfiles directory set as ${DOT}\n"
cat <<EOF
The following packages and their dependencies are about to be installed:
$PACKAGES
EOF
while true; do
read -rp "Do you want to install the above packages? (y/n) " yn
case "${yn}" in [Yy]*)
if type -p vim > /dev/null; then
echo "Installing vim-gtk3 (vim gnome)..."
sudo apt -y install vim-gtk3
[ type -p vim > /dev/null ] && echo "Successfully installed vim!\n"
else
echo "Vim found, skipping installation."
fi
if type -p nvim > /dev/null; then
echo "Installing nvim..."
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.appimage
chmod u+x nvim-linux-x86_64.appimage
./nvim-linux-x86_64.appimage
# expose globally
sudo mkdir -p /opt/nvim
sudo mv nvim-linux-x86_64.appimage /opt/nvim/nvim
[ type -p nvim > /dev/null ] && echo "Successfully installed nvim!\n"
else
echo "Nvim found, skipping installation."
# TODO: create script
# script will handle checking previous installs
# chmod +x ${ZSH_INSTALL_SCRIPT}
# source ${ZSH_INSTALL_SCRIPT}
echo "Installing zsh..."
sudo apt install zsh
break ;;
[Nn]*)
exit ;;
*)
printf "Please answer y or n\n\n" ;;
esac
done
# setup symlinks
echo "Setting up symlinks..."
sh ./setup-symlinks.sh
# default to zsh
echo "Changing default shell to $(which zsh)..."
sudo chsh -s $(which zsh)
echo "Installation complete!"