-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsetup-macbook.sh
More file actions
executable file
·62 lines (49 loc) · 2.6 KB
/
setup-macbook.sh
File metadata and controls
executable file
·62 lines (49 loc) · 2.6 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
#!/usr/bin/env bash
# This script will setup Macbook with fish
# Go through the file and uncomment parts that you don't want
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
######################### Install Homebrew and packages ######################
# ./brew.sh
# ./brew-cask.sh
############################# Install apps from apple store ##################
# brew install mas
# ./mas.sh
########################### Install fisher plugins ###################
# ./fisher.sh
########################### Install docker ###################
# ./install-docker.sh
################################### Symlink stuff ############################
################### Always backs up the previous versions if they exist ###########
# Fish symlinks
DOTFILES_ROOT="`pwd`"
cp "$HOME/.config/fish/aliases.fish" "$HOME/.config/fish/aliases.fish_bak" 2>/dev/null
cp "$HOME/.config/fish/config.fish" "$HOME/.config/fish/config.fish_bak" 2>/dev/null
cp "$HOME/.config/fish/functions.fish" "$HOME/.config/fish/functions.fish_bak" 2>/dev/null
cp "$HOME/.config/fish/path.fish" "$HOME/.config/fish/path.fish_bak" 2>/dev/null
cp "$HOME/.config/fish/fish_plugins" "$HOME/.config/fish/fish_plugins.bak" 2>/dev/null
ln -sf "$DOTFILES_ROOT/.config/fish/aliases.fish" "$HOME/.config/fish/aliases.fish"
ln -sf "$DOTFILES_ROOT/.config/fish/config.fish" "$HOME/.config/fish/config.fish"
ln -sf "$DOTFILES_ROOT/.config/fish/functions.fish" "$HOME/.config/fish/functions.fish"
ln -sf "$DOTFILES_ROOT/.config/fish/path.fish" "$HOME/.config/fish/path.fish"
ln -sf "$DOTFILES_ROOT/.config/fish/fish_plugins" "$HOME/.config/fish/fish_plugins"
# Git symlinks
cp "$HOME/.gitconfig" "$HOME/.gitconfig_bak" 2>/dev/null
cp "$HOME/.gitignore" "$HOME/.gitignore_bak" 2>/dev/null
ln -sf "$DOTFILES_ROOT/git/.gitconfig.symlink" "$HOME/.gitconfig"
ln -sf "$DOTFILES_ROOT/git/.gitignore.symlink" "$HOME/.gitignore"
# Other .rc files
cp "$HOME/.vimrc" "$HOME/.vimrc_bak" 2>/dev/null
ln -sf "$DOTFILES_ROOT/.vimrc.symlink" "$HOME/.vimrc"
# Starship prompt settings
ln -sf "$DOTFILES_ROOT/.config/starship.toml" "$HOME/.config/starship.toml"
# Symlink karabiner config
ln -sf "$DOTFILES_ROOT/.config/karabiner" "$HOME/.config/karabiner"
# Symlink direnv config
ln -sf "$DOTFILES_ROOT/direnv/.direnvrc.symlink" "$HOME/.direnvrc"
########################## Setup Evernote backup folder #######################
mkdir -p "$HOME/Backup/Evernote"
echo 'To set up a cronjob that backs up Evernote, run:'
echo '$ sudo sudo-setup-macbook.sh'