forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfresh.sh
executable file
·121 lines (90 loc) · 3.48 KB
/
fresh.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
#!/bin/sh
echo "Setting up your Mac..."
# Check for Oh My Zsh and install if we don't have it
if test ! $(which omz); then
/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/HEAD/tools/install.sh)"
fi
# Check for Homebrew and install if we don't have it
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Removes .zshrc from $HOME (if it exists) and symlinks the .zshrc file from the .dotfiles
rm -rf $HOME/.zshrc
ln -sw $HOME/.dotfiles/.zshrc $HOME/.zshrc
# Removes .p10k.zsh from $HOME (if it exists) and symlinks the .p10k.zsh file from the .dotfiles
rm -rf $HOME/.p10k.zsh
ln -sw $HOME/.dotfiles/.p10k.zsh $HOME/.p10k.zsh
# Update Homebrew recipes
brew update
# Install all our dependencies with bundle (See Brewfile)
brew tap homebrew/bundle
brew bundle --file ./Brewfile
# Set default MySQL root password and auth type
mysql -u root -e "ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'password'; FLUSH PRIVILEGES;"
# Create a Sites directory
mkdir $HOME/Sites
# Create sites subdirectories
mkdir $HOME/Sites/php
# Clone Github repositories
./clone.sh
# Symlink the Mackup config file to the home directory
ln -s $DOTFILES/.mackup.cfg $HOME/.mackup.cfg
# Set macOS preferences - we will run this last because this will reload the shell
source ./.macos
# Removes karabiner.json from $HOME/.config/karabiner (if it exists) and symlinks the karabiner.json file from the .dotfiles
rm -rf $HOME/.config/karabiner/karabiner.json
mkdir -p $HOME/.config/karabiner
ln -s karabiner.json $HOME/.config/karabiner/karabiner.json
# Removes .ideavimrc from $HOME/.ideavimrc (if it exists) and symlinks the .ideavimrc file from the .dotfiles
rm -rf $HOME/.ideavimrc
ln -s $DOTFILES/.ideavimrc $HOME/.ideavimrc
# Set iterm config files.
defaults write com.googlecode.iterm2 PrefsCustomFolder -string "$DOTFILES/iterm2"
defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true
# Neovim
rm -rf $HOME/.config/nvim
ln -s $DOTFILES/nvchad $HOME/.config/nvim
# Alacritty
rm -rf $HOME/.config/alacritty
ln -s $DOTFILES/alacritty $HOME/.config/alacritty
# Wezterm
rm -rf $HOME/.config/wezterm
ln -s $DOTFILES/wezterm $HOME/.config/wezterm
# Kitty
rm -rf $HOME/.config/kitty
ln -s $DOTFILES/kitty $HOME/.config/kitty
# Ghostty
rm -rf $HOME/.config/ghostty
ln -s $DOTFILES/ghostty $HOME/.config/ghostty
# Tmux
rm -rf $HOME/.tmux
rm -rf $HOME/.tmux.conf
ln -s $DOTFILES/tmux/.tmux $HOME/.tmux
ln -s $DOTFILES/tmux/.tmux.conf $HOME/.tmux.conf
# Zellij
rm -rf $HOME/.config/zellij
ln -s $DOTFILES/zellij $HOME/.config/zellij
# Git
ln -sf $DOTFILES/git/gitconfig $HOME/.gitconfig
ln -sf $DOTFILES/git/gitignore_global $HOME/.gitignore_global
# Phpactor
rm -rf $HOME/.config/phpactor
ln -s $DOTFILES/phpactor $HOME/.config/phpactor
# Mise (Node | Ruby ...etc Version Manager)
ln -sf $DOTFILES/mise/.default-npm-packages $HOME/.default-npm-packages
# Bat
rm -rf $HOME/.config/bat
ln -s $DOTFILES/bat $HOME/.config/bat
# FZF
rm -rf $HOME/fzf
ln -s $DOTFILES/fzf $HOME/fzf
# Yazi
rm -rf $HOME/.config/yazi
ln -s $DOTFILES/yazi $HOME/.config/yazi
# k9s
rm -rf ~/Library/Application\ Support/k9s/config.yaml
rm -rf ~/Library/Application\ Support/k9s/skins
ln -s $DOTFILES/k9s/config.yaml $HOME/Library/Application\ Support/k9s/config.yaml
ln -s $DOTFILES/k9s/skins $HOME/Library/Application\ Support/k9s/skins