forked from codeforamerica/clientcomm-setup
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall
More file actions
executable file
·78 lines (63 loc) · 1.86 KB
/
install
File metadata and controls
executable file
·78 lines (63 loc) · 1.86 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
#!/bin/zsh
setup() {
SETUPDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
}
install_omz() {
echo "Installing Oh My Zsh...\n"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
}
install_nvim_config() {
echo "Installing Neovim config...\n"
mkdir -p "$HOME/.config"
if [ -d "$HOME/.config/nvim" ]; then
echo '!!! ~/.config/nvim already exists !!!\n'
else
pushd "$HOME/.config"
git clone https://github.com/tmaybe/neovim-lazyvim-config nvim
popd
fi
}
link_helix_config() {
echo "Linking Helix configs...\n"
mkdir -p "$HOME/.config/helix"
ln -sf "$SETUPDIR/helix-config.toml" "$HOME/.config/helix/config.toml"
ln -sf "$SETUPDIR/helix-languages.toml" "$HOME/.config/helix/languages.toml"
}
link_dotfiles() {
echo "Linking dotfiles...\n"
# custom scripts directory
if [ ! -d "$HOME/bin" ]; then
ln -sf "$SETUPDIR/bin" "$HOME/bin"
else
echo '!!! ~/bin already exists !!!\n'
fi
# move the default .zshrc if omz added it
if [ -f "$HOME/.zshrc" ] && [ ! -L "$HOME/.zshrc" ]; then
echo "!!! Renaming existing .zshrc to .zshrc.omz-installed !!!\n"
mv "$HOME/.zshrc" "$HOME/.zshrc.omz-installed"
fi
# so we can symlink our own
ln -sf "$SETUPDIR/.zshrc" "$HOME/.zshrc"
# custom terminal prompt theme
ln -sf "$SETUPDIR/tagnoster.zsh-theme" "$HOME/.oh-my-zsh/themes/tagnoster.zsh-theme"
# git
cp -f "$SETUPDIR/.gitconfig" "$HOME/.gitconfig"
# hammerspoon
mkdir -p "$HOME/.hammerspoon"
ln -sf "$SETUPDIR/init.lua" "$HOME/.hammerspoon/init.lua"
# kitty
mkdir -p "$HOME/.config/kitty"
ln -sf "$SETUPDIR/kitty.conf" "$HOME/.config/kitty/kitty.conf"
}
main() {
setup
echo "Installing applications with homebrew...\n"
brew update
brew bundle
brew link git --force
install_omz
install_nvim_config
link_helix_config
link_dotfiles
}
main $@