-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·63 lines (52 loc) · 1.76 KB
/
install.sh
File metadata and controls
executable file
·63 lines (52 loc) · 1.76 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
#!/usr/bin/env bash
# Function to check if a command exists
command_exists() {
command -v "$1" &>/dev/null
}
# Function to install packages
install_packages() {
if command_exists brew; then
brew install git fzf bat eza zoxide fd rg tmux bash neovim asdf starship wezterm ghostty atuin git-delta oh-my-posh
elif command_exists port; then
sudo port install git fzf bat eza zoxide fd rg tmux bash neovim asdf starship ghostty atuin git-delta oh-my-posh
else
echo "Neither brew nor macports is installed. Please install one of them first."
exit 1
fi
}
# Function to create symbolic links
create_symlink() {
local target=$1
local link_name=$2
ln -s "$target" "$link_name"
echo "Created symbolic link for $(basename "$link_name")"
}
# Install necessary packages
install_packages
BASEDIR=$(dirname "$0")
cd "$BASEDIR" || exit
# HOME dotfiles
dotfiles=(bashrc bash_aliases zshrc gitignore_global gitconfig p10k.zsh tmux.conf tool-versions zsh_plugins.txt myjan.omp.json)
if [ -n "${dotfiles[*]}" ]; then
for file in "${dotfiles[@]}"; do
create_symlink "${PWD}/${file}" "${HOME}/.${file}"
done
create_symlink "${PWD}/starship.toml" "${HOME}/.config/starship.toml"
fi
# .config directories
config_dirs=(nvim wezterm bat ghostty)
config_basedir="${HOME}/.config"
if [ -n "${config_dirs[*]}" ]; then
for dir in "${config_dirs[@]}"; do
create_symlink "${PWD}/${dir}" "${config_basedir}/${dir}"
done
fi
# install tmux plugin manager
if [ ! -d "$HOME/.tmux/plugins/tpm" ]; then
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
fi
# install antidote plugin manager for zsh
if [ ! -d "$HOME/.antidote" ]; then
echo "Installing antidote..."
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
fi