Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·82 lines (64 loc) · 2.96 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·82 lines (64 loc) · 2.96 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
79
80
81
82
#!/bin/sh
echo " ######################################### Starting JPB custom stuff"
# `git pull` strategy should be `rebase`
echo "#### Setting git pull strategy to rebase"
git config --global pull.rebase true
# Remove existing symlinks if they exist
echo "#### Setting up symlinks"
rm -f ~/.oh-my-zsh/custom/aliases.zsh
rm -f ~/.oh-my-zsh/custom/plugins/gday/gday.plugin.zsh
rm -f ~/.oh-my-zsh/custom/plugins/gh_project/gh_project.plugin.zsh
rm -f ~/.config/starship.toml
# Create directories if they don't exist
mkdir -p ~/.oh-my-zsh/custom/plugins/gday
mkdir -p ~/.oh-my-zsh/custom/plugins/gh_project
mkdir -p ~/.config
# Create new symlinks
ln -s ~/workspace/dot-rot/aliases.zsh ~/.oh-my-zsh/custom/aliases.zsh
ln -s ~/workspace/dot-rot/config/starship.toml ~/.config/starship.toml
ln -s ~/workspace/dot-rot/plugins/gday/gday.plugin.zsh ~/.oh-my-zsh/custom/plugins/gday/gday.plugin.zsh
ln -s ~/workspace/dot-rot/plugins/gh_project/gh_project.plugin.zsh ~/.oh-my-zsh/custom/plugins/gh_project/gh_project.plugin.zsh
# Enable gday plugin
if ! grep -q "plugins=(.*gday.*)" ~/.zshrc; then
sed -i '' 's/plugins=(/plugins=(gday /' ~/.zshrc
fi
# install vscode extensions (skip if --no-vscode flag is passed)
if [[ "$1" != "--no-vscode" ]]; then
echo "##### Installing VS Code extensions (this may take a while)"
echo "##### Skip this step by running with --no-vscode flag"
cat ./extensions.list | xargs -L1 code --install-extension
else
echo "##### Skipping VS Code extensions installation"
fi
# VS Code setup
if [[ "$1" != "--no-vscode" ]]; then
echo "#### Setting up VS Code configuration"
# Backup and symlink settings
VSCODE_USER_DIR="$HOME/Library/Application Support/Code/User"
mkdir -p "$VSCODE_USER_DIR"
if [ -f "$VSCODE_USER_DIR/settings.json" ]; then
cp "$VSCODE_USER_DIR/settings.json" "$VSCODE_USER_DIR/settings.json.backup.$(date +%F_%R)"
fi
ln -sf ~/workspace/dot-rot/vscode-global-settings.json "$VSCODE_USER_DIR/settings.json"
# Symlink keybindings
ln -sf ~/workspace/dot-rot/keybindings.json "$VSCODE_USER_DIR/keybindings.json"
# Symlink snippets
mkdir -p "$VSCODE_USER_DIR/snippets"
ln -sf ~/workspace/dot-rot/snippets/markdown.json "$VSCODE_USER_DIR/snippets/markdown.json"
fi
# Download assets
echo "#### Downloading assets"
mkdir -p ~/Pictures
# Download avatar
if [ ! -f ~/Pictures/jpb-avatar.png ]; then
echo "Downloading JPB avatar..."
curl -L https://www.jonathanpberger.com/images/jpb-avatar.png -o ~/Pictures/jpb-avatar.png
fi
# Download backgrounds
if [ ! -f ~/Pictures/agile-desktop-backgrounds.zip ]; then
echo "Downloading Agile desktop backgrounds..."
curl -L https://www.jonathanpberger.com/agile-desktop-backgrounds.zip -o ~/Pictures/agile-desktop-backgrounds.zip
fi
echo "############ you'll need to unzip, add to Settings > Wallpaper, and set to auto-rotate manually."
echo "####### copy secrets manually, e.g. ~/.gcalclirc and ~/.gcalcli_oauth"
echo " ######################################### Finished JPB custom stuff"