-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·70 lines (63 loc) · 1.54 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
#!/bin/bash
# Define and sort all required packages
required_packages=(
build-essential
ca-certificates
curl
fzf
fuse
gh
gnome-control-center
jq
libbz2-dev
libffi-dev
libfuse2
liblzma-dev
libreadline-dev
libsqlite3-dev
libssl-dev
make
openjdk-11-jdk
openvpn
python3-dev
tmux
tree
unzip
wget
xclip
zlib1g-dev
zsh
)
echo "Updating package list and ensuring all utilities are installed or at their latest version..."
sudo apt update
# Install or update all required packages
sudo apt install -y "${required_packages[@]}"
# Check if user.name and user.email are already set
user_name=$(git config --get user.name)
user_email=$(git config --get user.email)
if [ -z "$user_name" ]; then
read -r -p "Enter your GitHub full name: " user_name
git config --global user.name "$user_name"
fi
if [ -z "$user_email" ]; then
read -r -p "Enter your email address: " user_email
git config --global user.email "$user_email"
fi
# Check if the default shell is Zsh
if [ "$SHELL" = "$(which zsh)" ]; then
echo "Default shell is already Zsh."
else
echo "Default shell is not Zsh. Attempting to change shell to Zsh..."
if sudo chsh -s "$(which zsh)" "$USER"; then
touch ${HOME}/.zshrc
echo "Shell changed to Zsh. Please re-login and rerun this script."
echo "Or run"
echo "cd ${HOME}/dotfiles && make -f Makefile"
echo "Exiting..."
sleep 3
exit 0
else
echo "Failed to change the shell. Please have someone with root access run 'chsh -s $(which zsh) $USER'."
fi
fi
make -f Makefile