This repository was archived by the owner on Oct 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_linux.sh
More file actions
executable file
·153 lines (131 loc) · 3.34 KB
/
setup_linux.sh
File metadata and controls
executable file
·153 lines (131 loc) · 3.34 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
SCRIPTPATH="$(
cd "$(dirname "$0")" > /dev/null 2>&1 || exit
pwd -P
)"
function install_nerdfont() {
echo "Running nerdfont install script..."
bash $SCRIPTPATH/scripts/nerd_font_installer.sh FiraCode --file-name "Fira Code"
}
function install_dotfiles() {
bash $SCRIPTPATH/install_dotfiles.sh --all
}
function install_alacritty_theme() {
echo "Downloading catppuccin Alacritty theme..."
mkdir -p $HOME/.config/alacritty
git clone https://github.com/catppuccin/alacritty.git ~/.config/alacritty/catppuccin
}
function install_packages_from_manager () {
fedora_desktop=(alacritty i3 polybar rofi picom)
fedora_packages=(zsh gh tmux neovim g++ curl neofetch bat lsd python3-pip nodejs-bash-language-server ranger fzf speedtest-cli go)
echo "Downloading core Fedora packages..."
for i in "${fedora_packages[@]}"
do
sudo dnf install -y "$i"
done
if [[ "$1" == "desktop" ]]; then
echo "Fedora Desktop packages requested, downloading..."
for i in "${fedora_desktop[@]}"
do
sudo dnf install -y "$i"
done
fi
}
function install_pip_packages() {
pip_packages=(neovim)
echo "Downloading pip packages..."
for i in "${pip_packages[@]}"
do
pip3 install --user "$i"
done
}
function change_shell (){
echo "Changing shell to ZSH..."
chsh -s $(which zsh)
}
function helptext() {
echo "Script to install dependencies and create symlinks for config files."
echo "USAGE: ./install_config.sh ARGS"
echo "Arguments:"
echo -e "--ohmy\t\tInstall Oh my ZSH"
echo -e "--custom\t\tInstall Oh My Zsh custom plugins"
echo -e "--theme\t\tInstall ZSH theme"
echo -e "--other_symlinks\t\tCreate symlinks for non-nvim configs"
echo -e "--nvim_symlinks\t\tCreate symlinks for all nvim configs"
}
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--all)
shift # shift past the argument
INSTALL_PACKAGES=true
if [[ $1 == "--desltop" ]]; then
DESKTOP_INSTALL=true
fi
INSTALL_PIP_PACKAGES=true
CHANGE_SHELL=true
ALACRITTY_THEME=true
NERDFONT=true
DOTFILES=true
echo "Not implemented"
;;
--linux_packages)
shift
INSTALL_PACKAGES=true
if [[ $1 == "--desktop" ]]; then
shift
DESKTOP_INSTALL=true
fi
;;
--pip_packages)
shift
INSTALL_PIP_PACKAGES=true
;;
--change_shell)
shift
CHANGE_SHELL=true
;;
--alacritty_theme)
shift
ALACRITTY_THEME=true
;;
--nerdfont)
shift
NERDFONT=true
;;
--dotfiles)
shift
DOTFILES=true
;;
--help)
shift
helptext
exit
;;
*)
echo "ERROR: $key is unrecognized"
exit
esac
done
if [[ -n $INSTALL_PACKAGES ]]; then
if [[ -n $DESKTOP_INSTALL ]]; then
install_packages_from_manager "desktop"
else
install_packages_from_manager
fi
fi
if [[ -n $CHANGE_SHELL ]]; then
change_shell
fi
if [[ -n $INSTALL_PIP_PACKAGES ]]; then
install_pip_packages
fi
if [[ -n $DOTFILES ]]; then
install_dotfiles
fi
if [[ -n $ALACRITTY_THEME ]]; then
install_alacritty_theme
fi
if [[ -n $NERDFONT ]]; then
install_nerdfont
fi