-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·65 lines (53 loc) · 1.49 KB
/
init.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
#!/bin/bash
# zsh
# zsh setup script
# Update 12/23/23
# Requires zsh, git, curl, fzf, git
# Arch
# powerline-fonts
# noto-fonts-emoji
zshdir=$HOME/.config/zsh
deb_install () {
sudo apt install $1 -y
}
dep_check () {
# Checks for required dependencies and installs if missing
type zsh >/dev/null 2>&1 || { deb_install "zsh"; }
type git >/dev/null 2>&1 || { deb_install "git"; }
type curl >/dev/null 2>&1 || { deb_install "curl"; }
type osc >/dev/null 2>&1 || { /usr/bin/go install -v github.com/theimpostor/osc@latest; }
}
get_zsh () {
echo "Getting zsh configs from gitlab.ogbase.net/cupric/zsh.git"
mkdir -p $zshdir
git clone https://gitlab.ogbase.net/cupric/zsh.git $zshdir
rm -f $HOME/.zshrc && ln -s $zshdir/zshrc $HOME/.zshrc
rm -f $HOME/.zshenv && ln -s $zshdir/zshenv $HOME/.zshenv
}
install_antibody () {
echo "Getting antigen plugin manager from git.io/antibody"
curl -sfL git.io/antibody | sudo sh -s - -b /usr/local/bin
}
install_go () {
echo "Installing go 1.23.0"
curl https://gitlab.ogbase.net/cupric/golang-tools-install-script/-/raw/master/goinstall.sh | bash -s -- --version 1.23.0
}
check_zsh () {
# Change shell if zsh was installed
type zsh >/dev/null 2>&1 || { chsh "-s /bin/zsh"; }
}
directory_clean () {
echo "removing zsh and any files matchin '.z*' "
rm -fdr $HOME/.z* &> /dev/null
rm -fdr $zshdir &> /dev/null
}
if [ "$1" = "clean" ]; then
directory_clean
fi
install_go
sudo apt update &> /dev/null
dep_check
get_zsh
install_antibody
check_zsh
zsh