-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_macos.sh
executable file
·86 lines (72 loc) · 2.29 KB
/
install_macos.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
#!/bin/bash
set -e
echo "Install Softwares for macOS"
export NONINTERACTIVE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install mas git make llvm
# Install xcode command line tools
# git make clang will be installed by xcode-select --install
# mas install 497799835
# xcode-select --install
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
DIR="$DIR/../general"
git clone https://github.com/BrightXiaoHan/nvchad-starter.git $DIR/NvChad
# get current dir
mkdir -p ~/.config
# test if python3 is installed
if ! [ -x "$(command -v python3)" ]; then
echo 'Error: python3 is not installed.' >&2
exit 1
fi
# link nvim dir if .config/nvim not exist
if [ ! -d ~/.config/nvim ]; then
ln -sf $DIR/NvChad/ ~/.config/nvim
else
echo "nvim config already exist. Please backup or remove it."
exit 1
fi
# link tmux dir if .config/tmux not exist
if [ ! -d ~/.config/tmux ]; then
ln -sf $DIR/tmux/ ~/.config/
else
echo "tmux config already exist. Please backup or remove it."
exit 1
fi
# link fish dir if .config/fish not exist
if [ ! -d ~/.config/fish ]; then
ln -sf $DIR/fish/ ~/.config/
else
echo "fish config already exist. Please backup or remove it."
exit 1
fi
if [ ! -d ~/.ssh ]; then
mkdir ~/.ssh
fi
ln -sf $DIR/ssh/config ~/.ssh/config
ln -sf $DIR/ssh/id_rsa.pub ~/.ssh/id_rsa.pub
# add authorized_keys into .ssh/authorized_keys
if [ ! -f ~/.ssh/authorized_keys ]; then
touch ~/.ssh/authorized_keys
fi
# if id_rsa.pub not in authorized_keys, add it
if ! grep -q "$(cat ~/.ssh/id_rsa.pub)" ~/.ssh/authorized_keys; then
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
fi
ln -sf $DIR/gitconfig ~/.gitconfig
ln -sf $DIR/mambarc ~/.mambarc
brew install --quiet \
git-lfs tmux fish neovim ripgrep fzf node aliyunpan trzsz-ssh \
cmake poetry starship zoxide openssh \
openssl readline sqlite3 xz zlib gh gnu-sed uv
# install font
brew tap homebrew/cask-fonts
brew install --quiet --cask font-jetbrains-mono
brew install --quiet --cask \
iterm2 wechat wpsoffice-cn \
dingtalk todesk microsoft-edge adrive \
appcleaner downie typora visual-studio-code \
parallels tencent-meeting telegram microsoft-remote-desktop \
obs bing-wallpaper qqmusic keycastr
# missing sogouinput, clashx