-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·144 lines (118 loc) · 3.55 KB
/
setup.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
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
#!/bin/bash
DOTFILES_DIR="$HOME/Repos/github.com/chrismgonzalez/dotfiles"
XDG_CONFIG_HOME="$HOME/.config"
create_directories() {
local directories=("$@")
for dir in "${directories[@]}"; do
mkdir -p "$dir"
done
}
create_symlinks() {
local items=("$@")
for item in "${items[@]}"; do
IFS=':' read -r source target <<<"$item"
if [ -L "$target" ]; then
echo "Removing existing symlink $target"
unlink "$target"
elif [ -d "$target" ]; then
echo "Warning: $target is a directory. Skipping..."
continue
elif [ -e "$target" ]; then
echo "Warning: $target already exists. Skipping..."
continue
fi
ln -s "$DOTFILES_DIR/$source" "$target"
echo "Created symlink for $source"
done
}
common_directories=(
"$XDG_CONFIG_HOME/k9s"
"$XDG_CONFIG_HOME/kitty"
)
common_items=(
"starship.toml:$XDG_CONFIG_HOME/starship.toml"
"k9s/skin.yml:$XDG_CONFIG_HOME/k9s/skin.yml"
".inputrc:$HOME/.inputrc"
".tmux.conf:$HOME/.tmux.conf"
"nvim:$XDG_CONFIG_HOME/nvim"
".zprofile:$HOME/.zprofile"
".zshrc:$HOME/.zshrc"
kitty.conf:$XDG_CONFIG_HOME/kitty/kitty.conf
)
create_directories "${common_directories[@]}"
create_symlinks "${common_items[@]}"
# MacOS specific setup
if [[ "$OSTYPE" == darwin* ]]; then
create_directories "${macos_directories[@]}"
create_symlinks "${macos_items[@]}"
fi
# ln -sf "$PWD/.bash_profile" "$HOME"/.bash_profile
# ln -sf "$PWD/.bashrc" "$HOME"/.bashrc
# Zettelkasten
# This one's a little tricky on MacOS because the path contains a space. It needs to be stored as an array,
# and when called it needs to be quoted.
# export ZETTELKASTEN=("/Users/mischa/Library/Mobile Documents/iCloud~md~obsidian/Documents/second-brain-01-07-23")
# export ZETTELKASTEN=("/Users/mischa/Library/Mobile Documents/iCloud~md~obsidian/Documents/Zettelkasten")
# ln -sf "$ZETTELKASTEN" ~/Zettelkasten
#
# iCloud
# export ICLOUD=("/Users/mischa/Library/Mobile Documents/com~apple~CloudDocs")
# ln -sf "$ICLOUD" ~/icloud
# Packages
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# get the font out of the way first, it's the most annoying
# install for Mac using brew.
brew install --cask font-iosevka-nerd-font
brew install --cask font-ubuntu-mono-nerd-font
brew install --cask font-hack-nerd-font
brew install --cask font-meslo-lg-nerd-font
# For ubuntu:
# mkdir -p $HOME/.local/share/fonts
# cp $PWD/fonts/UbuntuMono* $HOME/.local/share/fonts
# brew packages Mac
brew install --cask kitty
install_brew_packages() {
local packages=("$@")
for package in "${packages[@]}"; do
brew install "$package"
done
}
brew_packages=(
"go"
"neovim"
"lazygit"
"tmux"
"uv"
"amethyst"
"fzf"
"fd"
"eza"
"hugo"
"bash-completion@2"
"newsboat"
"kubectl"
"starship"
"gh"
"derailed/k9s/k9s"
"wget"
)
install_brew_packages "${brew_packages[@]}"
# ubuntu packages apt
# sudo apt install ripgrep gh
# ubuntu apt neovim setup
# sudo apt install gcc g++ unzip
# ubuntu brew for vim and neovim setup
# sudo apt install fd fzf kubectl kubectx derailed/k9s/k9s starship
# ubuntu brew for neovim setup
# brew install neovim go lazygit
# ubuntu specific notes
# create symbolic link to neovim from vim when not using neovim on
# Ubuntu systems, because I use the v alias everywhere.
# sudo ln -sf /usr/bin/vim /usr/bin/nvim
# Arch Linux
# pacman packages:
# sudo pacman -Syu zsh zsh-completions ttf-ubuntu-mono-nerd fzf npm unzip tmux ripgrep fd
# set up prompt
# mkdir -p "$HOME/.zsh"
# git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"